Re: [Tutor] Thanks (was Random Number Generator)

2007-12-05 Thread bhaaluu
On Dec 4, 2007 7:21 PM, earlylight publishing <[EMAIL PROTECTED]> wrote: > Thank you everyone for your help! I have no idea why it never occured to me > to Google it. Thanks for the code. Now let's see if I can get this sucker > to work! > 1) Wikipedia <-- learn a basic vocabulary so you can e

Re: [Tutor] Random Number Generator

2007-12-05 Thread Dick Moores
At 02:41 PM 12/4/2007, bhaaluu wrote: I'm running the Python 2.4.3 interactive interpreter in a Konsole at a bash prompt: $ python >>> help Type help() for interactive help, or help(object) for help about object. But look what I get with Python 2.5.1 and Win XP: ==

[Tutor] This is the online help utility [tutorial].

2007-12-05 Thread bhaaluu
Greetings, Recently a thread about Python's online help utility was buried within another thread with a different Subject. So I thought I'd try to summarize that thread within a thread in a thread of its own. It would be helpful for those running different versions of Python on differnet systems to

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
On Monday 03 December 2007, Tiger12506 wrote: > >> ## > >> > > s = '/home/test/' > > s1 = s.lstrip('/ehmo') > > s1 > >> > >> 'test/' > >> ## I've been having some problems posting to this list, so this is also a kind of test: I just wrote

Re: [Tutor] info, help, guidence,...

2007-12-05 Thread Kent Johnson
jeff witt wrote: > here are a few questions that go through my head... > how does python get applied to a GUI? There are many possibilities, see http://wiki.python.org/moin/CategoryPyGUI Also you can use native window toolkits on Windows and Mac. > is > it accepted in the world of programmi

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
On Monday 03 December 2007, Tiger12506 wrote: > >> ## > >> > > s = '/home/test/' > > s1 = s.lstrip('/ehmo') > > s1 > >> > >> 'test/' > >> ## I've been having some problems posting to this list, so this is also a kind of test: I just wrote

Re: [Tutor] info, help, guidence,...

2007-12-05 Thread Brian Wisti
Hi Jeff, On Dec 5, 2007 7:30 AM, jeff witt <[EMAIL PROTECTED]> wrote: > > Hello, > i have some questions about programming in general and python,.. Welcome! You have a lot of great questions. Tell your brother to relax. First off, Python is a great first language because it was written with an e

Re: [Tutor] info, help, guidence,...

2007-12-05 Thread taserian
Sorry if this isn't the right place for it, but today's xkcd comic strip is very apropos for the newly illuminated in all things Python. http://www.xkcd.com/ Tony R. On Dec 5, 2007 12:00 PM, bhaaluu <[EMAIL PROTECTED]> wrote: > Greetings, > > On Dec 5, 2007 10:30 AM, jeff witt <[EMAIL PROTECTED

[Tutor] how to accept an integer?

2007-12-05 Thread Mahesh N
I dun understand the mistake. My aim is to accept an integer number. The python lookup in IDLE asks for a string object but the interpreter returns with the following error message. Some one pls explain. Thank You PS : I understand that i can do type conversion after getting input thru raw_input()

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Kent Johnson
Mahesh N wrote: > I dun understand the mistake. My aim is to accept an integer number. The > python lookup in IDLE asks for a string object but the interpreter > returns with the following error message. Some one pls explain. > Thank You > > PS : I understand that i can do type conversion after

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
On Friday 30 November 2007, Eric Brunson wrote: > Tim Johnson wrote: > > Hello: > > I'm seeing some strange behavior with lstrip operating > > on string representations of *nix-style file paths > > > > Example: > s = '/home/test/' > s1 = s.lstrip('/home') > s1 > > > > 'test/' ## '/

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
Trying this again. This list has not be receiving all of my emails.. == On Friday 30 November 2007, Eric Brunson wrote: > Tim Johnson wrote: > > Hello: > > I'm seeing some strange behavior with lstrip operating > > on string representations of *nix-style file pat

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Eric Brunson
Mahesh N wrote: > I dun understand the mistake. My aim is to accept an integer number. > The python lookup in IDLE asks for a string object but the interpreter > returns with the following error message. Some one pls explain. > Thank You > > PS : I understand that i can do type conversion after g

Re: [Tutor] Problems with List Server?

2007-12-05 Thread Tim Johnson
On Monday 03 December 2007, Tim Johnson wrote: > I appear to be having a weird problem with the List Server. > At first, email sent to this address did not appear at > all. > After contacting the ML maintainers only one email from > me to this address go through. When I replied to the > thread whic

Re: [Tutor] info, help, guidence,...

2007-12-05 Thread bhaaluu
Greetings, On Dec 5, 2007 10:30 AM, jeff witt <[EMAIL PROTECTED]> wrote: > > Hello, > i have some questions about programming in general and python,.. > my brother (who is a programmer) guides me to ".net" languages, and i am > not too sure why, however, he is getting sick of me pestering him wit

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Mahesh N
On Dec 6, 2007 2:31 AM, Mahesh N <[EMAIL PROTECTED]> wrote: > I dun understand the mistake. My aim is to accept an integer number. The > python lookup in IDLE asks for a string object but the interpreter returns > with the following error message. Some one pls explain. > Thank You > > PS : I under

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Mahesh N
On Dec 6, 2007 2:37 AM, Eric Brunson <[EMAIL PROTECTED]> wrote: > Mahesh N wrote: > > I dun understand the mistake. My aim is to accept an integer number. > > The python lookup in IDLE asks for a string object but the interpreter > > returns with the following error message. Some one pls explain.

Re: [Tutor] Selecting a browser

2007-12-05 Thread Kent Johnson
Ricardo Aráoz wrote: > The other way to handle it would be to include in the documentation that > windows paths should have '/' or '' instead of '\\'. > The choice would depend on whether the authors consider there is a use > for the escape character, and what value that escape character might

[Tutor] Best way of learning

2007-12-05 Thread andy
Dear Pythonistas Over a year ago I dabbled in learning Python, working my way through a few tutorials, the Deitel's "How to program in Python" and Hetland's "Practical Python", until I came across the OOP sections. My mind just froze up, and I found myself wondering if I had really understood

Re: [Tutor] Random Number Generator

2007-12-05 Thread bhaaluu
$ python >>> help() help> 'topics' [snip] CODEOBJECTS FRAMES POWER TUPLES [snip] help> 'POWER' 5.4 The power operator The power operator binds more tightly than unary operators on its l

[Tutor] xkcd on Python

2007-12-05 Thread Kent Johnson
http://xkcd.com/353/ :-) Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] lstrip removes '/' unexpectedly

2007-12-05 Thread Tim Johnson
Gentlemen: There appears to still be a problem. The email below was also sent, but I do not see that it has been received. Send time was about 2 hours previous to this. (09:27:42 Alaska Standard Time) tim -

[Tutor] info, help, guidence,...

2007-12-05 Thread jeff witt
Hello, i have some questions about programming in general and python,.. my brother (who is a programmer) guides me to ".net" languages, and i am not too sure why, however, he is getting sick of me pestering him with my questions,.. i like the little i know about python, it seems to be user fri

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Jerry Hill
On Dec 5, 2007 4:01 PM, Mahesh N <[EMAIL PROTECTED]> wrote: > I dun understand the mistake. My aim is to accept an integer number. The > python lookup in IDLE asks for a string object but the interpreter returns > with the following error message. Some one pls explain. > Thank You > > PS : I under

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Kent Johnson
Bryan Fodness wrote: > speed = int(raw_input(prompt)) > > > Is this how ALL known integers should be input? Yes, with probably a try/except block and a while loop around it to handle invalid input. There are two good reasons for doing this instead of using input: - it guarantees that the

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Jerry Hill
On Dec 5, 2007 4:46 PM, Bryan Fodness <[EMAIL PROTECTED]> wrote: > On Dec 5, 2007 4:16 PM, Jerry Hill <[EMAIL PROTECTED]> wrote: > > speed = int(raw_input(prompt)) > > > Is this how ALL known integers should be input? I don't think I understand the question. If you are prompting your user to ente

Re: [Tutor] info, help, guidence,...

2007-12-05 Thread Alan Gauld
"jeff witt" <[EMAIL PROTECTED]> wrote > my brother (who is a programmer) guides me to ".net" languages, OK, Python is a .NET language too. > and i am not too sure why, .NET is the new Microsoft standard and their counter attack on Java. It offers a language neutral runtime environment that allo

Re: [Tutor] Random Number Generator

2007-12-05 Thread Dick Moores
At 04:35 AM 12/5/2007, bhaaluu wrote: >It seems to be case-sensitive Mr. Moores! >When I entered 'power' (like you did), I also got: >help> 'power' >no Python documentation found for 'power' > >Try entering: 'POWER' (all caps, just like in the output). Thanks! I should have tried that. Dick Moor

Re: [Tutor] Time module

2007-12-05 Thread Tim Golden
Kent Johnson wrote: > Norman Khine wrote: >> Hello, >> I am having difficulties in converting the following to display the >> difference that has passed in hours and seconds in a nice way. >> >> from datetime import datetime >> now = datetime.now() >> posted = date >> difference = now - posted >>

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Alan Gauld
"Mahesh N" <[EMAIL PROTECTED]> wrote > PS : I understand that i can do type conversion after getting input > thru > raw_input(). But how does input() function work? > prompt="temme a number\n" speed =input(prompt) > > Traceback (most recent call last): > File "", line 1, in >spe

Re: [Tutor] Best way of learning

2007-12-05 Thread bhaaluu
On Dec 5, 2007 5:43 PM, andy <[EMAIL PROTECTED]> wrote: > Dear Pythonistas > [snip] > > So, after this long-winded introduction, I was hoping to pick the wisdom > of this list to get some pointers of what to do/not to do to make the > most effective use of the few hours I have to learn how to progr

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Alan Gauld
"Mahesh N" <[EMAIL PROTECTED]> wrote > More over i find python to be a little sluggish after having worked > with C > and Java. If you translate C or Java code into python you will usually get a less than optimal implementation. Python should be barely slower than Java and often faster. Compared

Re: [Tutor] how to accept an integer?

2007-12-05 Thread Bryan Fodness
On Dec 5, 2007 4:16 PM, Jerry Hill <[EMAIL PROTECTED]> wrote: > On Dec 5, 2007 4:01 PM, Mahesh N <[EMAIL PROTECTED]> wrote: > > I dun understand the mistake. My aim is to accept an integer number. The > > python lookup in IDLE asks for a string object but the interpreter > returns > > with the fol

[Tutor] Mail? What's that?

2007-12-05 Thread Ricardo Aráoz
So I eventually got to sending mail with python. Some articles, trying and google led me to this script: import smtplib import time date = time.ctime(time.time( )) >From = '[EMAIL PROTECTED]' To = ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]'] Subj = 'Hi' text = ('From: %s\nTo: %s\nDate: %s\nSubject:

Re: [Tutor] Button 1 Motion Event

2007-12-05 Thread Luke Paireepinart
Johnston Jiaa wrote: > >> Just don't distinguish between quick and slow drags. Just keep a >> temporary variable that has the previous mouse position, and draw >> ovals from there to the current mouse position every time your >> function is called. > > I now have the variable with the previous

[Tutor] While Loops and Modules

2007-12-05 Thread earlylight publishing
Hello again to all the wonderfully helpful folks on this list. Today I did my Google homework and I found this neat bit of code for a countdown timer. import time import threading class Timer(threading.Thread): def __init__(self, seconds): self.runTime = seconds threadin

Re: [Tutor] Mail? What's that?

2007-12-05 Thread Luke Paireepinart
Ricardo Aráoz wrote: > So I eventually got to sending mail with python. > Some articles, trying and google led me to this script: > > import smtplib > import time > > date = time.ctime(time.time( )) > >From = '[EMAIL PROTECTED]' > To = ['[EMAIL PROTECTED]', '[EMAIL PROTECTED]'] > Subj = 'Hi' > text