Re: [Tutor] way of dictating leading zeros

2009-03-15 Thread Andre Engels
On Mon, Mar 16, 2009 at 3:47 AM, Patrick wrote: > Hi Everyone > > I am trying to write a program that creates a bunch of svg files and > then edits their values. I am then encoding them into a video. It's not > encoding right because my filenames are wrong. They have to have a > sequence. Right no

[Tutor] way of dictating leading zeros

2009-03-15 Thread Patrick
Hi Everyone I am trying to write a program that creates a bunch of svg files and then edits their values. I am then encoding them into a video. It's not encoding right because my filenames are wrong. They have to have a sequence. Right now they are 1.svg, 2.svg, 3.svg etc but they should be 001.sv

[Tutor] Help With Rock, Paper Scissor Game

2009-03-15 Thread Brendy Siguenza
This is the template that we are suppose to use while doing the program, I am a beginner to this programming language and really have no clue what I am doing import random #table of winning plays win_play_for = {¹r¹:¹p¹, ¹p¹:¹s¹, ¹s¹:¹r¹} #scoring results player_score = 0 mach_score = 0 #keep t

Re: [Tutor] Parse XML file

2009-03-15 Thread marc
> Message: 5 > Date: Sun, 15 Mar 2009 10:56:22 +0100 > From: Stefan Behnel > Subject: Re: [Tutor] Parse XML file > To: tutor@python.org > Message-ID: > Content-Type: text/plain; charset=ISO-8859-1 > > Lukas Agrapidis wrote: >> I am trying to parse an XML file using Python and found this resource

Re: [Tutor] Need Assistants with Python Please

2009-03-15 Thread Emile van Sebille
Jared White wrote: Good Morning Everyone, I am having a little issue with Python, Actually, two... Hopefully Someone Can Help Me I am trying to Develop a Python program that converts a single fuel rating from mpg to lp100km. So far ive come up with this code. But it seems not to

Re: [Tutor] Need Assistants with Python Please

2009-03-15 Thread Alan Gauld
"Jared White" wrote So far ive come up with this code. But it seems not to be working, Can someone please help me figure out what ive done wrong def main (): print "The program converts Miles Per Gallon (US) to Liters Per 100 Kilometer." kilometers = input ("What is the Miles Per Ga

[Tutor] Need Assistants with Python Please

2009-03-15 Thread Jared White
Good Morning Everyone, I am having a little issue with Python, Hopefully Someone Can Help Me I am trying to Develop a Python program that converts a single fuel rating from mpg to lp100km. So far ive come up with this code. But it seems not to be working, Can someone please help me figure

Re: [Tutor] TypeError: list objects are unhashable

2009-03-15 Thread Kent Johnson
On Sun, Mar 15, 2009 at 8:27 AM, qsqgeekyog...@tiscali.co.uk wrote: l1 = [{'url': 'ws.geonames.org', 'type': 'findNearby', > 'parameters': [50.101, 10.02]}, {'url': 'ws.geonames.org', > 'type': 'findNearby', 'parameters': [50.101, 10.02]}, > {'url': 'ws.geonames.org',

Re: [Tutor] calling user defined function

2009-03-15 Thread bob gailer
roberto wrote: On Sun, Feb 22, 2009 at 11:10 PM, bob gailer wrote: roberto wrote: hello i have a question which i didn't solved yet: i can define a function using the text editor provided by IDLE 3.0; then i'd like to call this function from the python prompt but when i try to do it,

Re: [Tutor] How to only give the user so much time to enter response?

2009-03-15 Thread bob gailer
james carnell wrote: Trying to use Timer in console based game that gives the user so much time to act. If they do not act then it just passes the turn back to the program to do the next thing. I have Python 2.5 and Windows XP. http://www.python.org/doc/2.5.2/lib/timer-objects.html def hello()

Re: [Tutor] How to only give the user so much time to enter response?

2009-03-15 Thread Kent Johnson
On Sun, Mar 15, 2009 at 4:22 AM, james carnell wrote: > Trying to use Timer in console based game that gives the user so much time > to act. If they do not act then it just passes the turn back to the program > to do the next thing. I have Python 2.5 and Windows XP. > so... this kind is where I a

Re: [Tutor] Simple User Entry Verification

2009-03-15 Thread Kent Johnson
On Sat, Mar 14, 2009 at 5:52 PM, R. Alan Monroe wrote: > >> while type(start)!=float: > > Did you try quotes around the word "float"? That won't help, type(start) is a type object, not a string. It's also possible that Ian is entering an integer, he didn't show the input value: In [1]: print typ

[Tutor] TypeError: list objects are unhashable

2009-03-15 Thread qsqgeekyog...@tiscali.co.uk
>>> l1 = [{'url': 'ws.geonames.org', 'type': 'findNearby', 'parameters': [50.101, 10.02]}, {'url': 'ws.geonames.org', 'type': 'findNearby', 'parameters': [50.101, 10.02]}, {'url': 'ws.geonames.org', 'type': 'countryInfo', 'parameters': [50.101, 10.02]}, {'url

Re: [Tutor] calling user defined function

2009-03-15 Thread roberto
On Sun, Feb 22, 2009 at 11:10 PM, bob gailer wrote: > roberto wrote: >> >> hello >> i have a question which i didn't solved yet: >> i can define a function using the text editor provided by IDLE 3.0; >> then i'd like to call this function from the python prompt >> >> but when i try to do it, pytho

Re: [Tutor] TypeError: dict objects are unhashable

2009-03-15 Thread Lie Ryan
Emile van Sebille wrote: Mark Tolonen wrote: [dict(n) for n in set(tuple(n.items()) for n in l1)] Anyone know if the ordered items for two different dicts where dicta == dictb is guaranteed the same? I know the ordering is unspecified but you can depend on the sequence of keys matching data

Re: [Tutor] Parse XML file

2009-03-15 Thread Stefan Behnel
Lukas Agrapidis wrote: > I am trying to parse an XML file using Python and found this resource > http://diveintopython.org/xml_processing/parsing_xml.html You might be interested in ElementTree: http://effbot.org/zone/element.htm It's a lot easier to use than minidom, especially for new users.

Re: [Tutor] How to only give the user so much time to enter response?

2009-03-15 Thread Alan Gauld
"james carnell" wrote Trying to use Timer in console based game that gives the user so much time to act. Thats quite tricky in standard console mode. If you were on Linux (or MacOS?) you could use curses and I think it would be easier there. But on XP I think you may have to get into the

[Tutor] How to only give the user so much time to enter response?

2009-03-15 Thread james carnell
Trying to use Timer in console based game that gives the user so much time to act. If they do not act then it just passes the turn back to the program to do the next thing. I have Python 2.5 and Windows XP. http://www.python.org/doc/2.5.2/lib/timer-objects.html def hello(): print "hello, wor