[Tutor] put?

2008-05-01 Thread Ross Glover
Hi, I'm just learning python (as a first language) and I wrote this little snippet (cribbed from a website). I'm wondering what 'put' is and how it's used. I cannot seem to find much about it. word = raw_input("enter your word >>") put, get=os.popen4("dict -d wn " + (word)) for lines in get.

Re: [Tutor] put?

2008-05-01 Thread Kent Johnson
On Thu, May 1, 2008 at 3:51 AM, Ross Glover <[EMAIL PROTECTED]> wrote: > Hi, I'm just learning python (as a first language) and I wrote this little > snippet (cribbed from a website). I'm wondering what 'put' is and how it's > used. I cannot seem to find much about it. > > > > word = raw_input("e

[Tutor] unsubscribtion

2008-05-01 Thread Kriti Satija
Please unsubscribe my membership from python tutorlist. Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinf

Re: [Tutor] send and receive HTTP POST

2008-05-01 Thread shawn bright
Thanks, sorry i was late getting back to you, but gmail thought this was spam. Go figure. Anyway, SOAPpy is doing great. Thanks shawn On Wed, Apr 30, 2008 at 2:05 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > POST /soap/SMS.asmx HTTP/1.1 > > Host: api.upsidewireless.com > > Content-Type: t

Re: [Tutor] unsubscribtion

2008-05-01 Thread Evans Anyokwu
Kriti, You can unsubscribe yourself without waiting for anyone to do it for you. Follow this link http://mail.python.org/mailman/listinfo/tutor Bye. Evans http://www.javawug.org On Thu, May 1, 2008 at 2:00 PM, Kriti Satija <[EMAIL PROTECTED]> wrote: > Please unsubscribe my membership from pyt

Re: [Tutor] unsubscribtion

2008-05-01 Thread bob gailer
Kriti Satija wrote: Please unsubscribe my membership from python tutorlist. Only you can do that. Visit http://mail.python.org/mailman/listinfo/tutor -- Bob Gailer 919-636-4239 Chapel Hill, NC ___ Tutor maillist - Tutor@python.org http://mail.

Re: [Tutor] put?

2008-05-01 Thread Alan Gauld
"Ross Glover" <[EMAIL PROTECTED]> wrote Hi, I'm just learning python (as a first language) and I wrote this little snippet (cribbed from a website). I'm wondering what 'put' is and how it's used. Hmmm. It sounds like you may be jumping in too deep too soon. Do you understand about files yet

Re: [Tutor] put?

2008-05-01 Thread Marc Tompkins
On Thu, May 1, 2008 at 12:51 AM, Ross Glover <[EMAIL PROTECTED]> wrote: > put, get=os.popen4("dict -d wn " + (word)) > > Something that can be a little confusing at first (and I haven't seen anybody mention it yet, so I thought I'd chime in) is that you can assign multiple variables at the same ti

[Tutor] How to skip to next line in for loop

2008-05-01 Thread Brain Stormer
I have the following code: f = open('file.txt',r) for line in f.read(): if line == "3": line.next print line f.close() The file.txt looks like 1 2 3 4 5 I would like the code to output "4" but I don't know how to use the next. Are there any other way? Thanks ___

Re: [Tutor] How to skip to next line in for loop

2008-05-01 Thread Kent Johnson
On Thu, May 1, 2008 at 5:04 PM, Brain Stormer <[EMAIL PROTECTED]> wrote: > I have the following code: > > f = open('file.txt',r) > for line in f.read(): > if line == "3": >line.next Try f.next() line is a string, it doesn't have a next() method. The file itself is iterable and

Re: [Tutor] unsubscribtion

2008-05-01 Thread ionut cucu
Here's how to unsubscribe: First, ask your Internet Provider to mail you an Unsubscribing Kit. Then follow these directions. The kit will most likely be the standard no-fault type. Depending on requirements, System A and/or System B can be used. When operating System A, depress lever and a plas

[Tutor] Problems sending POST data

2008-05-01 Thread Alex Krycek
Hello all, I've been trying to send POST data to this library database with Python's urllib, but I can't get it to work. The website is http://catalog.denverlibrary.org/cgi-bin/cw_cgi?getLimitedTerms+2307(although the session expires after a short period of time. So it's better to first go to den

Re: [Tutor] put?

2008-05-01 Thread bob gailer
Marc Tompkins wrote: On Thu, May 1, 2008 at 12:51 AM, Ross Glover <[EMAIL PROTECTED] > wrote: put, get=os.popen4("dict -d wn " + (word)) Something that can be a little confusing at first (and I haven't seen anybody mention it yet, so I thought I'd chime in) i

Re: [Tutor] How to skip to next line in for loop

2008-05-01 Thread bob gailer
Brain Stormer wrote: I have the following code: f = open('file.txt',r) for line in f.read(): That will read the entire file into a string, then access one character at a time from the string. If you want to work with lines: for line in f: if line == "3": Assuming you adopt my approac

Re: [Tutor] unsubscribtion

2008-05-01 Thread bob gailer
That sounds like irony. Somehow not suitable for this list or for someone seeking help as to how to unsubscribe. -- Bob Gailer 919-636-4239 Chapel Hill, NC ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to skip to next line in for loop

2008-05-01 Thread Alan Gauld
"Brain Stormer" <[EMAIL PROTECTED]> wrote f = open('file.txt',r) for line in f.read(): This reads the whole file inta a string then iterates over all the characters(not lines) in that string. Better to iterate over the file: for line in f: if line == "3": line.next thi

Re: [Tutor] How to skip to next line in for loop

2008-05-01 Thread Alan Gauld
"bob gailer" <[EMAIL PROTECTED]> wrote if line == "3": Assuming you adopt my approach, then each line will be a digit followed by \n (newline). So no line will == "3". Instead use: if line[:-1] == "3": or if line.rstrip() == "3" or even if line.startswith("3"): personall

Re: [Tutor] Problems sending POST data

2008-05-01 Thread Kent Johnson
On Thu, May 1, 2008 at 6:02 PM, Alex Krycek <[EMAIL PROTECTED]> wrote: > Hello all, > > I've been trying to send POST data to this library database with Python's > urllib, but I can't get it to work. It looks like the library server wants to set a cookie in your browser and also responds with at r

Re: [Tutor] put? and files

2008-05-01 Thread Ross Glover
Thanks all for your in[put]. It did take me a minute to figure out that 2 variables could get assigned using this method. Thanks to your help, I managed to cobble together a fully functional GUI based dictionary program (MY FIRST!). That said, it would seem that I do need to understand files

Re: [Tutor] put?

2008-05-01 Thread Marc Tompkins
On Thu, May 1, 2008 at 4:02 PM, bob gailer <[EMAIL PROTECTED]> wrote: > Marc Tompkins wrote: > > > > In contrast, this line runs a command that returns two values > > > > No No. Python does not have "commands" and can't therefore "run" them. > > A better way to express that is: on the right of the