Hi everyone,
I've got a little project that requires me to parse a simple XML
file. The file comes from the browser history of Apple's Safari and
includes the URL that was visited, the title of the Web page, the
date and time it was last visited, and the total number of times it
was visite
I edited my code so
that it looks like this:
def
save_rates(exch): store =
open("exch.txt","w") for exch, rate in
rates.items(): store.write(exch +
'\n') store.write(`rate` +
'\n') store.close()
def
load_rates(exch): import os filename
= 'exch.txt' if
o
At 02:14 AM 12/14/2005, Liam Clarke wrote:
>Hi all,
>
>Just contemplating.
>
>If in Python I were organising a data index along the lines of -
>
>j = {
>
>"k_word1" : ["rec1","rec2","rec3","rec4"],
>...
>"k_wordn" :["recX","rec4"]
>
>}
>
>and I was going to find records that matched by seeing what
Pujo Aji said unto the world upon 2005-12-15 14:52:
> Hi,
> your guess still use random.randrange that's make computer doesn't care
> about whether guess is low or higher than your number.
>
> This code should be like this:
> Hope this help
>
> pujo
>
> On 12/15/05, William Mhlanga <[EMAIL PR
> event driven programming/asynchonis programming paradigm). Any advice
> or linkage to some tutorial type articles for event driven design.
You seem to have the basic concepts at least, but my tutorial does
have a topic on event driven programming you can try. It may be
too basic however.
Al
Try this code:
#The Guess My Number Game
#
#The computer picks a random number between 1 and 50
#The player tries to guess it and the computer lets
#the player know if the guess is too high, too low
#or right on the money
#If the player fails to guess the number after 5 tries
#the game ends and th
Hi William,
Just a word of warning, you should get used to using 'raw_input()'
rather than 'input()' in your
progams.
Why? Because input() attempts to run whatever you type in as a Python
program. If you want to know why that's a problem, try running your
progam. When it asks you to "Enter the nu
[keeping Tutor in CC]
-- Forwarded message --
Date: Thu, 15 Dec 2005 13:40:11 -0600
From: Bobby Castleberry <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] serial data capture/event driven help
Danny Yoo wrote:
> There's a module for handling the seria
Hi, your guess still use random.randrange that's make computer doesn't care about whether guess is low or higher than your number.This code should be like this: print "\t\t\tWelcome to \"Guess My Number\"!"
print "\nThink of a number between 1 and 50." print "I will try to guess it in as
-Repost. considering that my previous email lost -
hi,
can any one pls. help me on this simple issue. I
keep
forgetting some simple things and they turn out to
be
very important later.
i have a list 'a', and now i want to write all the
elements back in to a string. 'apple is a good
fruit'
On 16/12/05, ps python <[EMAIL PROTECTED]> wrote:
> >>> a = ['apple','is','a','good','fruit']
> >>> ab =''
> >>> for m in a:
> k = ''.join(m)
> ab.join(k)
You're almost there...
>>> a = ['apple', 'is', 'a', 'good', 'fruit']
>>> ' '.join(a)
'apple is a good fruit'
>>> '...'.join(a
hi,
can any one pls. help me on this simple issue. I keep
forgetting some simple things and they turn out to be
very important later.
i have a list 'a', and now i want to write all the
elements back in to a string. 'apple is a good fruit'
- getting this back into a string has drained my
brain.
I have been trying to write a guess my number game (using Michael Dawsons book), where the computer guesses the number that I thought of. Here is my code so far,#The Guess My Number Game
##The computer picks a random number between 1 and 50#The player tries to guess it and the computer lets#the pla
On Thu, 15 Dec 2005, Bobby Castleberry wrote:
> I'm looking to capture weights coming off of several in-motion scales
> through serial ports and dump them into a database. The database part
> is easy but I've never worked with serial collection.
Hi Bobby,
There's a module for handling the ser
Kent Johnson writes:
> ... ElementTree
My dear Watson!!!
> ...
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Thanks a bunch, Michael. I am using Fedora Core 4 and have
installed the tkinter package via yum. Everything is working
great as far as I can tell. That really helped. Thanks again
> On Wed, 14 Dec 2005 15:05:07 +0200
> Vlad Popescu <[EMAIL PROTECTED
I'm looking to capture weights coming off of several in-motion scales
through serial ports and dump them into a database. The database part
is easy but I've never worked with serial collection. I would like to
setup several data collection objects (one for each serial port) and as
they reciev
17 matches
Mail list logo