Changeset 3166
- Timestamp:
- Nov 29, 2017 10:38:49 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/find_undoc.py
r2027 r3166 36 36 continue 37 37 else: 38 print fil+' undocumented'38 print(fil+' undocumented') 39 39 undoc.append(fil) 40 40 # generate code to place in a .rst file 41 41 if undoc: 42 print "\n# place this code somewhere in the .rst files\n#"42 print("\n# place this code somewhere in the .rst files\n#") 43 43 for fil in undoc: 44 print ".. automodule:: "+os.path.splitext(os.path.split(fil)[1])[0]45 print " :members: "46 print ""44 print(".. automodule:: "+os.path.splitext(os.path.split(fil)[1])[0]) 45 print(" :members: ") 46 print("") -
trunk/makeBat.py
r2803 r3166 55 55 # Bob reports a problem using pythonw.exe w/Canopy on Windows, so change that if used 56 56 if pythonexe.lower().endswith('pythonw.exe'): 57 print " using python.exe rather than "+pythonexe57 print(" using python.exe rather than "+pythonexe) 58 58 pythonexe = os.path.join(os.path.split(pythonexe)[0],'python.exe') 59 print " now pythonexe="+pythonexe59 print(" now pythonexe="+pythonexe) 60 60 # create a GSAS-II script 61 61 fp = open(os.path.join(G2bat),'w') … … 68 68 fp.write(Script.format(pexe,G2s)) 69 69 fp.close() 70 print '\nCreated GSAS-II batch file RunGSASII.bat in '+gsaspath70 print('\nCreated GSAS-II batch file RunGSASII.bat in '+gsaspath) 71 71 72 72 # Associate a script and icon with .gpx files … … 84 84 winreg.CloseKey(openkey) 85 85 winreg.CloseKey(gpxkey) 86 print 'Assigned icon and batch file to .gpx files'86 print('Assigned icon and batch file to .gpx files') 87 87 88 88 try: … … 91 91 win32com.shell.shellcon.SHCNE_ASSOCCHANGED, 0, None, None) 92 92 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') 94 94 except: 95 print 'Unexpected error on explorer refresh. Please report:'95 print('Unexpected error on explorer refresh. Please report:') 96 96 import traceback 97 print traceback.format_exc()97 print(traceback.format_exc()) 98 98 99 99 # make a desktop shortcut to GSAS-II … … 109 109 shobj.IconLocation = G2icon 110 110 shobj.save() 111 print 'Created shortcut to start GSAS-II on desktop'111 print('Created shortcut to start GSAS-II on desktop') 112 112 except ImportError: 113 print 'Module pywin32 not present, will not make desktop shortcut'113 print('Module pywin32 not present, will not make desktop shortcut') 114 114 except: 115 print 'Unexpected error making desktop shortcut. Please report:'115 print('Unexpected error making desktop shortcut. Please report:') 116 116 import traceback 117 print traceback.format_exc()117 print(traceback.format_exc()) 118 118 -
trunk/makeMacApp.py
r2803 r3166 151 151 #print testout,errout 152 152 if testout.strip() != "OK": 153 print 'Run of python app failed, resorting to non-app version of Python, Alas!' 154 pythonapp = sys.executable 155 # is this brain-dead Canopy 1.4.0, if so, switch to pythonw 156 try: 157 import canopy.version 158 if canopy.version.version == '1.4.0': 159 print 'using pythonw for Canopy 1.4.0' 160 pythonapp = os.path.join(os.path.split(pythonapp)[0],'pythonw') 161 if not os.path.exists(pythonapp): 162 raise Exception('no pythonw here: '+pythonapp) 163 except ImportError: 164 pass 153 print('Run of wx in python failed, looking for pythonw') 154 pythonapp = os.path.join(os.path.split(sys.executable)[0],'pythonw') 155 if not os.path.exists(pythonapp): 156 raise Exception('no pythonw found with '+sys.executable) 165 157 newpython = pythonapp 166 158 else: … … 179 171 try: 180 172 subprocess.check_output(["osacompile","-o",apppath,shell],stderr=subprocess.STDOUT) 181 except subprocess.CalledProcessError ,msg:182 print 183 Report the next message along with details about your Mac to toby@anl.gov''' 184 print msg.output173 except subprocess.CalledProcessError as msg: 174 print('''Error compiling AppleScript. 175 Report the next message along with details about your Mac to toby@anl.gov''') 176 print(msg.output) 185 177 sys.exit() 186 178 -
trunk/scanCCD.py
r3142 r3166 167 167 168 168 import histosigma2d as h2d 169 print 'Begin image integration'169 print('Begin image integration') 170 170 scaley = self.data['pixel'][1]/1000. 171 171 tthStart,tthEnd,tthStep = self.data['2thScan'] … … 204 204 jBeg = jBlk*blkSize 205 205 jFin = jBeg+blkSize 206 print 'Process map block:',nBlk,iBlk,jBlk,' offset:',iBegi,' limits:',iBeg,iFin,jBeg,jFin206 print('Process map block:',nBlk,iBlk,jBlk,' offset:',iBegi,' limits:',iBeg,iFin,jBeg,jFin) 207 207 TA = Make2ThetaMap(self.data,(iBeg,iFin),(jBeg,jFin)) #2-theta & Y arrays & create position mask 208 208 Block = image[iBeg-iBegi:iFin-iBegi,jBeg:jFin] … … 224 224 break 225 225 else: 226 print 'file '+imagefile+' skipped'226 print('file '+imagefile+' skipped') 227 227 nBlk += N*N 228 228 GoOn = dlg.Update(nBlk)[0] … … 240 240 dlg.Destroy() 241 241 Scale = np.sum(Qmat)/np.sum(H0) 242 print 'SumI: ',np.sum(H0),' SumV: ',np.sum(Qmat),' Scale:',Scale243 print 'Integration complete'244 print "Elapsed time:","%8.3f"%(t1-t0), "s"242 print('SumI: ',np.sum(H0),' SumV: ',np.sum(Qmat),' Scale:',Scale) 243 print('Integration complete') 244 print("Elapsed time:","%8.3f"%(t1-t0), "s") 245 245 self.Hxyw = [H1,Scale*H0.T[0],np.sqrt(Qmat.T[0])] 246 print 246 print() 247 247 self.PlotXY(self.Hxyw,True,type='Integration result') 248 248 … … 252 252 file = open(powderfile,'w') 253 253 file.write('#%s\n'%('from scanCCD image '+self.imagefiles[0])) 254 print 'save powder pattern to file: ',powderfile254 print('save powder pattern to file: ',powderfile) 255 255 wx.BeginBusyCursor() 256 256 try: … … 269 269 finally: 270 270 wx.EndBusyCursor() 271 print 'powder pattern file written'271 print('powder pattern file written') 272 272 273 273 if not self.Hxyw: … … 280 280 try: 281 281 if dlg.ShowModal() == wx.ID_OK: 282 print dlg.GetFilename()282 print(dlg.GetFilename()) 283 283 powderfile = dlg.GetPath() 284 284 if 'fxye' in powderfile: -
trunk/testDeriv.py
r2551 r3166 105 105 G2mv.GenerateConstraints(groups,parmlist,self.varylist,self.constrDict,self.fixedList,self.parmDict) 106 106 self.UpdateControls(event) 107 print G2mv.VarRemapShow(self.varylist)108 print 'Dependent Vary List:',self.depVarList107 print(G2mv.VarRemapShow(self.varylist)) 108 print('Dependent Vary List:',self.depVarList) 109 109 finally: 110 110 dlg.Destroy() … … 165 165 sortby = 'tottime' 166 166 ps = pstats.Stats(pr, stream=s).strip_dirs().sort_stats(sortby) 167 print 'Profiler of function calculation; top 50% of routines:'167 print('Profiler of function calculation; top 50% of routines:') 168 168 ps.print_stats("GSASII",.5) 169 print s.getvalue()169 print(s.getvalue()) 170 170 fplot.plot(M,'r',label='M') 171 171 fplot.legend(loc='best') … … 186 186 ps = pstats.Stats(pr, stream=s).strip_dirs().sort_stats(sortby) 187 187 ps.print_stats("GSASII",.5) 188 print 'Profiler of '+name+' derivative calculation; top 50% of routines:'189 print s.getvalue()188 print('Profiler of '+name+' derivative calculation; top 50% of routines:') 189 print(s.getvalue()) 190 190 M2 = dMdV[varyList.index(name)] 191 191 hplot.plot(M2,'b',label='analytic deriv') 192 192 mmin = np.min(dMdV[varyList.index(name)]) 193 193 mmax = np.max(dMdV[varyList.index(name)]) 194 print 'parameter:',name,self.parmDict[name],delt,mmin,mmax194 print('parameter:',name,self.parmDict[name],delt,mmin,mmax) 195 195 if name in self.varylist: 196 196 self.values[self.varylist.index(name)] -= delt -
trunk/testSSymbols.py
r3000 r3166 100 100 msg = 'Superspace Group Information' 101 101 G2G.SGMessageBox(self,msg,text,table).Show() 102 print 'Super spacegroup operators for '+SSGData['SSpGrp']102 print('Super spacegroup operators for '+SSGData['SSpGrp']) 103 103 for Op in SSGData['SSGOps']: 104 print G2spc.SSMT2text(Op).replace(' ','')104 print(G2spc.SSMT2text(Op).replace(' ','')) 105 105 if SGData['SGInv']: 106 106 for Op in SSGData['SSGOps']: 107 107 Op = [-Op[0],-Op[1]%1.] 108 print G2spc.SSMT2text(Op).replace(' ','')108 print(G2spc.SSMT2text(Op).replace(' ','')) 109 109 else: 110 110 text = [E+'\nSuperspace Group set to previous'] -
trunk/testinp/genhkltest.py
r103 r3166 30 30 #ms.show_summary() 31 31 spcg = ("%s" % ms.space_group_info()).split(':')[0] 32 print spcg32 print(spcg) 33 33 fp.write("'%s': [\n" % spcg) 34 34 fp.write("%s ,\n" % ms.unit_cell()) … … 37 37 if hkllist.has_key(d): 38 38 hkllist[d].append(hkl) 39 print hkllist[d]39 print(hkllist[d]) 40 40 else: 41 41 hkllist[d] = [hkl,] … … 89 89 if len(spcglist) > 1: 90 90 if spcglist[1] == 'R': spcg += ' R' 91 print spcg91 print(spcg) 92 92 #fp.write("'%s': [\n" % spcg) 93 93 fp.write("'%s': [\n" % sg) -
trunk/unit_tests.py
r1077 r3166 35 35 test_GSASIIspc() 36 36 test_GSASIIlattice() 37 print "OK"37 print("OK")
Note: See TracChangeset
for help on using the changeset viewer.