Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread Wayne
On Thu, Jul 30, 2009 at 11:29 PM, prasad rao wrote: > hello > I removed the bugs.But still getting error report. > > > >>import mcript > > Traceback (most recent call last): > File "", line 1, in > import mcript > File "C:\Python26\mcript.py", line 78, in > a.main() > File "C:\Pyt

[Tutor] flag to call methods on objects?

2009-07-30 Thread prasad rao
hello I removed the bugs.But still getting error report. >>import mcript Traceback (most recent call last): File "", line 1, in import mcript File "C:\Python26\mcript.py", line 78, in a.main() File "C:\Python26\mcript.py", line 58, in main nl=__compress(__digi(__lengthen(lin

Re: [Tutor] Assigning each line of text to a separate variable

2009-07-30 Thread Dave Angel
Marv Boyes wrote: I'm very sorry; I should have been more explicit in what it is I'm working with. The response from the server consists of a pair of hashes and a list of URLs for doing different things with the file the hashes represent. So the full response is like this: file_hash

Re: [Tutor] Problems understanding control flow

2009-07-30 Thread Eduardo Vieira
On Thu, Jul 30, 2009 at 5:56 PM, Eduardo Vieira wrote: > On Thu, Jul 30, 2009 at 4:49 PM, Sander Sweers wrote: >> 2009/7/30 Eduardo Vieira : >> >> With == you are testing if the 2 values are exactly the same. So 'one' >> == 'one' will return True but 'one; == 'one two' will return False. >> >> With

Re: [Tutor] Problems understanding control flow

2009-07-30 Thread Eduardo Vieira
On Thu, Jul 30, 2009 at 4:49 PM, Sander Sweers wrote: > 2009/7/30 Eduardo Vieira : > > With == you are testing if the 2 values are exactly the same. So 'one' > == 'one' will return True but 'one; == 'one two' will return False. > > With in you test if the value is part of a another value. So using

Re: [Tutor] Problems understanding control flow

2009-07-30 Thread Sander Sweers
2009/7/30 Eduardo Vieira : With == you are testing if the 2 values are exactly the same. So 'one' == 'one' will return True but 'one; == 'one two' will return False. With in you test if the value is part of a another value. So using the same value as above 'one' in 'one' will return True but 'one

Re: [Tutor] Companion CD for Python Book

2009-07-30 Thread Tommie
>Randy S wrote: >Hi, >I recently purchased a used book with the title >Python Programming for the Absolute Beginner, >Second Edition, by Michael Dawson. The book is >supposed include a companion CD, but the CD is >broken. I've already contacted the publisher for a >replacement, but they were no

[Tutor] Problems understanding control flow

2009-07-30 Thread Eduardo Vieira
Hello, list. I can't understand why the print statement is not printed with the operator '==', but is printed when using 'in'. Here's the code: #=== import csv bv = """NAME,BVADDRTELNO1,BVADDREMAIL Company1, 1234567788, t...@that.com CompanyA, 1231234455, t...@this.com CompanyC, 101101, n...@t

[Tutor] Troubles with the mailing list.

2009-07-30 Thread Mac Ryan
Hi all, having seen a few people in the past days sending "trial messages" on the list I figured it out that I must not be the only one to experience problems with it. I even set up the "notification" feature that sends you an acknowledgement message when your mail is received fro

Re: [Tutor] Assigning each line of text to a separate variable

2009-07-30 Thread Dave Angel
Marv Boyes wrote: Hello, all. This is probably embarrassingly basic, but I haven't been able to find something that works. I'm working on a script that needs to manipulate a list (not 'list' in the Python sense) of URLs returned in a server response. Right now, I'm stripping the XML tags fro

Re: [Tutor] Assigning each line of text to a separate variable

2009-07-30 Thread Jeremy Hoon
On Thu, Jul 30, 2009 at 4:26 PM, Marv Boyes wrote: > I'm very sorry; I should have been more explicit in what it is I'm working > with. > > The response from the server consists of a pair of hashes and a list of URLs > for doing different things with the file the hashes represent. So the full > res

Re: [Tutor] Currency conversion module in python

2009-07-30 Thread wesley chun
On Thu, Jul 30, 2009 at 11:18 AM, Che M wrote: > Did you actually look at what happens when you click that > link?  (i.e. where you are brought to?). > > Because upon viewing this I achieved enlightenment!  :D lucky you... i achieved recursion. :-) ___

Re: [Tutor] Assigning each line of text to a separate variable

2009-07-30 Thread Marv Boyes
I'm very sorry; I should have been more explicit in what it is I'm working with. The response from the server consists of a pair of hashes and a list of URLs for doing different things with the file the hashes represent. So the full response is like this: file_hash delete_has

Re: [Tutor] Assigning each line of text to a separate variable

2009-07-30 Thread Kent Johnson
On Thu, Jul 30, 2009 at 3:19 PM, Marv Boyes wrote: > Hello, all. This is probably embarrassingly basic, but I haven't been able > to find something that works. > > I'm working on a script that needs to manipulate a list (not 'list' in the > Python sense) of URLs returned in a server response. Right

Re: [Tutor] Assigning each line of text to a separate variable

2009-07-30 Thread vince spicer
On Thu, Jul 30, 2009 at 1:19 PM, Marv Boyes wrote: > Hello, all. This is probably embarrassingly basic, but I haven't been able > to find something that works. > > I'm working on a script that needs to manipulate a list (not 'list' in the > Python sense) of URLs returned in a server response. Rig

[Tutor] Assigning each line of text to a separate variable

2009-07-30 Thread Marv Boyes
Hello, all. This is probably embarrassingly basic, but I haven't been able to find something that works. I'm working on a script that needs to manipulate a list (not 'list' in the Python sense) of URLs returned in a server response. Right now, I'm stripping the XML tags from that response and

Re: [Tutor] Currency conversion module in python

2009-07-30 Thread Che M
Did you actually look at what happens when you click that link? (i.e. where you are brought to?). Because upon viewing this I achieved enlightenment! :D Date: Thu, 30 Jul 2009 10:02:39 +0200 From: zebr...@gmail.com To: amit.pureene...@gmail.com CC: tutor@python.org Subject: Re: [Tutor] Curr

Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread Steve Willoughby
On Thu, Jul 30, 2009 at 09:11:42AM -0500, Wayne wrote: > If you're only partially concerned (i.e. don't care about 'real' encryption) > you can use some of the string library encryptions. Please don't get used to calling these "encryption". They have nothing at all to do with encrypting data. (W

Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread Dave Angel
prasad rao wrote: On 7/30/09, Dave Angel wrote: prasad rao wrote: hello "it is not working." is not very descriptive. DaveA Hello! Sorry, I forgot to mention the problem. It simply wipes clean the file,resulting in empty file. Yes .I should comp

Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread prasad rao
On 7/30/09, Dave Angel wrote: > > prasad rao wrote: > >> hello >> >> >"it is not working." is not very descriptive. >> >> >> DaveA >> >Hello! Sorry, I forgot to mention the problem. It simply wipes clean the file,resulting in empty file. Yes .I should compare with a string.Hope I will get i

Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread Dave Angel
prasad rao wrote: hello I wanted to prevent other users of my computers to read my files. So tried to creat a module to achieve it. I used a flag to deside which methods to be called on the object. somehow it is not working.I realise after 2 days of struggle that as it is usuel , I am blind

[Tutor] Companion CD for Python Book

2009-07-30 Thread Randy Seys
Hi, I recently purchased a used book with the title Python Programming for the Absolute Beginner, Second Edition, by Michael Dawson. The book is supposed include a companion CD, but the CD is broken. I've already contacted the publisher for a replacement, but they were not able to help me. I

Re: [Tutor] Issues with regex escaping on \{

2009-07-30 Thread gpo
Thanks! The ? got rid of the greediness! vince spicer wrote: > > On Wed, Jul 29, 2009 at 11:35 AM, gpo wrote: > > > your grouping (.+) appears to be greedy, you can make it non-greedy with a > question mark > > EX: > > pUserID=re.compile('UserID:\s+{(.+?)}',re.I) > > Vince > >

Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread Wayne
On Thu, Jul 30, 2009 at 8:49 AM, prasad rao wrote: > > > On 7/30/09, Rich Lovely wrote: >> >> 2009/7/30 prasad rao prasadarao...@gmail.com: > > > > > >I'm sure there are modules available for PGP that are either part of >> >the stdlib, or available from a quick google. PGP (or GPG) encryopts >>

Re: [Tutor] flag to call methods on objects?

2009-07-30 Thread prasad rao
On 7/30/09, Rich Lovely wrote: > > 2009/7/30 prasad rao prasadarao...@gmail.com: >I'm sure there are modules available for PGP that are either part of > >the stdlib, or available from a quick google. PGP (or GPG) encryopts > I never know there is an encryption module in stdlib. What is

[Tutor] flag to call methods on objects?

2009-07-30 Thread prasad rao
hello I wanted to prevent other users of my computers to read my files. So tried to creat a module to achieve it. I used a flag to deside which methods to be called on the object. somehow it is not working.I realise after 2 days of struggle that as it is usuel , I am blind to my faults. I test

Re: [Tutor] Currency conversion module in python

2009-07-30 Thread OkaMthembo
Hi Amit, this might be what you want..hopefully with a dollop of humor :) http://lmgtfy.com/?q=currency+conversion+module+in+python&l=1 Cheers On Thu, Jul 30, 2009 at 12:45 AM, Amit Sethi wrote: > Hi , Does anybody know of any currency conversion module in python > > -- > A-M-I-T S|S >

Re: [Tutor] how to join two different files

2009-07-30 Thread wesley chun
>> Maybe you could break that up a bit? This is the tutor list, not a >> one-liner competition! > > rather than one-liners, we can try to create the most "Pythonic" solution. > below's my entry. :-) > > myMac$ cat parafiles.py > #!/usr/bin/env python > > from itertools import izip > from os.path i