Re: [Tutor] Comments appreciated

2005-01-05 Thread hugonz
and just work with parameter passing. >> > > Lovely, thank you. I started a project that is for learning spanish > on-line, of currently 300 lines or so, that is proceeding rapidly > thanks to these lessons learned. Thank you Python Tutors, and thank > you Python! Hola Luis, I'd like to help with

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 (form.g

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 comple

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=103529

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

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

Re: [Tutor] German Totorial!?!

2005-01-05 Thread Alan Gauld
> So you know a German Tutorial? There is a German translation of my tutorial and a whole bunch of dedicated Python web sites in German (I know because lots of them have links to my site and they show up on my web logs...)Try Googling for "python program german" HTH, Alan G Author of the Lea

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

2005-01-05 Thread Alan Gauld
> >I just got my own Linux box running again 4 months after > >moving house! I thought I'd try a Suse distro I got with > >Borlands Kylix and calamity - no python! > >Back to Mandrake I think. > > I have yet to see a SuSE distribution without python although you may have > to install it from using

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... >

Re: [Tutor] regex problem

2005-01-05 Thread Michael Powe
On Wed, Jan 05, 2005 at 06:33:32AM -0500, Kent Johnson wrote: > If you search comp.lang.python for 'convert html text', the top four > results all have solutions for this problem including a reference to this > cookbook recipe: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52297 > >

Re: [Tutor] regex problem

2005-01-05 Thread Michael Powe
On Wed, Jan 05, 2005 at 07:37:58AM -, Alan Gauld wrote: > > This function removes HTML formatting codes from a text email > Using regex to remove HTML is usually the wrong approach unless > you can guarantee the format of the HTML in advance. The > HTMLparser is usually better and simpler.

Re: [Tutor] regex problem

2005-01-05 Thread Michael Powe
On Tue, Jan 04, 2005 at 09:15:46PM -0800, Danny Yoo wrote: > > > On Tue, 4 Jan 2005, Michael Powe wrote: > > > def parseFile(inFile) : > > import re > > bSpace = re.compile("^ ") > > multiSpace = re.compile(r"\s\s+") > > nbsp = re.compile(r" ") > > HTMLRegEx = > > > > re

RE: [Tutor] German Totorial!?!

2005-01-05 Thread Robert, Andrew
How about: http://starship.python.net/crew/gherman/publications/tut-de/ Thank you, Andrew Robert Systems Architect Information Technology - OpenVMS Massachusetts Financial Services Phone: 617-954-5882 Pager: 781-764-7321 E-mail: [EMAIL PROTECTED] Linux User Number: #201204 -Original Me

[Tutor] German Totorial!?!

2005-01-05 Thread michael
Hello, Im a German peaople whou would learn Python. But I cant find a german tutorial. So you know a German Tutorial? Daer Michael ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: pickle juice and YAML (Re: [Tutor] dumping .pck files)

2005-01-05 Thread Alan Gauld
> Alan Gauld wrote: > > (Who hates XML almost as much as Java! :-) > > IMO dom4j makes XML quite easy to use from Java and really pleasant > in Jython. The integrated XPath support essentially gives you a > query engine on your data. > http://www.dom4j.org > Kent > (Who hates Java but has come to

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 >

[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 s

[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 ha

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 在 2005年1月5日 星期三 11:44,Liam Clarke 写道: > Sorry rephrase

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. -

[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] 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 to

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 like

[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 pick

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

Re: [Tutor] regex problem

2005-01-05 Thread Kent Johnson
If you search comp.lang.python for 'convert html text', the top four results all have solutions for this problem including a reference to this cookbook recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52297 comp.lang.python can be found here: http://groups-beta.google.com/group/com

Re: pickle juice and YAML (Re: [Tutor] dumping .pck files)

2005-01-05 Thread Kent Johnson
Alan Gauld wrote: (Who hates XML almost as much as Java! :-) IMO dom4j makes XML quite easy to use from Java and really pleasant in Jython. The integrated XPath support essentially gives you a query engine on your data. http://www.dom4j.org I have written about dom4j, Jython and XPath here: http:

[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] 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

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 t