Changeset 3166 for trunk/makeBat.py


Ignore:
Timestamp:
Nov 29, 2017 10:38:49 PM (4 years ago)
Author:
toby
Message:

Misc Py3 fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/makeBat.py

    r2803 r3166  
    5555    # Bob reports a problem using pythonw.exe w/Canopy on Windows, so change that if used
    5656    if pythonexe.lower().endswith('pythonw.exe'):
    57         print "  using python.exe rather than "+pythonexe
     57        print("  using python.exe rather than "+pythonexe)
    5858        pythonexe = os.path.join(os.path.split(pythonexe)[0],'python.exe')
    59         print "  now pythonexe="+pythonexe
     59        print("  now pythonexe="+pythonexe)
    6060    # create a GSAS-II script
    6161    fp = open(os.path.join(G2bat),'w')
     
    6868    fp.write(Script.format(pexe,G2s))
    6969    fp.close()
    70     print '\nCreated GSAS-II batch file RunGSASII.bat in '+gsaspath
     70    print('\nCreated GSAS-II batch file RunGSASII.bat in '+gsaspath)
    7171
    7272    # Associate a script and icon with .gpx files
     
    8484    winreg.CloseKey(openkey)
    8585    winreg.CloseKey(gpxkey)
    86     print 'Assigned icon and batch file to .gpx files'
     86    print('Assigned icon and batch file to .gpx files')
    8787
    8888    try:
     
    9191            win32com.shell.shellcon.SHCNE_ASSOCCHANGED, 0, None, None)
    9292    except ImportError:
    93         print 'Module pywin32 not present, login again to see file types properly'
     93        print('Module pywin32 not present, login again to see file types properly')
    9494    except:
    95         print 'Unexpected error on explorer refresh. Please report:'
     95        print('Unexpected error on explorer refresh. Please report:')
    9696        import traceback
    97         print traceback.format_exc()
     97        print(traceback.format_exc())
    9898
    9999    # make a desktop shortcut to GSAS-II
     
    109109        shobj.IconLocation = G2icon
    110110        shobj.save()
    111         print 'Created shortcut to start GSAS-II on desktop'
     111        print('Created shortcut to start GSAS-II on desktop')
    112112    except ImportError:
    113         print 'Module pywin32 not present, will not make desktop shortcut'
     113        print('Module pywin32 not present, will not make desktop shortcut')
    114114    except:
    115         print 'Unexpected error making desktop shortcut. Please report:'
     115        print('Unexpected error making desktop shortcut. Please report:')
    116116        import traceback
    117         print traceback.format_exc()
     117        print(traceback.format_exc())
    118118   
Note: See TracChangeset for help on using the changeset viewer.