Last login: Thu Feb 9 10:09:47 on ttys000 odd-2% ipython Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) Type "copyright", "credits" or "license" for more information. IPython 0.10.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from Tkinter import * In [2]: import kFileDialog --------------------------------------------------------------------------- ImportError Traceback (most recent call last) /Users/stevel/ in () ImportError: No module named kFileDialog In [3]: import tkFileDialog In [4]: x=tkFileDialog. tkFileDialog.Dialog tkFileDialog.__new__ tkFileDialog.Directory tkFileDialog.__package__ tkFileDialog.Open tkFileDialog.__reduce__ tkFileDialog.SaveAs tkFileDialog.__reduce_ex__ tkFileDialog._Dialog tkFileDialog.__repr__ tkFileDialog.__builtins__ tkFileDialog.__setattr__ tkFileDialog.__class__ tkFileDialog.__sizeof__ tkFileDialog.__delattr__ tkFileDialog.__str__ tkFileDialog.__dict__ tkFileDialog.__subclasshook__ tkFileDialog.__doc__ tkFileDialog.askdirectory tkFileDialog.__file__ tkFileDialog.askopenfile tkFileDialog.__format__ tkFileDialog.askopenfilename tkFileDialog.__getattribute__ tkFileDialog.askopenfilenames tkFileDialog.__hash__ tkFileDialog.askopenfiles tkFileDialog.__init__ tkFileDialog.asksaveasfile tkFileDialog.__name__ tkFileDialog.asksaveasfilename In [4]: x=tkFileDialog.askopenfi tkFileDialog.askopenfile tkFileDialog.askopenfilenames tkFileDialog.askopenfilename tkFileDialog.askopenfiles In [4]: x=tkFileDialog.askopenfilen tkFileDialog.askopenfilename tkFileDialog.askopenfilenames In [4]: x=tkFileDialog.askopenfilename() In [5]: x Out[5]: '/Users/stevel/Documents/msa2008_1.pdf' In [6]: import tkMessageBox In [7]: tkMessageBox. tkMessageBox.ABORT tkMessageBox.__format__ tkMessageBox.ABORTRETRYIGNORE tkMessageBox.__getattribute__ tkMessageBox.CANCEL tkMessageBox.__hash__ tkMessageBox.Dialog tkMessageBox.__init__ tkMessageBox.ERROR tkMessageBox.__name__ tkMessageBox.IGNORE tkMessageBox.__new__ tkMessageBox.INFO tkMessageBox.__package__ tkMessageBox.Message tkMessageBox.__reduce__ tkMessageBox.NO tkMessageBox.__reduce_ex__ tkMessageBox.OK tkMessageBox.__repr__ tkMessageBox.OKCANCEL tkMessageBox.__setattr__ tkMessageBox.QUESTION tkMessageBox.__sizeof__ tkMessageBox.RETRY tkMessageBox.__str__ tkMessageBox.RETRYCANCEL tkMessageBox.__subclasshook__ tkMessageBox.WARNING tkMessageBox._show tkMessageBox.YES tkMessageBox.askokcancel tkMessageBox.YESNO tkMessageBox.askquestion tkMessageBox.YESNOCANCEL tkMessageBox.askretrycancel tkMessageBox.__builtins__ tkMessageBox.askyesno tkMessageBox.__class__ tkMessageBox.askyesnocancel tkMessageBox.__delattr__ tkMessageBox.showerror tkMessageBox.__dict__ tkMessageBox.showinfo tkMessageBox.__doc__ tkMessageBox.showwarning tkMessageBox.__file__ In [7]: tkMessageBox.showerror("oops","something really bad happened") Out[7]: 'ok' In [8]: tkMessageBox.askyesnocancel("Should I continue ?") In [9]: a=tkMessageBox.askyesnocancel("Should I continue ?") In [10]: a Out[10]: True In [11]: help(tkMessageBox) In [12]: import tkColorChooser In [13]: tkColorChooser. tkColorChooser.Chooser tkColorChooser.__name__ tkColorChooser.Dialog tkColorChooser.__new__ tkColorChooser.__builtins__ tkColorChooser.__package__ tkColorChooser.__class__ tkColorChooser.__reduce__ tkColorChooser.__delattr__ tkColorChooser.__reduce_ex__ tkColorChooser.__dict__ tkColorChooser.__repr__ tkColorChooser.__doc__ tkColorChooser.__setattr__ tkColorChooser.__file__ tkColorChooser.__sizeof__ tkColorChooser.__format__ tkColorChooser.__str__ tkColorChooser.__getattribute__ tkColorChooser.__subclasshook__ tkColorChooser.__hash__ tkColorChooser.askcolor tkColorChooser.__init__ In [13]: tkColorChooser.askcolor() Out[13]: ((255, 127, 0), '#ff7f00') In [14]: Do you really want to exit ([y]/n)? odd-2% ipython Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) Type "copyright", "credits" or "license" for more information. IPython 0.10.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from Tkinter import * In [2]: root=Tk() In [3]: w=Label(root,text="hello world") In [4]: w.pack() In [5]: def hi(): print "Hello" ...: In [6]: root.after(3000,hi ...: ) Out[6]: u'after#0' In [7]: Hello In [8]: root.after(3000,hi) Out[8]: u'after#1' In [9]: Hello In [10]: Do you really want to exit ([y]/n)? odd-2% vi x.py odd-2% ls 1f88.ent dynamics.ppt 2008_02_19_irina_collab.pdf eclipse Applications error.txt CV_NIH_2008_02_19.pdf groel-c7.mrc DVDTemp groel.12A.mrc Desktop groel.12A.pub.mrc Documents groel.published.12.mrc Downloads groel.xray.12A.mrc Dropbox installed DumpLog 11-06-12 17:56 lib DumpLog 11-06-19 22:42 mail DumpLog 11-06-19 22:46 me.jpg DumpLog 11-06-19 22:54 me.psd DumpLog 11-06-19 22:59 mmcpn.py DumpLog 11-06-19 23:01 mmcpn.side.gif DumpLog 11-06-19 23:07 mmcpn.top.gif EMAN p1.txt EMAN2 p2.txt EMAN2.odp pro EMAN2.old proc3d.filt EMAN2.ppt proc3d.raddist EMAN2DB r_07_04.hdf Image Data Converter SR r_09_04.hdf ImageMagick-6.4.0 r_16_02.hdf Library r_16_02.jpg Movies r_16_02f.hdf Music r_35_02.hdf Pictures refine Public refine.log QtSDK result.txt Reference2.pdf s2 Sites scripps.pdf StrucFact.sm session9.txt UCLA.pdf share VirtualBox VMs snapshot1.png aacmsched.pdf speed.hed aacmsched2.pdf speed.img abstract.doc std.ics bin test.html burn test.mov cam.html test.py cd test1.mp4 chimera_movie.mov test2.py chimera_movie.mp4 test2.pyc chimera_movie2.mp4 tmp classes.png tomotrackbox.py ctf.fg1d.ps tst.hdf ctfparm.txt tst.txt d video.mpg data wp dot.hdf x.py dot2.hdf odd-2% cd wp/lecture/2012_01_Intro_Programming/lec10 odd-2% ls calc1.html calc2.html tkinter1.py odd-2% vi x.py odd-2% python x.py Traceback (most recent call last): File "x.py", line 6, in w=label(root,text="Hello World") NameError: name 'label' is not defined odd-2% !vi vi x.py odd-2% python x.py odd-2% python x.py odd-2% !vi vi x.py odd-2% python x.py odd-2% vi x.py odd-2% python x.py You pushed me too far ! You pushed me too far ! You pushed me too far ! You pushed me too far ! You pushed me too far ! odd-2% python x.py You pushed me too far ! You pushed me too far ! You pushed me too far ! You pushed me too far ! odd-2% python x.py ^C^C^C^C^C^C^C^C^C^C^Z zsh: suspended python x.py odd-2% kill %1 odd-2% [1] + terminated python x.py odd-2% ipython Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) Type "copyright", "credits" or "license" for more information. IPython 0.10.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from Tkinter import * In [2]: root=Tk() In [3]: a=Label(root,text="hi there") In [4]: a.pack() In [5]: w=Frame() In [6]: b=Label(w,text="hi there") In [7]: b.pack() In [8]: b=Label(w,text="This is a really long string") In [9]: b.pack() In [10]: w. Display all 189 possibilities? (y or n) w._Misc__winfo_getint w.getdouble w.tk_menuBar w._Misc__winfo_parseitem w.getint w.tk_setPalette w.__class__ w.getvar w.tk_strictMotif w.__contains__ w.grab_current w.tkraise w.__doc__ w.grab_release w.unbind w.__getitem__ w.grab_set w.unbind_all w.__init__ w.grab_set_global w.unbind_class w.__module__ w.grab_status w.update w.__setitem__ w.grid w.update_idletasks w.__str__ w.grid_bbox w.wait_variable w._bind w.grid_columnconfigure w.wait_visibility w._configure w.grid_configure w.wait_window w._displayof w.grid_forget w.waitvar w._do w.grid_info w.widgetName w._getboolean w.grid_location w.winfo_atom w._getdoubles w.grid_propagate w.winfo_atomname w._getints w.grid_remove w.winfo_cells w._grid_configure w.grid_rowconfigure w.winfo_children w._name w.grid_size w.winfo_class w._nametowidget w.grid_slaves w.winfo_colormapfull w._noarg_ w.image_names w.winfo_containing w._options w.image_types w.winfo_depth w._register w.info w.winfo_exists w._report_exception w.keys w.winfo_fpixels w._root w.lift w.winfo_geometry w._setup w.location w.winfo_height w._subst_format w.lower w.winfo_id w._subst_format_str w.mainloop w.winfo_interps w._substitute w.master w.winfo_ismapped w._tclCommands w.nametowidget w.winfo_manager w._w w.option_add w.winfo_name w.after w.option_clear w.winfo_parent w.after_cancel w.option_get w.winfo_pathname w.after_idle w.option_readfile w.winfo_pixels w.bbox w.pack w.winfo_pointerx w.bell w.pack_configure w.winfo_pointerxy w.bind w.pack_forget w.winfo_pointery w.bind_all w.pack_info w.winfo_reqheight w.bind_class w.pack_propagate w.winfo_reqwidth w.bindtags w.pack_slaves w.winfo_rgb w.cget w.place w.winfo_rootx w.children w.place_configure w.winfo_rooty w.clipboard_append w.place_forget w.winfo_screen w.clipboard_clear w.place_info w.winfo_screencells w.clipboard_get w.place_slaves w.winfo_screendepth w.colormodel w.propagate w.winfo_screenheight w.columnconfigure w.quit w.winfo_screenmmheight w.config w.register w.winfo_screenmmwidth w.configure w.rowconfigure w.winfo_screenvisual w.deletecommand w.selection_clear w.winfo_screenwidth w.destroy w.selection_get w.winfo_server w.event_add w.selection_handle w.winfo_toplevel w.event_delete w.selection_own w.winfo_viewable w.event_generate w.selection_own_get w.winfo_visual w.event_info w.send w.winfo_visualid w.focus w.setvar w.winfo_visualsavailable w.focus_displayof w.size w.winfo_vrootheight w.focus_force w.slaves w.winfo_vrootwidth w.focus_get w.tk w.winfo_vrootx w.focus_lastfor w.tk_bisque w.winfo_vrooty w.focus_set w.tk_focusFollowsMouse w.winfo_width w.forget w.tk_focusNext w.winfo_x w.getboolean w.tk_focusPrev w.winfo_y In [10]: help(Frame) In [11]: w.pack() In [12]: w.raise() ------------------------------------------------------------ File "", line 1 w.raise() ^ SyntaxError: invalid syntax In [13]: w. Display all 189 possibilities? (y or n) w._Misc__winfo_getint w.getdouble w.tk_menuBar w._Misc__winfo_parseitem w.getint w.tk_setPalette w.__class__ w.getvar w.tk_strictMotif w.__contains__ w.grab_current w.tkraise w.__doc__ w.grab_release w.unbind w.__getitem__ w.grab_set w.unbind_all w.__init__ w.grab_set_global w.unbind_class w.__module__ w.grab_status w.update w.__setitem__ w.grid w.update_idletasks w.__str__ w.grid_bbox w.wait_variable w._bind w.grid_columnconfigure w.wait_visibility w._configure w.grid_configure w.wait_window w._displayof w.grid_forget w.waitvar w._do w.grid_info w.widgetName w._getboolean w.grid_location w.winfo_atom w._getdoubles w.grid_propagate w.winfo_atomname w._getints w.grid_remove w.winfo_cells w._grid_configure w.grid_rowconfigure w.winfo_children w._name w.grid_size w.winfo_class w._nametowidget w.grid_slaves w.winfo_colormapfull w._noarg_ w.image_names w.winfo_containing w._options w.image_types w.winfo_depth w._register w.info w.winfo_exists w._report_exception w.keys w.winfo_fpixels w._root w.lift w.winfo_geometry w._setup w.location w.winfo_height w._subst_format w.lower w.winfo_id w._subst_format_str w.mainloop w.winfo_interps w._substitute w.master w.winfo_ismapped w._tclCommands w.nametowidget w.winfo_manager w._w w.option_add w.winfo_name w.after w.option_clear w.winfo_parent w.after_cancel w.option_get w.winfo_pathname w.after_idle w.option_readfile w.winfo_pixels w.bbox w.pack w.winfo_pointerx w.bell w.pack_configure w.winfo_pointerxy w.bind w.pack_forget w.winfo_pointery w.bind_all w.pack_info w.winfo_reqheight w.bind_class w.pack_propagate w.winfo_reqwidth w.bindtags w.pack_slaves w.winfo_rgb w.cget w.place w.winfo_rootx w.children w.place_configure w.winfo_rooty w.clipboard_append w.place_forget w.winfo_screen w.clipboard_clear w.place_info w.winfo_screencells w.clipboard_get w.place_slaves w.winfo_screendepth w.colormodel w.propagate w.winfo_screenheight w.columnconfigure w.quit w.winfo_screenmmheight w.config w.register w.winfo_screenmmwidth w.configure w.rowconfigure w.winfo_screenvisual w.deletecommand w.selection_clear w.winfo_screenwidth w.destroy w.selection_get w.winfo_server w.event_add w.selection_handle w.winfo_toplevel w.event_delete w.selection_own w.winfo_viewable w.event_generate w.selection_own_get w.winfo_visual w.event_info w.send w.winfo_visualid w.focus w.setvar w.winfo_visualsavailable w.focus_displayof w.size w.winfo_vrootheight w.focus_force w.slaves w.winfo_vrootwidth w.focus_get w.tk w.winfo_vrootx w.focus_lastfor w.tk_bisque w.winfo_vrooty w.focus_set w.tk_focusFollowsMouse w.winfo_width w.forget w.tk_focusNext w.winfo_x w.getboolean w.tk_focusPrev w.winfo_y In [13]: w2=Frame(None) In [14]: c=Label(w,text="This is a really long string") In [15]: c=Label(w2,text="This is a really long string") In [16]: c.pack() In [17]: w2.pack() In [18]: help(Frame) In [19]: help(Toplevel) In [20]: w3=Toplevel() In [21]: d=Label(w3,text="testing") In [22]: d.pack() In [23]: Do you really want to exit ([y]/n)? odd-2% ls calc1.html calc2.html tkinter1.py x.py odd-2% more tkinter1.py from Tkinter import * class Demo(Frame): def say_hi(self): print "hi there, everyone!" def createWidgets(self): self.QUIT = Button(self) self.QUIT["text"] = "QUIT" self.QUIT["fg"] = "red" self.QUIT["command"] = self.quit self.QUIT.pack({"side": "left"}) self.hi_there = Button(self) self.hi_there["text"] = "Hello", self.hi_there["command"] = self.say_hi self.hi_there.pack({"side": "left"}) def __init__(self, master=None): Frame.__init__(self, master) self.createWidgets() self.pack() root = Tk() app = Demo(master=root) app.mainloop() root.destroy() odd-2% python tkinter1.py hi there, everyone! hi there, everyone! hi there, everyone! hi there, everyone! odd-2% ipython Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) Type "copyright", "credits" or "license" for more information. IPython 0.10.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from Tkinter import * In [2]: root=Tk() In [3]: w=Label(text="This is some text") In [4]: w.pack() In [5]: w["text"]="Hi there" In [6]: Do you really want to exit ([y]/n)? odd-2% ls calc1.html calc2.html tkinter1.py x.py odd-2% vi x.html odd-2% vi y.html odd-2%