make rename and executes work in linux

This commit is contained in:
steffen123 2010-06-20 13:52:44 +02:00
parent 9543413b43
commit 4d42953135
3 changed files with 13 additions and 3 deletions

View File

@ -25,5 +25,8 @@ import sys
sys.stdout.write('fpdb.py has been renamed to fpdb.pyw - now calling fpdb.pyw ...\n\n')
sys.stdout.flush()
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ)
if os.name=='nt':
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ)
else:
os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ)
# first arg is ignored (name of program being run)

View File

@ -1,4 +1,5 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#Copyright 2008 Steffen Jobbagy-Felso
#This program is free software: you can redistribute it and/or modify
@ -35,7 +36,10 @@ if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sy
os.environ['PATH'] = tmppath
print "Python " + sys.version[0:3] + ' - press return to continue\n'
sys.stdin.readline()
if os.name=='nt':
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run)
else:
os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run)
else:
print "\npython 2.5 not found, please install python 2.5 or 2.6 for fpdb\n"
raw_input("Press ENTER to continue.")

View File

@ -27,5 +27,8 @@ os.chdir(sys.path[0])
#print "sys.path[0] =", sys.path[0], "cwd =", os.getcwd()
os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ)
if os.name=='nt':
os.execvpe('pythonw.exe', ('pythonw.exe', 'fpdb.pyw', '-r'), os.environ)
else:
os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ)
# first arg is ignored (name of program being run)