Re: [Tutor] Run script automatically in IDLE shell

2005-12-08 Thread Kent Johnson
Yann Le Du wrote: > P.S. I do all this to have accentuated characters (French) correctly > displayed, and this is done in the IDLE Shell, but fails inside the DOS > window. So this is why I want to have my scripts run directly inside the > IDLE shell... The DOS shell uses code page 437 while I

Re: [Tutor] my text adventure

2005-12-08 Thread Kent Johnson
david wrote: > thanks. i had actually coded this almost exactly the same. i'll try > to make my questions more specific. i am able to pickle and restore > world. which is a dictionary of coordinates : room objects. when i > look at the savefile that pickle generates i can see all my > descriptions

Re: [Tutor] My First Program

2005-12-08 Thread Greg Hasseler
You should create a counting variable. Whenever the user answers incorrectly, increment that variable by one. Starting with the fourth question and any question after, you should check the value of the variable to see if it is three or greater. If it is, then exit, if not, then continue. Check o

Re: [Tutor] Escaping double quotes

2005-12-08 Thread Tim Johnson
* w chun <[EMAIL PROTECTED]> [051207 22:16]: > > > >>> label = 'this is "quoted"' > > > >>> label.replace('"','\"') > > > 'this is "quoted"' > > > ## This works > > > >>> label.replace('"','\'') > > > "this is 'quoted'" > > > > > > What I should have been using is label.replace('"','\\"') > >

[Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread ps python
Hi, using ElementTree, how can I extract text of a particular element, or a child node. For example: Signal transduction __ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.sha

[Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread ps python
Hi, using ElementTree, how can I extract text of a particular element, or a child node. For example: Signal transduction Energy process I looked at some tutorials (eg. Ogbuji). Those examples described to extract all text of nodes and child nodes. In

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread Danny Yoo
> For example: > > > >Signal transduction > > >Energy process > > > > I looked at some tutorials (eg. Ogbuji). Those > examples described to extract all text of nodes and > child nodes. Hi Mdan, The following might help: http://article.gmane.org/

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread Kent Johnson
ps python wrote: > Hi, > > using ElementTree, how can I extract text of a > particular element, or a child node. > > For example: > > > >Signal transduction > > >Energy process > > > > In the case where I already know which element tags > have the in

Re: [Tutor] My First Program

2005-12-08 Thread Joseph Quigley
Hi! My first "ever" program that I've created is a simple game called "State Capitals". It's straight forward; 5 simple questions about state capitals ina non-GUI format. Can someone look over my code and offer tips, suggestions,criticism? Also, I'd like to be able to end the program if the user mi

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread ps python
Kent and Dany, Thanks for your replies. Here fromstring() assuming that the input is in a kind of text format. what should be the case when I am reading files directly. I am using the following : from elementtree.ElementTree import ElementTree mydata = ElementTree(file='1.xml') iter =

Re: [Tutor] how to extract text by specifying an element using ElementTree

2005-12-08 Thread Kent Johnson
ps python wrote: > Kent and Dany, > Thanks for your replies. > > Here fromstring() assuming that the input is in a kind > of text format. Right, that is for the sake of a simple example. > > what should be the case when I am reading files > directly. > > I am using the following : > > fr

Re: [Tutor] My First Program

2005-12-08 Thread Danny Yoo
> > Hi! My first "ever" program that I've created is a simple game called > > "State Capitals". It's straight forward; 5 simple questions about > > state capitals in a non-GUI format. [some code cut] Hi Trent, Looks good so far! There is one direct thing we can do to make the program a little

[Tutor] bitwise manipulation

2005-12-08 Thread Tim Johnson
Hello Snake Charmers: I'm designing a database and am thinking about how to store a number number of boolean values in one field. Are there any python resources available that can make setting/unsetting bits directly? I used to do that in "C" with preprocessor macros that made calls like set_bit

Re: [Tutor] bitwise manipulation

2005-12-08 Thread John Fouhy
On 09/12/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > Are there any python resources available that can make setting/unsetting > bits directly? I used to do that in "C" with preprocessor macros that > made calls like set_bit(vInteger,bit_position) > and unset_bit(vInteger,bit_position). Well, you

Re: [Tutor] bitwise manipulation

2005-12-08 Thread Tim Johnson
* John Fouhy <[EMAIL PROTECTED]> [051208 16:55]: > On 09/12/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > > Are there any python resources available that can make setting/unsetting > > bits directly? I used to do that in "C" with preprocessor macros that > > made calls like set_bit(vInteger,bit_posi

Re: [Tutor] Timer

2005-12-08 Thread bob
At 07:18 PM 12/6/2005, Liam Clarke-Hutchinson wrote: >Hi, > >time.sleep() takes an argument as seconds. Oh yeah I know that but forgot.Sigh. Thanks for the correction. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tuto