Re-running script from Tk shell

2007-04-30 Thread gtb
I am testing a simple script by running it in the Tk shell. It imports a class from another module. I edit and save the file from which I import. When I want to re-run I delete the Tk window and run the module from the Edit window (F5 - Run Module). The script that does the importing does not see

Re: if __name__ == 'main': & passing an arg to a class object

2007-04-27 Thread gtb
rg/ref/ref.html both open all the time. :^) Best Regards, gtb -- http://mail.python.org/mailman/listinfo/python-list

if __name__ == 'main': & passing an arg to a class object

2007-04-27 Thread gtb
ake an arg, which seems correct. Thanks, gtb # Generated by MaxQ [com.bitmechanic.maxq.generator.CompactGenerator] from CompactTest import CompactTest class MaxQTest(CompactTest): # Recorded test actions. def runTest(self): self.msg('Test started') # ^^^ Insert new r

Re: Atribute error

2007-04-26 Thread gtb
Thanks for posting. CompactTest is a class provided by MaxQ and inheritance generally works as the files below worked OK. I was trying to re-arrange things as newLogin() should be just one of many functions called by Test1. The way the inheritance is setup below seems like the tail wagging the dog

Re: Python keywords

2007-04-26 Thread gtb
On Apr 26, 1:59 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] > [mailto:python- > > [EMAIL PROTECTED] On Behalf Of gtb > > Sent: Thursday, April 26, 2007 1:50 PM > > To: [EMAIL PROTECT

Atribute error

2007-04-26 Thread gtb
In file Test1.py below I get a attribute error on the line "self.logon()". It worked earlier when Test1 was derived from class newLogon but that does not seem logical to me. Any suggestions? Thanks, john #~~~ #File Test1.py # Generat

Re: Python keywords

2007-04-26 Thread gtb
Thanks Marc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python keywords

2007-04-26 Thread gtb
On Apr 26, 10:16 am, Larry Bates <[EMAIL PROTECTED]> wrote: > gtb wrote: > > Have done some searching but have not found a place where I can look > > up python keywords. I was looking at a script that contained the > > following line: > > > assert self.getRespo

Python keywords

2007-04-26 Thread gtb
'"for". I looked thru 'the Python Reference Manual and found "in" is a keyword but in skimming thru I found it only with "for". The reference manual seems good but seems not to be setup for searching. Or maybe I just missed something. Thanks, gtb -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding and copying files with python.

2007-04-03 Thread gtb
On Apr 3, 9:42 am, "Daniele Varrazzo" <[EMAIL PROTECTED]> wrote: > > > > I wish to copy the highest version number of a file from directory \ > > > > \ > > > > \fileserver\D:\scripts to C:\scripts where the file names are of the > > > > form > > > > > filename_MM.NN.SS.zip, where MM, NN, and SS c

Re: Finding and copying files with python.

2007-04-03 Thread gtb
On Apr 3, 8:31 am, [EMAIL PROTECTED] wrote: > On Apr 3, 8:21 am, "gtb" <[EMAIL PROTECTED]> wrote: > > > > > > > > > I wish to copy the highest version number of a file from directory \ > > \ > > \fileserver\D:\scri

Finding and copying files with python.

2007-04-03 Thread gtb
I wish to copy the highest version number of a file from directory \ \ \fileserver\D:\scripts to C:\scripts where the file names are of the form filename_MM.NN.SS.zip, where MM, NN, and SS can be one to three digits. Example directory: other.zip dx_ver_1.1.63.zip dx_ver_1.2.01.zip dx_ver_1.12.7

Re: Printing __doc__

2007-03-21 Thread gtb
On Mar 21, 3:35 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > gtb wrote: > > In a function I can use the statement n = > > sys._getframe().f_code.co_name to get the name of the current > > function. Given that I can get the name how can I print the __doc__ > > str

Re: Printing __doc__

2007-03-21 Thread gtb
On Mar 21, 3:11 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "gtb" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | Greetings, > | > | Don't know the daily limit for dumb questions so I will ask one or > | more.

Re: Delete a function

2007-03-21 Thread gtb
On Mar 21, 12:45 pm, paul <[EMAIL PROTECTED]> wrote: > gtb schrieb:> On Mar 21, 11:37 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> gtb wrote: > >>> After a function has been imported to a shell how may it be deleted so > >>> that after editing

Printing __doc__

2007-03-21 Thread gtb
g, it will tell me to bugger off as the string has no such attribute. def spam(self): n = sys._getframe().f_code.co_name print n.__doc__ #Wrong print __doc__ #No good either # thanx, gtb -- http://mail.python.org/mailman/listinfo/python-list

Re: Technical Answer - Protecting code in python

2007-03-21 Thread gtb
On Mar 21, 8:36 am, "flit" <[EMAIL PROTECTED]> wrote: > Hello All, > > I have a hard question, every time I look for this answer its get out > from the technical domain and goes on in the moral/social domain. > First, I live in third world with bad gov., bad education, bad police > and a lot of tax

Re: Delete a function

2007-03-21 Thread gtb
On Mar 21, 11:37 am, Steve Holden <[EMAIL PROTECTED]> wrote: > gtb wrote: > > After a function has been imported to a shell how may it be deleted so > > that after editing it can reloaded anew? > > Use the built-in reload() function to reload the module that defines

Delete a function

2007-03-21 Thread gtb
After a function has been imported to a shell how may it be deleted so that after editing it can reloaded anew? thanx, gtb -- http://mail.python.org/mailman/listinfo/python-list

No module named ...

2007-03-20 Thread gtb
file. How do I create a .class file from my .py file so that functions can be imported. Thanx, gtb -- http://mail.python.org/mailman/listinfo/python-list

Re: Imports

2007-03-20 Thread gtb
On Mar 20, 2:25 pm, [EMAIL PROTECTED] wrote: > On Mar 20, 1:59 pm, "gtb" <[EMAIL PROTECTED]> wrote: > > > > > On Mar 20, 1:51 pm, [EMAIL PROTECTED] wrote: > > > > On Mar 20, 1:31 pm, "gtb" <[EMAIL PROTECTED]> wrote: > > >

Re: Imports

2007-03-20 Thread gtb
On Mar 20, 1:51 pm, [EMAIL PROTECTED] wrote: > On Mar 20, 1:31 pm, "gtb" <[EMAIL PROTECTED]> wrote: > > > > > I am working with a tool called maxQ that generates jython scripts. > > The tool runs in > > > C:\maxq\bin. > > > Rather t

Imports

2007-03-20 Thread gtb
out python? Thanx, gtb -- http://mail.python.org/mailman/listinfo/python-list

Re: if __name__ == 'main':

2007-03-20 Thread gtb
On Mar 20, 12:13 pm, "Patrick Down" <[EMAIL PROTECTED]> wrote: > On Mar 20, 11:49 am, "gtb" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I often see the following 'if' construct in python code. What does > > this idiom accomplish?

if __name__ == 'main':

2007-03-20 Thread gtb
Hi, I often see the following 'if' construct in python code. What does this idiom accomplish? What happens if this is not main? How did I get here if it is not main? Thanks, gtb == if __name__ == 'main': myQuest('