Re: [Tutor] tokenize problem on string literal?

2009-10-25 Thread C or L Smith
C or L Smith wrote: > Am I misunderstanding a tokenize parse rule or is this an error: > > ### > def tok(s): > import tokenize > from StringIO import StringIO > t = StringIO(s).readline > for ti in tokenize.generate_tokens(t): > print ti > tok("'''quote: \") > ### > N

[Tutor] tokenize problem on string literal?

2009-10-25 Thread C or L Smith
Am I misunderstanding a tokenize parse rule or is this an error: ### def tok(s): import tokenize from StringIO import StringIO t = StringIO(s).readline for ti in tokenize.generate_tokens(t): print ti tok("'''quote: \") ### produces (3, "'''quote: '''", (1, 0), (1, 13)

Re: [Tutor] A question about the self and other stuff

2009-10-25 Thread Luke Paireepinart
On Sun, Oct 25, 2009 at 10:10 PM, Luke Paireepinart wrote: > > >> 2- in the final few lines where I assign an object to the class, I notice >> that a parameter was entered in the class name, "Robot(D23)", although when >> defining the class I didn't put any arguments for it. >> > Yes you did, > __

Re: [Tutor] A question about the self and other stuff

2009-10-25 Thread Luke Paireepinart
On Sun, Oct 25, 2009 at 8:06 PM, Khalid Al-Ghamdi wrote: > Hi everybody, > So I'm new to python and have questions about the following code: > > def __init__(self, name): > '''initializes the data''' > self.name=name > print ('initializing {0}'.format(self.name)) > > dr

Re: [Tutor] request for comments regarding my function

2009-10-25 Thread Isaac
Thank you very much! You certainly gave me plenty to think and read about. I had not known about functools or collections. On Sun, Oct 25, 2009 at 7:09 AM, Rich Lovely wrote: > 2009/10/25 Isaac : >> Hello all, >> I wrote a function to organize a list of sorted objects ( django blog >> entries );

Re: [Tutor] Reading information from a text file into a list of lists (WinXP/py2.6.2)

2009-10-25 Thread Dave Angel
Katt wrote: Hello all, Currently I am working on a program that reads text from a text file. I would like it to place the information int a list and inside the information would have sublists of information. The text file looks like this: "Old Test","2009_10_20" "Current Test","2009_10_25"

Re: [Tutor] how to use lxml and win32com?

2009-10-25 Thread Alan Gauld
"elca" wrote i want to use IE.navigate function with beautifulsoup or lxml.. if anyone know about this or sample. the parsers both effectively replace the browser so you can't really use any functions of IE to modify soup or lxml. Why do you want to use navigate()? What are you trying t

[Tutor] A question about the self and other stuff

2009-10-25 Thread Khalid Al-Ghamdi
Hi everybody, So I'm new to python and have questions about the following code: class Robot: '''Represents a Robot with a name. Deletes and makes Robots for testing perpuses''' #a var for counting the number of Robots population = 0 def __init__(self, name): '''initializes t

Re: [Tutor] Reading information from a text file into a list of lists (WinXP/py2.6.2)

2009-10-25 Thread Alan Gauld
"Katt" wrote def read_important_dates(): print "\nReading text file into program: important.txt" text_file = open("important.txt", "r") dates = text_file.readlines() text_file.close() print dates # read_important_dates() When it gets to print dates I see the following: [ ' "Ol

Re: [Tutor] Reading information from a text file into a list of lists (WinXP/py2.6.2)

2009-10-25 Thread Katt
Hello all, Currently I am working on a program that reads text from a text file. I would like it to place the information int a list and inside the information would have sublists of information. The text file looks like this: "Old Test","2009_10_20" "Current Test","2009_10_25" "Future Test

[Tutor] how to use lxml and win32com?

2009-10-25 Thread elca
hello... i really want to know...i was searched in google lot of time. but can't found clear soultion. and also because of my lack of python knowledge. i want to use IE.navigate function with beautifulsoup or lxml.. if anyone know about this or sample. please help me! thanks in advance .. -- Vi

Re: [Tutor] Using IDLE v2.6

2009-10-25 Thread ALAN GAULD
> > Scipe/Notepad++ (but these may be windows only?) > > I've got Notepad++ running nicely under wine on my ubuntu install, and > SciTE (which I'm assuming is what you meant) is open source and has > versions for most platforms - it's based on the Scintilla editor Yes I meant SciTE, thanks. I

Re: [Tutor] Using IDLE v2.6

2009-10-25 Thread Rich Lovely
2009/10/24 Alan Gauld : > "Ken G." wrote >> >> IDLE v2.6 but I was wondering if there is something better than IDLE. > > There is a wealth of options and a Google search on Python IDEs will throw > many up. > > Some common recommendations: > > PyDev on Eclipse (good if you already use Eclipse for

Re: [Tutor] request for comments regarding my function

2009-10-25 Thread Rich Lovely
2009/10/25 Isaac : > Hello all, > I wrote a function to organize a list of sorted objects ( django blog > entries ); each object has a Python datetime attribute ( called > pub_date ). I am posting a message to the tutor mailing list to get > feedback regarding better ways to accomplish the same tas

Re: [Tutor] Moving a Shelf Between Linux and Mac OS X

2009-10-25 Thread Wayne
On Sat, Oct 24, 2009 at 11:38 PM, Patrick Kenny wrote: > Are shelves portable between different OSs? I would like to make the > data created on the shelf on the Mac also accessible on Linux; is there > an easy way to do this? > I confess I know nothing about shelve, but you should be able to us