Re: [Tutor] gzip (fwd)

2004-12-02 Thread Danny Yoo
Hi Ramkumar, I'm forwarding your message to Python-tutor; in your replies, please make sure that you are using the "reply-to-all" feature in your email client. This will allow your response to reach the others on the tutor list. Don't rely on me alone: give the community the chance to help you. I

Re: [Tutor] backup failed - gzip

2004-12-02 Thread Liam Clarke
As the below quote from the manual shows - On Windows, the return value is that returned by the system shell after running command, given by the Windows environment variable COMSPEC: on command.com systems (Windows 95, 98 and ME) this is always 0; on cmd.exe systems (Windows NT, 2000 and XP) this

[Tutor] backup failed - gzip

2004-12-02 Thread Ramkumar Parimal Alagan
This is what i intend to do: 1. The files and directories to be backed up are given in a list. 2. The backup must be stored in a main backup directory. 3. The files are backed up into a zip file. 4. The name of the zip archive is the current date and time. the coding: __ import os i

[Tutor] Help

2004-12-02 Thread Daniel
I need to know how to run another module through one what is the command do I have to include a path name and if there is any special way I have to save the file ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinf

Re: [Tutor] programming newbie question

2004-12-02 Thread Liam Clarke
IMAP / POP3 /SMTP connections/sessions as objects are very useful, as you can pass them from function to function. On Thu, 2 Dec 2004 21:50:20 -0500, Jacob S. <[EMAIL PROTECTED]> wrote: > > I am fairly new to programming and I have started to learn programming > > then stopped out of frustratio

Re: [Tutor] unittest.makeSuite question

2004-12-02 Thread Kent Johnson
makeSuite() creates a TestSuite object that consolidates all the test methods of the class named by the first argument. Test methods are identified by having names starting with the second argument. 'test' is the default value so you could omit it; in fact the most recent documentation does omit

Re: [Tutor] comapring lists

2004-12-02 Thread Jacob S.
If you or anybody else is interested, I've written a script for codes like kids in junior high use to write notes to each other with... It will cipher and decipher mixed letters (encryption), turn words inside out (try it and see), date code (mixed letters that changes with the date), morse code, p

Re: [Tutor] new function and a 3 line program not working

2004-12-02 Thread Jacob S.
I thought that the '.py ' in this import statement would make the interpreter think that newline was a package and therefore try to recognize py as a module in the newline package. from newline.py import newline Perhaps you said this to help explain what's going on? Jacob Schmidt > > If so that

Re: [Tutor] programming newbie question

2004-12-02 Thread Jacob S.
> I am fairly new to programming and I have started to learn programming > then stopped out of frustration several times in the past. I guess my > frustration stems from not being able to understand when to use certain > aspects of programming such as functions or classes. Use functions when you

Re: [Tutor] Pythonw.exe doesn't work in the python2.4 distribution?

2004-12-02 Thread Jacob S.
> > execute the scripts using python24. However, the "Edit with IDLE" > command in > > the shorcut menu (right-click pull down menu) no longer worked. So I > went to > > the registry (I know the risks involved) > > BUt entirely unnecesary here! > The way to check/fix the context(right-click) menu o

Re: [Tutor] Problem with data storage

2004-12-02 Thread Jacob S.
Hello, The way I do it is as follows. def open(): a = open('myfile.txt','r') di = a.read() a.close() di = eval(di) return di def save(di): a = open('myfile.txt','w') a.write(str(di)) a.close() def dosomethingwithdi(di): '''You can put whatever you want in her

Re: [Tutor] Strange Appending

2004-12-02 Thread Liam Clarke
What's t supposed to be, what are you initialising self.a as, where is t generated, what is your expected output? What else is happening to self.a? Looks like an indentation error to me. This kind of output [[1, 237, 543], [1, 237, 543], [1, 237, 543], [1, 237, 543]] would only come from a lo

Re: [Tutor] Python 2.4 IDLE Windows 2000

2004-12-02 Thread Liam Clarke
>Yowza; that's some bug. Danny, do you happen to know the bug number? I >can't find it on sourceforge. It's been like that since 2.3 as far as I know. It generates a connection to localhost to run code in a separate environment. On Thu, 02 Dec 2004 07:20:19 -0700, Mike Hansen <[EMAIL PROTECTE

[Tutor] unittest.makeSuite question

2004-12-02 Thread Guillermo Fernandez Castellanos
Hi, I've been through the unittest tutorial page and I've seen this function: suite = unittest.makeSuite(Testname,'test') In the python 2.4 Python Library Reference I have find no reference to such a fucntion (there is an example, exactly the same but without the 'test' parameter). I could not r

Re: [Tutor] os.popen doesn't give up

2004-12-02 Thread Ben Vinger
--- Ben Vinger <[EMAIL PROTECTED]> wrote: > --- Bob Gailer <[EMAIL PROTECTED]> wrote: > > Solutions: > > 2 - l = os.popen(r'snmpget -Os -c ' + > SNMPcommunity > > + ' -v2c -r 3 ' + IP + > > ' ' + counter, 'r').read() Puts snmpget's output > in > > l. Sorry, now I have doubts again. Originall

Re: [Tutor] Strange Appending

2004-12-02 Thread Marilyn Davis
On Thu, 2 Dec 2004, mdcooper wrote: > Hello, > > I am trying to append a list to another list, but everytime I do, the new > parent list has a new child list, but all the other lists have become the > same > as the new child list. > > Code: > > > self._f.write(str(self.residue.atoms[int(t[0

[Tutor] Strange Appending

2004-12-02 Thread mdcooper
Hello, I am trying to append a list to another list, but everytime I do, the new parent list has a new child list, but all the other lists have become the same as the new child list. Code: self._f.write(str(self.residue.atoms[int(t[0])-1].element) + ' ') for m in t:

Re: [Tutor] Equivalent of PHP's __FUNCTION__ ?

2004-12-02 Thread Kent Johnson
Kent Johnson wrote: Here is one way to do it, based on this Python Cookbook recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062 Use of sys._getframe() is generally considered something of a skanky hack. (Though it is often done anyway.) Here is another solution that only uses sup

Re: [Tutor] Equivalent of PHP's __FUNCTION__ ?

2004-12-02 Thread Mohamed Lrhazi
--On Thursday, December 02, 2004 1:42 PM -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: Here is one way to do it, Thanks so much. that's perfect. ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Equivalent of PHP's __FUNCTION__ ?

2004-12-02 Thread Kent Johnson
Here is one way to do it, based on this Python Cookbook recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062 def debug(msg): import sys frame = sys._getframe(1) name = frame.f_code.co_name line_number = frame.f_lineno filename = frame.f_code.co_filename retu