Re: [Tutor] tutorials

2006-01-17 Thread w chun
On 1/16/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > Has anyone got an easy way of printing the Python documentation in PDF > > format. Its all in HTML and is time consuming to print. > > You can buy it in paper book form. > It's a lot cheaper than trying to print the online stuff page by page! >

Re: [Tutor] Open file error

2006-01-17 Thread Danny Yoo
On Tue, 17 Jan 2006, andy senoaji wrote: > I'm back to my home machine, and ran again the open method, just to test > my sanity Here are the results: [cut] Hi Andy, Unfortunately, there are a few things that might be happening here. You mentioned earlier that: > I know for sure that the fil

[Tutor] References and list aliasing in Perl and Python [Was: Re: Dictionaries]

2006-01-17 Thread Danny Yoo
> > The terminology that the original poster uses ("references to another > > object") sounds a lot like the original usage of symbolic "soft" > > references in Perl. > > (http://www.perl.com/doc/manual/html/pod/perlref.html) > > > > Perl programmers, for the most part, avoid them now because they'

Re: [Tutor] Open file error

2006-01-17 Thread Alan Gauld
>>> f=open(r'c:\Test.txt','r') Traceback (most recent call last): File "", line 1, in ? IOError: [Errno 2] No such file or directory: 'c:\\Test.txt' Its pretty determined that Test.txt doesn't exist. What happens if you do: import os os.listdir('C:\\') In other words does Python see the file

Re: [Tutor] Open file error

2006-01-17 Thread andy senoaji
I'm back to my home machine, and ran again the open method, just to test my sanity Here are the results:>>> f=open(r'c:\Test.txt','r')Traceback (most recent call last):  File "", line 1, in ? IOError: [Errno 2] No such file or directory: 'c:\\Test.txt'>>> f=open(r'c:\\Test.txt','r')Traceback (most

Re: [Tutor] Dictionaries [Was: Re: string object into reference]

2006-01-17 Thread Victor Bouffier
Hi Danny, On Tue, 2006-01-17 at 16:03 -0800, Danny Yoo wrote: > > > My problem is I want to make a string object into a reference to > > > another object. To be more specific, I'm reading through a text file > > > of amino acids. The first item on each line is the amino acid name, > > > and a la

Re: [Tutor] quick question about threads

2006-01-17 Thread nephish
all i needed to know, thanks very much shawn On Tue, 2006-01-17 at 21:53 -0500, Kent Johnson wrote: > nephish wrote: > > Hey there, i have a program written in python that uses four threads > > that run all at the same time. Now i want to add a new thread with the > > same basic structure (threa

Re: [Tutor] quick question about threads

2006-01-17 Thread Kent Johnson
nephish wrote: > Hey there, i have a program written in python that uses four threads > that run all at the same time. Now i want to add a new thread with the > same basic structure (threading.thread) that will run only when needed. > This one will not run in a loop, it will just run once and quit.

[Tutor] Re: [OT] How to report issues with Standard library modules

2006-01-17 Thread DogWalker
"Liam Clarke" <[EMAIL PROTECTED]> said: >Hi all, > [...] >So... does anyone know how to pipe stderr in a cmd.exe console to a file? >foo.exe > bob.txt only pipes stdout, stderr is still hitting the screen. > To have stderr go to a separate file: foo.exe > bob.txt &2>err.txt To ha

[Tutor] quick question about threads

2006-01-17 Thread nephish
Hey there, i have a program written in python that uses four threads that run all at the same time. Now i want to add a new thread with the same basic structure (threading.thread) that will run only when needed. This one will not run in a loop, it will just run once and quit. So, i may need this to

[Tutor] [OT] How to report issues with Standard library modules

2006-01-17 Thread Liam Clarke
Hi all, After having a frustrating night last night trying to install pyid3lib on XP, which I think is due to something in distutils.core, I'm wondering how I should report it. I have the dotNET framework 2.0 installed, which should give distutils access to the MSVC++ compiler, but it's searching

[Tutor] Dictionaries [Was: Re: string object into reference]

2006-01-17 Thread Danny Yoo
> > My problem is I want to make a string object into a reference to > > another object. To be more specific, I'm reading through a text file > > of amino acids. The first item on each line is the amino acid name, > > and a later item is its exposed surface area. Hi Victor, It sounds like we'd

Re: [Tutor] string object into reference

2006-01-17 Thread Victor Bouffier
Ooops. Did not respond to the mailing list. Here is my replied-to post. -- Hi Kirk, There is nothing as a dumb question. I am assuming your source file will have a amino acid residue ('CYS' or 'TRP'), followed by a space, and then the corresponding surface area. You have to define a va

Re: [Tutor] string object into reference

2006-01-17 Thread Victor Bouffier
Pujo, I think your solution does not address Kirk's problem. You don't mention the addition of surface areas. If for any reason he had more than two types of amino acids, then he would need to use a dictionary for the totals, with each key being a specific amino acid. The actual steps to follow a

Re: [Tutor] Guess Your Number Game

2006-01-17 Thread Edgar Antonio Rodríguez Velazco
Check this:   ### import random print "Welcome to 'Guess Your Number'!"print "\nThink of a number between 1 and 100."print "And I will try and guess it!\n"print "Valid inputs are: higher, lower and correct." raw_input("\n\nPress enter once y

Re: [Tutor] Design suggestion - is a cookie the answer?

2006-01-17 Thread Adam Cripps
On 1/17/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > > > you are using GET instead of POST? GET is the default > > > submission method but POST is nearly always better and > > > should avoid the problem here. (I think, I haven't tried it!) > > > > I believe the python CGI module is submission-method

Re: [Tutor] string object into reference

2006-01-17 Thread Pujo Aji
Hello Kirk,If I'm not mistaken your idea is referencing two columns: first column is your acid name and the later is your surface area.Later you want to connect the surface area if you name the acid name.If that what you want another question arises... is your acid name is unique. If it is you can

Re: [Tutor] __iter__

2006-01-17 Thread Danny Yoo
> Where/how/when is 'def next(self(:' called? The 'for' loop statement does this internally when it marches across an iterable thing. We can write something something like this: ## for item in thing: print item ## Python is doing something like this

Re: [Tutor] Open file error

2006-01-17 Thread bob
At 09:23 AM 1/17/2006, Paul Kraus wrote: >On Tuesday 17 January 2006 12:11 pm, andy senoaji wrote: > > I am starting to pull my hair here. There were some postings in the past, > > similar to my problem, but the response was not clear enough. Sorry if you > > thingk I am reposting this. > > > > I a

Re: [Tutor] Open file error

2006-01-17 Thread Python
(replying back to the list also) On Tue, 2006-01-17 at 10:03 -0800, andy senoaji wrote: > Sorry for the inconsistent error message. I think I may pasted > incorretcly. I am now in a different machine, and have tested Paul's > suggestion, and it worked. But would the 'r' tackles the escape > sequenc

Re: [Tutor] __iter__

2006-01-17 Thread Danny Yoo
> One small correction: Pointer should have an __iter__() method that > returns self; this is part of the iterator protocol. See PEP 234 > http://www.python.org/peps/pep-0234.html Hi Kent, Ah, thank you! Ok, the corrected code is: # class MyListOf

Re: [Tutor] PIL, fonts and making images (fwd)

2006-01-17 Thread Danny Yoo
-- Forwarded message -- Date: Tue, 17 Jan 2006 09:47:58 +0100 From: Rinzwind <[EMAIL PROTECTED]> To: Danny Yoo <[EMAIL PROTECTED]> Subject: Re: PIL, fonts and making images That's not good. Well I guess it does what it is suppose to do: make it able to create diagrams and the pe

Re: [Tutor] __getitem__

2006-01-17 Thread Alan Gauld
>>>Nothing unless its implementation uses a while loop >>>and index, but thats unlikely. >> >> >> But that is pretty close to what actually happens, according to the >> language ref docs for 'in' (see my previous post). Only in certain cases. The point I was making (or trying to) is that both

Re: [Tutor] Open file error

2006-01-17 Thread Alan Gauld
> I am trying to run (on an XP box) a simple open file using this: > f = open(r'C:\Test.txt', 'r') > IOError: [Errno 2] No such file or directory: 'C:\Test.txt' > I know for sure that the file is there > Furthermore, how does Python assumes the search path? There is no search, you have specifi

Re: [Tutor] Open file error

2006-01-17 Thread Alan Gauld
>> I am trying to run (on an XP box) a simple open file using this: >> f = open(r'C:\Test.txt', 'r')Newbie here but shouldn't it be. > > Newbie Here > > f = open( r'C:\\Test.txt','r') > > I think you are escaping the T with \T. The r in front of the string should prevent that problem. If the r

Re: [Tutor] Open file error

2006-01-17 Thread Python
On Tue, 2006-01-17 at 09:11 -0800, andy senoaji wrote: > I am starting to pull my hair here. There were some postings in the > past, similar to my problem, but the response was not clear enough. > Sorry if you thingk I am reposting this. > > I am trying to run (on an XP box) a simple open file usi

[Tutor] string object into reference

2006-01-17 Thread Kirk Vander Meulen
Hi, just joined.  I've got a question that I'm guessing there's a ridiculously easy answer to, but I'm having trouble (no excuses, I'm just dumb!)... My problem is I want to make a string object into a reference to another object.  To be more specific, I'm reading through a text file of amino acid

Re: [Tutor] Open file error

2006-01-17 Thread Terry Carroll
On Tue, 17 Jan 2006, Paul Kraus wrote: > On Tuesday 17 January 2006 12:11 pm, andy senoaji wrote: > > I am starting to pull my hair here. There were some postings in the past, > > similar to my problem, but the response was not clear enough. Sorry if you > > thingk I am reposting this. > > > > I a

Re: [Tutor] Open file error

2006-01-17 Thread Paul Kraus
On Tuesday 17 January 2006 12:11 pm, andy senoaji wrote: > I am starting to pull my hair here. There were some postings in the past, > similar to my problem, but the response was not clear enough. Sorry if you > thingk I am reposting this. > > I am trying to run (on an XP box) a simple open file us

[Tutor] Open file error

2006-01-17 Thread andy senoaji
I am starting to pull my hair here. There were some postings in the past, similar to my problem, but the response was not clear enough. Sorry if you thingk I am reposting this.I am trying to run (on an XP box) a simple open file using this: f = open(r'C:\Test.txt', 'r') but it keeps give me naggi

Re: [Tutor] Design suggestion - is a cookie the answer?

2006-01-17 Thread Alan Gauld
> > you are using GET instead of POST? GET is the default > > submission method but POST is nearly always better and > > should avoid the problem here. (I think, I haven't tried it!) > > I believe the python CGI module is submission-method agnostic Thats true, but to frig it you would need to kno

Re: [Tutor] __getitem__

2006-01-17 Thread Kent Johnson
Kent Johnson wrote: > Alan Gauld wrote: >>>What does 'in' have to do with indexing? >> >> >>Nothing unless its implementation uses a while loop >>and index, but thats unlikely. > > > But that is pretty close to what actually happens, according to the > language ref docs for 'in' (see my previous

Re: [Tutor] Guess Your Number Game

2006-01-17 Thread Rinzwind
On 1/17/06, Jon Moore <[EMAIL PROTECTED]> wrote: > Hi > > I hope someone can help me! > > I am currently learning Python using a book by Michael Dawson. In one of the > exercises I have to right a program that will guess a number chosen by the > user. > > It is partly working, however it does not s

Re: [Tutor] __iter__

2006-01-17 Thread Kent Johnson
Danny Yoo wrote: > > On Mon, 16 Jan 2006, Christopher Spears wrote: > > >>I'm not sure if I understand __iter__. You use it to create an object >>that iterates through itself using a next menthod ? > > > Hi Chris, > > Yes, that's one application. > > > But __iter__() doesn't necessarily ha

Re: [Tutor] __getitem__

2006-01-17 Thread Kent Johnson
Alan Gauld wrote: >>map calls, list comprehension, etc. For loops, etc. >>work by indexing a sequences from zero to a higher >>index until out-of-bounds is reached. > > > What makes you think that? > So far as I know for loops work by calling next on > an iterator until nothing gets returned

[Tutor] Guess Your Number Game

2006-01-17 Thread Jon Moore
HiI hope someone can help me!I am currently learning Python using a book by Michael Dawson. In one of the exercises I have to right a program that will guess a number chosen by the user.It is partly working, however it does not seem to keep state of numbers that should have already been ruled out a

Re: [Tutor] __iter__

2006-01-17 Thread Rinzwind
danny: my apologies for sending this to your email instead of the list!! (There I was looking at the list going: WTF DOES IT TAKE SO LONG when it hit me...). *cuts in* No I don't :-) With this: class MyListOfNumbers: def __init__(self, data): self.data = data def __iter__(self):