Re: [Tutor] Looking for a firebird interface

2005-01-05 Thread John Fabiani
Thanks all I fixed it. John On Tuesday 04 January 2005 21:30, John Fabiani wrote: Hi, I'm using SUSE x86_64 Linux and unable to compile the KInterbasdb interface for Python.  I'm wondering if anyone has it compiled on either a 32bit or 64bit linux.  Of course I'm hoping someone is willing to

Re: [Tutor] Array pointers

2005-01-05 Thread Alan Gauld
I want to move all the 1's move to the right, 1 index at a time, preserving any spacing. So you want to insert a zero at the front and delete the first zero from the back? That doesn't require iterating over all the entries just enough to find the first zero... Playing with this for a

[Tutor] Python on linux

2005-01-05 Thread David Holland
You can use idle while using linux, just type in idle from a command prompt ! ALL-NEW Yahoo! Messenger - all new features - even more fun! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to run a script file

2005-01-05 Thread Bernard Lebel
Thanks everyone who answered, it's sorted now :-D Bernard ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] The Game of Life question

2005-01-05 Thread Kooser, Ara S
This is most likely a silly question and me not understanding python enough. I am a mentor for some high school kids participating in a supercomputing challenge. My background in programming is F77 (yeah laugh it up) and I want the kids to learn python and use it for the challenge. They

Re: [Tutor] The Game of Life question

2005-01-05 Thread Kent Johnson
You need to include the line import random at the beginning of your program. This gives you access to the contents of the 'random' module such as random.choice(). This chapter of the tutorial talks about modules: http://docs.python.org/tut/node8.html Kent Kooser, Ara S wrote: This is most

Re: [Tutor] The Game of Life question

2005-01-05 Thread Brian van den Broek
Kooser, Ara S said unto the world upon 2005-01-05 10:15: This is most likely a silly question and me not understanding python enough. I am a mentor for some high school kids participating in a supercomputing challenge. My background in programming is F77 (yeah laugh it up) and I want the kids

[Tutor] Lottery simulation

2005-01-05 Thread mit tezcan
Dear Tutor, I am new to python and only created very simple programs so far. I would like to simulate a lottery draw for 10 participants and run it for 52 weeks. The lottery numbers would have a range of 1 to 99. Each person would have just one number (random) and play for 52 weeks.

Re: [Tutor] Lottery simulation

2005-01-05 Thread Max Noel
On Jan 5, 2005, at 16:33, ümit tezcan wrote: Are there any starting ideas for me to get going on this project either thru the tutor or searching for snippets already created by fellow programmers?? That's probably obvious, but you should proceed as follows: - Generate a number for each person.

Re: [Tutor] Array pointers

2005-01-05 Thread
This code will work. a=[1,0,0,0,0,1,1,1,0,1,1,0,1,0] shorta=a[:] while 0 in shorta: shorta.reverse() shorta.remove(0) shorta.reverse() print [0,]*(len(a)-len(shorta))+shorta result=[0,]*(len(a)-len(shorta))+shorta Juan Shen 200515 11:44Liam Clarke Sorry rephrase - So I

[Tutor] games written in jython for a web page

2005-01-05 Thread David Holland
Does anyone know about tutorials (or open source projects) about writing in games in pure python (ie without using pygame). The reason is because I wrote a game using pygame but I would like to convert it to a game that can be played in a webpage as a Jython, (like a Java game) of course this is

[Tutor] CGI and cookies.

2005-01-05 Thread Luis N
When the script begins with main(f), it gets a KeyError and goes to the login page, but when the form data is submitted it returns a 404. Am I not setting/getting the cookie properly? Absolutely nothing is printed until zptIO is called. import os import Cookie from spanishlabs.conf import * from

Re: [Tutor] (OT) How to run a script file

2005-01-05 Thread Bill Campbell
On Wed, Jan 05, 2005, Alan Gauld wrote: Sorry if I missed something obvious, but how do I execute a python script file in the interpreter? I have Using the Python Interpreter in the Python tutorial but not much is said... You can import a script at the prompt as you would under Pythonwin. Or

Re: [Tutor] Array pointers

2005-01-05 Thread Jörg Wölke
Hello! I want to move all the 1's move to the right, 1 index at a time, preserving any spacing. [ snip ] I'm starting to think I'm going to have to go Cpp for this kind of direct pixel tweaking stuff. (640x480 (let alone 1024x768) is a lot of pixels to run through a for... loop)

Re: [Tutor] regex problem

2005-01-05 Thread Alan Gauld
Using regex to remove HTML is usually the wrong approach unless Thanks. This is one of those projects I've had in mind for a long time, decided it was a good way to learn some python. It's a good way to write increasingly complex regex! Basically because HTML is recursive in nature it

Re: [Tutor] Array pointers

2005-01-05 Thread Orri Ganel
I don't know about a large calculation time, but this seems to work: def rightshift(a): ia = a[:] for i in range(len(ia)-1,0,-1): if ia[i-1] == 1 and ia[i]!=1: ia[i]=1 ia[i-1]=0 return ia l

Re: [Tutor] The Game of Life

2005-01-05 Thread Danny Yoo
Just as a warning, none of what I'm going to code here is original at all: I'm rehashing a main idea off of a paper called Using the Game of Life to Introduce Freshman Students to the Power and Elegance of Design Patterns: http://portal.acm.org/citation.cfm?id=1035292.1028706

Re: [Tutor] The Game of Life question

2005-01-05 Thread Danny Yoo
On Wed, 5 Jan 2005, Kooser, Ara S wrote: They picked a project to model the flow of smallpox in a city and surroundings areas. So I saw the game of life and thought maybe they could modify it for use as a smallpox model. Hi Ara, Oh! My apologies for not posting the file as a complete

Re: [Tutor] cgi.FieldStorage and dictionary.get(' ')

2005-01-05 Thread hugonz
Strangely, the calls to print form.get('author') and form.get('password') don't appear in the output. Only the form.keys() appears. I don't have this on the top of my head, but I'm pretty sure you have to get the 'value' attribute, as in: print form.get('password').value do a dir