[Tutor] raw_input into range() function

2007-04-18 Thread Guba
Hello, I am trying to do the exercises in Michael Dawson's "Absolute Beginner" book. In chapter four ("for Loops, Strings, and Tuples") one of the challenges is: "Write a program that counts for the user. Let the user enter the starting number, the ending number, and the amount by which to count.

[Tutor] which function replaced fork() in Python2.5?

2007-04-18 Thread shiv k
which function replaced fork() in Python2.5?     ShivThe idiot box is no longer passé; it's making news and how! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] raw_input into range() function

2007-04-18 Thread Kent Johnson
Guba wrote: > The code I have come up with so far is further below; basically my > problem is that I don't know how to feed the range() function with the > user-input numbers it expects. > # Telling the player what to do & assigning that info to variables. > start_num = int(raw_input("Please give

Re: [Tutor] which function replaced fork() in Python2.5?

2007-04-18 Thread Kent Johnson
shiv k wrote: > > > which function replaced fork() in Python2.5? os.fork() hasn't moved, why do you think it was replaced? Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sys.argv?

2007-04-18 Thread Kent Johnson
Rikard Bosnjakovic wrote: > On 4/17/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > >> I really wish this list would start mungin' some headers already. > > I second that. > > Not using a reply-to-tag is braindead. Please don't start this thread again. Kent _

Re: [Tutor] sys.argv?

2007-04-18 Thread Rikard Bosnjakovic
On 4/18/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Please don't start this thread again. We didn't start it, rather it just never ends. -- - Rikard - http://bos.hack.org/cv/ ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/li

[Tutor] Mixing generator expressions with list definitions

2007-04-18 Thread Ed Singleton
I would like to be able to do something along the lines of: >>> my_list = [1, 2, x for x in range(3,6), 6] However this doesn't work. Is there any way of achieving this kind of thing? I tried: >>> my_list = [1, 2, *(x for x in range(3,6)), 6] which also doesn't work. I wrote a quick function

Re: [Tutor] Mixing generator expressions with list definitions

2007-04-18 Thread Kent Johnson
Ed Singleton wrote: > I would like to be able to do something along the lines of: > my_list = [1, 2, x for x in range(3,6), 6] > > However this doesn't work. Is there any way of achieving this kind of thing? my_list = [1, 2] + range(3,6) + [6] or, to build it in steps, my_list = [1, 2] my

Re: [Tutor] Mixing generator expressions with list definitions

2007-04-18 Thread Kent Johnson
Kent Johnson wrote: > my_list.extent(range(3, 6)) should be my_list.extend(range(3, 6)) Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Questions of Maths

2007-04-18 Thread Abu Ismail
Hi, I am working on an implementation of an L-system in Python. I hate using turtle module since it uses Tk and as my IDE also uses Tk I have to close my editor before I can test the program. So I am implementing the graphics using PIL. Now to the problem. Say you have a line AB with co-ords (x1

Re: [Tutor] Mixing generator expressions with list definitions

2007-04-18 Thread Ed Singleton
On 4/18/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Ed Singleton wrote: > > I would like to be able to do something along the lines of: > > > my_list = [1, 2, x for x in range(3,6), 6] > > > > However this doesn't work. Is there any way of achieving this kind of > > thing? > > my_list = [1

Re: [Tutor] Questions of Maths

2007-04-18 Thread Andre Roberge
On 4/18/07, Abu Ismail <[EMAIL PROTECTED]> wrote: > Hi, > > I am working on an implementation of an L-system in Python. I hate > using turtle module since it uses Tk and as my IDE also uses Tk I have > to close my editor before I can test the program. So I am implementing > the graphics using PIL.

Re: [Tutor] sys.argv?

2007-04-18 Thread Kirk Bailey
I never talk to mailboxes, nor to other inanimate objects; I was talking to you. Rikard Bosnjakovic wrote: > On 4/17/07, Kirk Bailey <[EMAIL PROTECTED]> wrote: > >> IF my memory serves well, argument 0 in that list is the name of the >> program itself, as well as the path to it if any was provid

Re: [Tutor] sys.argv?

2007-04-18 Thread Kirk Bailey
use a replyto header, or swap around things so the FROM is the list address, not the submitter, or kill me, or give me food, or something. Luke Paireepinart wrote: > Rikard Bosnjakovic wrote: >> On 4/17/07, Kirk Bailey <[EMAIL PROTECTED]> wrote: >> >> >>> IF my memory serves well, argument 0 i

Re: [Tutor] sys.argv?

2007-04-18 Thread Rikard Bosnjakovic
On 4/18/07, Kirk Bailey <[EMAIL PROTECTED]> wrote: > I never talk to mailboxes, nor to other inanimate objects; I was talking > to you. I'm not interested in listening to your ifs about your memory. -- - Rikard - http://bos.hack.org/cv/ ___ Tutor mail

Re: [Tutor] which function replaced fork() in Python2.5?

2007-04-18 Thread Kent Johnson
shiv k wrote: > > > > MR Kent its there in ubuntu but if we see the same in windows xp there > is no fork() instead there are spawn family. fork() is not supported under Windows. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/ma

Re: [Tutor] sys.argv?

2007-04-18 Thread Kirk Bailey
As long as the PROBLEM lives, the THREAD will rise from the dead over and over. Kill the problem, you kill the thread. Kent Johnson wrote: > Rikard Bosnjakovic wrote: >> On 4/17/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: >> >>> I really wish this list would start mungin' some headers alread

Re: [Tutor] sys.argv?

2007-04-18 Thread Kirk Bailey
My memory is fine, as is my grip on reality as well as courtesy to my fellow pythonistas. Good day to you sir. Rikard Bosnjakovic wrote: > On 4/18/07, Kirk Bailey <[EMAIL PROTECTED]> wrote: > >> I never talk to mailboxes, nor to other inanimate objects; I was talking >> to you. > > I'm not int

[Tutor] screen scraping web-based email

2007-04-18 Thread James Cunningham
Hello. I've been playing with Python for a while, and even have some small scripts in my employ, but I have a bit of a problem and I'm not sure how to proceed. I'm starting graduate school (econ!) in the Fall; the school I'll be attending uses Lotus for email and allows neither forwarding nor POP/

Re: [Tutor] screen scraping web-based email

2007-04-18 Thread Kent Johnson
James Cunningham wrote: > I'd like to write a daemon that logs into the text-based web client > every so often, scrapes for new email, and uses smtplib to send that > email to another email address. But I really don't know how I'd go > about logging in and staying logged in without a browser. > >

Re: [Tutor] screen scraping web-based email

2007-04-18 Thread James Cunningham
On Wed, 18 Apr 2007 12:15:26 -0400, Kent Johnson wrote: > James Cunningham wrote: > >> I'd like to write a daemon that logs into the text-based web client >> every so often, scrapes for new email, and uses smtplib to send that >> email to another email address. But I really don't know how I'd go >

Re: [Tutor] raw_input into range() function

2007-04-18 Thread Bob Gailer
Guba wrote: > Hello, > > I am trying to do the exercises in Michael Dawson's "Absolute Beginner" > book. In chapter four ("for Loops, Strings, and Tuples") one of the > challenges is: "Write a program that counts for the user. Let the user > enter the starting number, the ending number, and the amo

Re: [Tutor] raw_input into range() function

2007-04-18 Thread Ben Sherman
On 4/18/07, Guba <[EMAIL PROTECTED]> wrote: > Hello, > > I am trying to do the exercises in Michael Dawson's "Absolute Beginner" > book. In chapter four ("for Loops, Strings, and Tuples") one of the > challenges is: "Write a program that counts for the user. Let the user > enter the starting number

Re: [Tutor] which function replaced fork() in Python2.5?

2007-04-18 Thread Alan Gauld
"shiv k" <[EMAIL PROTECTED]> wrote > which function replaced fork() in Python2.5? Try the subprocess module. I think it can do a similar job even on Windows... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/

Re: [Tutor] Questions of Maths

2007-04-18 Thread Alan Gauld
"Abu Ismail" <[EMAIL PROTECTED]> wrote > I am working on an implementation of an L-system in Python. I hate > using turtle module since it uses Tk and as my IDE also uses Tk I > have > to close my editor before I can test the program. Why so? Don''t you have a multi-tasking OS? If so just run a

Re: [Tutor] screen scraping web-based email

2007-04-18 Thread Alan Gauld
"James Cunningham" <[EMAIL PROTECTED]> wrote > I'd like to write a daemon that logs into the text-based web client > every so often, scrapes for new email, and uses smtplib to send that > email to another email address. Kent has pointed you at useful add-on modules. Using the standard library co

Re: [Tutor] Multiple lines with the command line

2007-04-18 Thread Alan Gauld
"Kharbush, Alex [ITCSV]" <[EMAIL PROTECTED]> wrote > I need multiple entries with the os.system(cmd)line > MY PROBLEM is that i need to enter multiple lines of > input into unix. os.system() takes only one argument How about uysing popen instead? Or the new Popen class in the subprocess module

Re: [Tutor] Questions of Maths

2007-04-18 Thread János Juhász
Hi Abu, > Question: how to determine whether point C is to the left or to the > right of the line AB? When the line given by A(Xa,Ya) and B(Xb, Yb), the area of the A-B-C triangle can be calculated with the value of next determinant / 2 | Xa, Ya, 1 | | Xb, Yb, 1 | | Xc, Yc, 1 | / 2 So: Area =

Re: [Tutor] screen scraping web-based email

2007-04-18 Thread R. Alan Monroe
> I'm starting graduate school (econ!) in the Fall; the school I'll be > attending uses Lotus for email You can drive the fat client via COM if you install the Win32 extensions for python. > (I know I could do it with a torturous combination of applescript and Except judging by this, you're on

[Tutor] How to program to python the right way?

2007-04-18 Thread Adam Pridgen
Hello everyone, I have pretty much finished hacking on my Thesis and I have come to the conclusion, I really do not know how to use Python to it "full" extent. Some of the things I have really messed up in my implementation are serialization (specifically sub-classes), classes, and instantiating

Re: [Tutor] Seeking python projects

2007-04-18 Thread Adam Gomaa
Writing your own programs is a good idea. However, this is primarily a good idea with small programs. For example, when learning Python, I wrote a set of backup scripts for my computer; I still use them and they've served me well. If you want to write 'complete applications,' you're probably bette

Re: [Tutor] which function replaced fork() in Python2.5?

2007-04-18 Thread Andreas Kostyrka
* Alan Gauld <[EMAIL PROTECTED]> [070418 21:28]: > > "shiv k" <[EMAIL PROTECTED]> wrote > > > which function replaced fork() in Python2.5? Replaced? >>> sys.version, os.fork ('2.5 (release25-maint, Dec 9 2006, 14:35:53) \n[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)]', ) Andreas __

[Tutor] Builtin "property" decorator hiding exceptions

2007-04-18 Thread Jacob Abraham
Hi, The sample script below throws the exception "AttributeError: input" rather than the expected exception "AttributeError: non_existent_attribute". Please help me write a decorator or descriptor of my own that fixes the issue. class Sample(object): def __init__(self): sel

Re: [Tutor] Builtin "property" decorator hiding exceptions

2007-04-18 Thread Andreas Kostyrka
I know, this might sound stupid, but property is not a decorator. :) Andreas * Jacob Abraham <[EMAIL PROTECTED]> [070419 08:25]: > Hi, > >The sample script below throws the exception "AttributeError: input" > rather than the expected exception "AttributeError: non_existent_attribute". >

Re: [Tutor] screen scraping web-based email

2007-04-18 Thread Alan Gauld
"R. Alan Monroe" <[EMAIL PROTECTED]> wrote > You can drive the fat client via COM if you install the Win32 > extensions for python. > >> (I know I could do it with a torturous combination of applescript >> and > > Except judging by this, you're on a MAC... so maybe not. Still, > working WITH the