[Tutor] What is a Python "project"?

2006-10-02 Thread Dick Moores
I tried out Wing IDE Personal () off and on for 30 days, and then, finding it easy to use (probably because it's designed for Python), decided to buy it. I'm happy with it, and very pleased with the fast response from technical support available by email.

Re: [Tutor] Number guessing game

2006-10-02 Thread Luke Paireepinart
Christopher Hatherly wrote: > Hi, > I'm brand new to Python, and almost brand new to programming. I'm > teaching myself slowly through a 'Python Programming for the Absolute > Beginner' book, which is great so far. Awesome, I'm always happy to hear of budding pythonistas :D > One of the challeng

[Tutor] Number guessing game

2006-10-02 Thread Christopher Hatherly
Hi, I'm brand new to Python, and almost brand new to programming. I'm teaching myself slowly through a 'Python Programming for the Absolute Beginner' book, which is great so far. One of the challenge problems though, was to write a script for a number guessing game, where you pick a number and the

[Tutor] [Fwd: Re: database web app, what tool?]

2006-10-02 Thread Liam Clarke
Original Message Subject:Re: [Tutor] database web app, what tool? Date: Mon, 02 Oct 2006 09:33:28 +0100 From: [EMAIL PROTECTED] To: Liam Clarke <[EMAIL PROTECTED]> References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> Thank you Liam, O

Re: [Tutor] timeit at the command line

2006-10-02 Thread Dick Moores
At 01:50 PM 10/2/2006, John Fouhy wrote: >On 02/10/06, Dick Moores <[EMAIL PROTECTED]> wrote: >>C:\>python -m timeit -s"for x in range(100):" "x+=1" >>Traceback (most recent call last): > >The -s option specifies the setup code. In this case, you don't have >any setup code. Try this: > >pytho

Re: [Tutor] My number-guessing program

2006-10-02 Thread John Fouhy
On 03/10/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > Note that the random.randint function includes both endpoints (I.E. the > numbers are 1-10 including 10) > but the range() function doesn't include the last endpoint. Which is why (in my not-so-humble opinion :-) ) we should tell people t

Re: [Tutor] One of my 'baby step' programs

2006-10-02 Thread John Fouhy
On 03/10/06, Alan Gilfoy <[EMAIL PROTECTED]> wrote: > > for i in range(10): > > ... break > > ... else: > > ... print 'foo' > > ... > for i in range(10): > > ... pass > > ... else: > > ... print 'foo' > > ... > > foo > > > pardon the newb question, but what do these code lines do

Re: [Tutor] Python code to split and reassemble files

2006-10-02 Thread Eric Walstad
Andrew Robert wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Never mind.. :) > > > found it at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/224800 > > However, if someone has something better, I would be very interested. Hi Andrew, If you are on a *nix machine you cou

Re: [Tutor] database web app, what tool?

2006-10-02 Thread Eric Walstad
Hey Paulino, I'm a Django fan but from your description, a simple CGI app might do nicely. Heck, you've already got the code written, just wrap it in a CGI script that formats your list of records in HTML and serve the script from your (already setup?) apache or even from your workstation wit

Re: [Tutor] how to make a reference to part of list?

2006-10-02 Thread Danny Yoo
> for example, I want to mutate part of a list, of course, I can achieve > this by passing the pair list and (begin, end) as parameters. but in > some case, this manner is quite tedious and in efficient I'm not sure what you mean by "inefficient". What do you think a "pointer" is, if not wha

Re: [Tutor] My number-guessing program

2006-10-02 Thread Luke Paireepinart
> > > My line: number = 3 > Would I use 'number = random.randint()' in place of that, to have the > relevant number be random? yes, but remember that random.randint takes 2 arguments, the endpoints. E.G. random.randint(1,10) would be equivalent to random.choice(range(1,11)) or random.choice([1,2,

Re: [Tutor] how to make a reference to part of list?

2006-10-02 Thread Kent Johnson
Xie Chao wrote: >3Q very much! >What I really want to get is a c-style array, a pointer to the > beginning of part of a list (or whatever alike). for example, I want to > mutate part of a list, of course, I can achieve this by passing the pair > list and (begin, end) as parameters. but i

Re: [Tutor] how to make a reference to part of list?

2006-10-02 Thread Xie Chao
   3Q very much!    What I really want to get is a c-style array, a pointer to the beginning of part of a list (or whatever alike). for example, I want to mutate part of a list, of course, I can achieve this by passing the pair list and (begin, end) as parameters. but in some case, this manner is q

Re: [Tutor] how to make a reference to part of list?

2006-10-02 Thread Kent Johnson
Xie Chao wrote: > Namely, if list1 = {1, 2, 3}, and I wanna make a reference, say > "ref", to list1's sublist (which is also of type list), say {2, 3}, so > that when I make change to ref[0], then list1[1] will be changed! > But how can I make such a reference, 3x! There is nothi

Re: [Tutor] My number-guessing program

2006-10-02 Thread Alan Gilfoy
Yeah, that's what the wiki-based tutorial mentioned. In fact, Lee Harr (my community adviser) also suggested using a random number. Quoting Luke Paireepinart <[EMAIL PROTECTED]>: > Alan Gilfoy wrote: (the start of the code for my number-guessing thingamajig) >> >> else: >>print "The number-gu

[Tutor] how to make a reference to part of list?

2006-10-02 Thread Xie Chao
  Namely, if  list1 = {1, 2, 3}, and I wanna make a reference, say "ref",  to list1's sublist (which is also of type list), say {2, 3}, so that when I make change to ref[0], then list1[1] will be changed!   But how can I make such a reference, 3x!    

Re: [Tutor] timeit at the command line

2006-10-02 Thread Dick Moores
At 03:08 AM 10/2/2006, Kent Johnson wrote: >Dick Moores wrote: > > C:\>python -m timeit -s"x=0" "while x<100:" " x+=1" > > 1000 loops, best of 3: 0.123 usec per loop > > > > C:\>python -m timeit -s"for x in range(100):" "x+=1" > > Traceback (most recent call last): > >File "E:\Python2

Re: [Tutor] timeit at the command line

2006-10-02 Thread Kent Johnson
Dick Moores wrote: > C:\>python -m timeit -s"x=0" "while x<100:" " x+=1" > 1000 loops, best of 3: 0.123 usec per loop > > C:\>python -m timeit -s"for x in range(100):" "x+=1" > Traceback (most recent call last): >File "E:\Python25\lib\runpy.py", line 95, in run_module > filename

Re: [Tutor] senior project

2006-10-02 Thread Kent Johnson
Alan Gilfoy wrote: > I am a senior at the School Without Walls in Rochester, NY. As such, I > get to do a senior project. I decided to work on computer programming, > since that is sometihng that I certianly think can hold my interest > throughout the school year. > > (despite my compute rinter

Re: [Tutor] One of my 'baby step' programs

2006-10-02 Thread Kent Johnson
Luke Paireepinart wrote: > Alan Gilfoy wrote: >> -code block- >> >> number = 3 >> running = True >> >> while running: >>guess = int(raw_input("Please enter a number : ")) #lets user guess a >> number >> >>if guess == number: >>print "Yay, you got the right number, good for you. But