import os, sys try: import psyco psyco.profile() lastchar='w' except: lastchar='o' try: import gtk, pango, gobject assert gtk.pygtk_version >= (2,4) except: print "flauxtext requires pygtk 2.4 or later. download it here:" print "http://www.pygtk.org/" sys.exit(1) try: import flauxtext dr=os.path.dirname(flauxtext.__file__) except: if 'flauxtext.pyw' in os.listdir(os.path.dirname(__file__)): dr=os.path.dirname(__file__) else: print "i couldn't find flauxtext.pyw" print "please put this script in the same directory as flauxtext.pyw, then rerun it." sys.exit(2) if lastchar=='o': os.system(exe+' -O '+os.path.join(dr, 'flauxtext.pyw')+' -v') #compile if os.name=='nt': fn=r'C:\windows\system32\flauxtext.bat' open(fn,'w').write('start '+os.path.join(dr, 'flauxtext.py'+lastchar)+' %1 %2 %3 %4 %5 %6 %7 %8 %9') else: fn=os.path.join(os.defpath.split(os.pathsep)[-1],'flauxtext') open(fn,'w').write('#!/bin/sh\n' + sys.executable+' '+os.path.join(dr, 'flauxtext.py'+lastchar)+' "$@" &') print 'wrote',fn