Re: [Tutor] How to create multi disks zip file

2005-04-07 Thread Brian van den Broek
Dionysius Malle said unto the world upon 2005-04-07 21:50: Hi, I'm a newbie. My friend asked me for a help. He wanted to backup his files into multi disks zip file. Is there any possibilities for me to help him by using python? TIA, Ony Hi, I'd separate the zip and split steps. Chapter 4 of the sec

Re: [Tutor] OO newbie

2005-04-07 Thread Brian van den Broek
Brian van den Broek said unto the world upon 2005-04-08 00:00: >>> class Shy: '''My silly example''' def _shy_method(self): '''I am a shy docstring''' print "I'm a shy method" def public_method(self): '''I am a public docstring''' print "I'm a public method"

Re: [Tutor] OO newbie

2005-04-07 Thread Brian van den Broek
Jacob S. said unto the world upon 2005-04-07 21:18: 2- what are the differences between self.__DoubleUnderscore self._SimpleUnderscore Double Underscores are way cooler! Here's why. Single underscores are just subtle clues to the user of the class that you aren't specifically supposed to call tha

Re: [Tutor] What is the best book to start? - Many Thanks!

2005-04-07 Thread Dick Moores
Steve George wrote at 01:36 4/6/2005: The best book I know is Core Python by Wesley Chun. But it only covers 1.6 so quite a few things have changed since then. The first page (p. ixx?) of the Preface to my copy says "At the time of publication (2001), Python 2.0 was just released, so you will def

RE: [Tutor] str.split and quotes

2005-04-07 Thread Tony Meyer
> Wow Tony. That is so generous of you to do this experiment. > It must be a great re engine. It really wasn't much effort - just copying & pasting it all together and throwing in a few timeit statements. The timeit module is another great thing about Python :) > "Obvious" doesn't mean we can

Re: [Tutor] str.split and quotes

2005-04-07 Thread Tim Peters
[Tony Meyer] ... >> Somewhat ironically, one of the tenets of Python is "there should be one-- >> and preferably only one --obvious way to do it." (type "import this" at an [Marilyn Davis] > In this case, there is: regular expressions. :^) > > "Obvious" doesn't mean we can, necessarily, all see i

RE: [Tutor] str.split and quotes

2005-04-07 Thread Marilyn Davis
On Fri, 8 Apr 2005, Tony Meyer wrote: > > Is there a reason to prefer one over the other? Is one > > faster? I compiled my regular expression to make it quicker. > > With Python 2.4 I get these results (all imports are factored out, all give > the same result except for CSV which strips the "s)

Re: [Tutor] How to create multi disks zip file

2005-04-07 Thread Liam Clarke
Err... you probably could, but why reinvent the wheel? WinZip? On Apr 8, 2005 1:50 PM, Dionysius Malle <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm a newbie. My friend asked me for a help. He wanted to backup his files > into multi disks zip file. Is there any possibilities for

RE: [Tutor] str.split and quotes

2005-04-07 Thread Tony Meyer
> Is there a reason to prefer one over the other? Is one > faster? I compiled my regular expression to make it quicker. With Python 2.4 I get these results (all imports are factored out, all give the same result except for CSV which strips the "s) with timeit.py: Own split: 26.8668364275 Toke

[Tutor] How to create multi disks zip file

2005-04-07 Thread Dionysius Malle
Hi,   I’m a newbie. My friend asked me for a help. He wanted to backup his files into multi disks zip file. Is there any possibilities for me to help him by using python?   TIA, Ony ___ Tutor maillist - Tutor@python.org http://mail.py

Re: [Tutor] str.split and quotes

2005-04-07 Thread Danny Yoo
> > I'm not sure if this is appropriate for Marilyn's purposes though, but > > I thought I might just toss it out. *grin* > > Thank you Danny. Very interesting. Both approaches are perfect for > me. > > Is there a reason to prefer one over the other? Is one faster? I > compiled my regular expr

Re: [Tutor] OO newbie

2005-04-07 Thread Jacob S.
2- what are the differences between self.__DoubleUnderscore self._SimpleUnderscore Double Underscores are way cooler! Here's why. Single underscores are just subtle clues to the user of the class that you aren't specifically supposed to call that function of the class. IOW, its used internally bu

Re: [Tutor] str.split and quotes

2005-04-07 Thread Marilyn Davis
On Thu, 7 Apr 2005, Danny Yoo wrote: > > > On Wed, 6 Apr 2005, Kent Johnson wrote: > > > s = 'Hi "Python Tutors" please help' > > s.split() > > > > > > ['Hi', '"Python', 'Tutors"', 'please', 'help'] > > > > > > > > > I wish it would leave the stuff in quotes in tact: > > > > > > ['Hi',

Re: [Tutor] Associate functinos with Dictionary/Class Usage

2005-04-07 Thread Danny Yoo
On Thu, 7 Apr 2005, Luke Jordan wrote: > I am looking for a little clarification of how exactly this would work. > > 1. How do I associate a function to a dict key? Hi Luke, We're probably already familiar of values like numbers and strings, and how to give them names with variables: ##

Re: [Tutor] UselessPython 2.0

2005-04-07 Thread Danny Yoo
On Thu, 7 Apr 2005, Sean Steeg wrote: > So please, do this list and Python in general a favor and visit (and > support through your code) the new and (hopefully) improved > UselessPython. > > Thank you for your time. > Sean > http://www.uselesspython.com It looks great; I'll try submitting some

Re: [Tutor] regular expression question

2005-04-07 Thread Danny Yoo
> I wonder if anyone can help me with an RE. I also wonder if there is an > RE mailing list anywhere - I haven't managed to find one. Hi Debbie, I haven't found one either. There appear to be a lot of good resources here: http://dmoz.org/Computers/Programming/Languages/Regular_Expressions

Re: [Tutor] str.split and quotes

2005-04-07 Thread Danny Yoo
On Wed, 6 Apr 2005, Kent Johnson wrote: > s = 'Hi "Python Tutors" please help' > s.split() > > > > ['Hi', '"Python', 'Tutors"', 'please', 'help'] > > > > > > I wish it would leave the stuff in quotes in tact: > > > > ['Hi', '"Python Tutors"', 'please', 'help'] > > You can do this easily

[Tutor] viewing gif png ?

2005-04-07 Thread Ertl, John
I need to manipulate and view gif and png images. I have PIL installed so I can do the manipulation but PIL does not let me view the images, because I do not have xv. What is the recommended python module for viewing gif and png? Thanks for the recommendation. John Ertl __

RE: [Tutor] Talking to mssql?

2005-04-07 Thread Ryan Davis
I had the same question. The best I found is this: http://www.object-craft.com.au/projects/mssql/ but that has a lot of strong language saying "this isn't ready for use". I found it perfectly usable for simply running queries, but haven't tried to do anything more complicated with it. Not sure

[Tutor] Associate functinos with Dictionary/Class Usage

2005-04-07 Thread Luke Jordan
Hi! My questions arose from reading the "Help with Classes" email that's been on this list for the past couple of days. I'm also writing a text game, but mine is puzzle not adventure. Anyway, someone mentioned that you can key words to a dictionary to have user input run functions. I am looking

Re: [Tutor] Re: Help with classes

2005-04-07 Thread Alan Gauld
> >I don't think you're making proper use of classes. > > IMHO there is no "proper use of classes". It depends on whether the OP wants to pursue OOP. There are many uses of classes that are not related to OOP. But if we are talking about good OOP practie then there are some uses of classes that ar

Re: [Tutor] csv module not raising exception properly [SOLVED]

2005-04-07 Thread David Rock
* David Rock <[EMAIL PROTECTED]> [2005-04-07 15:00]: > * Kent Johnson <[EMAIL PROTECTED]> [2005-04-07 15:28]: > > David Rock wrote: > > >I am trying to catch an exception from the csv module but it doesn't > > >seem to be generating a proper exception because I don't seem to be able > > >to catch i

Re: [Tutor] OO newbie

2005-04-07 Thread Alan Gauld
> 1- > this exemple will also works if you replace the: > super(C,self).__init__( *args, **kw) > by > dict.__init__(self, *args, **kw) > > but I do not understand this dict.__init_... call. > Shouldn't you call the super class constructor?? super is just a convenience feature added to make Python

Re: [Tutor] Help with classes

2005-04-07 Thread Alan Gauld
> I am fooling around with classes and I was trying to create a very > small one player text adventure. I made a class called commands here > it is: OK, recall that a class represents a template from which you create (one or) many instances. Thus any class that is named in the plural usually indi

[Tutor] Talking to mssql?

2005-04-07 Thread j2
I need to talk to a MSSQL server from a python script on a Linux box... I can't seem to find anything useful. I found http://adodbapi.sourceforge.net/ but that seem to be made for Python Scripts on Windows? ___ Tutor maillist - Tutor@python.org http:/

Re: [Tutor] Re: Help with classes

2005-04-07 Thread Bob Gailer
At 12:22 PM 4/7/2005, Andrei wrote: Kevin gmail.com> writes: > I am fooling around with classes and I was trying to create a very > small one player text adventure. I made a class called commands here > it is: > class Commands: > def __init__(self): > pass > def quiting(self): > 

Re: [Tutor] csv module not raising exception properly

2005-04-07 Thread David Rock
* Kent Johnson <[EMAIL PROTECTED]> [2005-04-07 15:28]: > David Rock wrote: > >I am trying to catch an exception from the csv module but it doesn't > >seem to be generating a proper exception because I don't seem to be able > >to catch it. Here is what I am doing: > > > > > >for inputline in fileinp

[Tutor] OO newbie

2005-04-07 Thread briner
hi, Hi, I'm having some trouble to understand how to program in OO and to know what are the possibilities offered by OO programming in python. This is even more difficult when you -unfortunately- don't know any other OO languages. for example I try to improve a dict class whom you can set up a de

Re: [Tutor] csv module not raising exception properly

2005-04-07 Thread Kent Johnson
David Rock wrote: I am trying to catch an exception from the csv module but it doesn't seem to be generating a proper exception because I don't seem to be able to catch it. Here is what I am doing: for inputline in fileinput.input(args): try: input = csv.reader([inputline],

[Tutor] Re: Help with classes

2005-04-07 Thread Andrei
Kevin gmail.com> writes: > I am fooling around with classes and I was trying to create a very > small one player text adventure. I made a class called commands here > it is: > class Commands: > def __init__(self): > pass > def quiting(self): > sys.exit() > I want to beab

[Tutor] UselessPython 2.0

2005-04-07 Thread Sean Steeg
Dear Pythonistas, USELESSPYTHON (www.uselesspython.com) has finally come of age. After almost two years of hemming and hawing, we've finally put our nose to the grindstone and cranked out version 2.0 of everyone's favorite snippet site. Our next trick: fill it. That's where everyone here comes

Re: [Tutor] Help with classes

2005-04-07 Thread Kent Johnson
Kevin wrote: I am fooling around with classes and I was trying to create a very small one player text adventure. I made a class called commands here it is: class Commands: def __init__(self): pass def quiting(self): sys.exit() def look(self): print "\nNot working

[Tutor] csv module not raising exception properly

2005-04-07 Thread David Rock
I am trying to catch an exception from the csv module but it doesn't seem to be generating a proper exception because I don't seem to be able to catch it. Here is what I am doing: for inputline in fileinput.input(args): try: input = csv.reader([inputline], escapechar='\\')

Re: [Tutor] regular expression question

2005-04-07 Thread Kent Johnson
D Elliott wrote: I wonder if anyone can help me with an RE. I also wonder if there is an RE mailing list anywhere - I haven't managed to find one. I'm trying to use this regular expression to delete particular strings from a file before tokenising it. I want to delete all strings that have a fu

[Tutor] Problem installing the Pymqi module

2005-04-07 Thread Robert, Andrew
Hi Everyone, I've tried installing the pymqi Python module on Windows but no luck so far. Has anyone had any success in doing this? Any help you can provide on this would be greatly appreciated. To install the module under Python v2.4, I did the following steps: 1. Download MinGW Gcc from ht

[Tutor] Help with classes

2005-04-07 Thread Kevin
I am fooling around with classes and I was trying to create a very small one player text adventure. I made a class called commands here it is: class Commands: def __init__(self): pass def quiting(self): sys.exit() def look(self): print "\nNot working yet!\n"

Re: [Tutor] flatten

2005-04-07 Thread Bill Mill
On Apr 7, 2005 8:00 AM, C Smith <[EMAIL PROTECTED]> wrote: > After posting the suggestion about splitting a string that contained a > quoted string, I looked back at my (at least I think it's mine) flatten > routine and didn't see anything like it at ASPN. Before I would post it > there, does anyon

[Tutor] regular expression question

2005-04-07 Thread D Elliott
I wonder if anyone can help me with an RE. I also wonder if there is an RE mailing list anywhere - I haven't managed to find one. I'm trying to use this regular expression to delete particular strings from a file before tokenising it. I want to delete all strings that have a full stop (period)

[Tutor] flatten

2005-04-07 Thread C Smith
After posting the suggestion about splitting a string that contained a quoted string, I looked back at my (at least I think it’s mine) flatten routine and didn’t see anything like it at ASPN. Before I would post it there, does anyone see any problems with this non-recursive approach? I know

Re: [Tutor] using the enter key

2005-04-07 Thread Michael Lange
On Thu, 07 Apr 2005 10:06:46 +1000 "Nova Nova" <[EMAIL PROTECTED]> wrote: > def create_widgets(self): >self.a_lbl=Label(self,text="",fg="Red") >self.a_lbl.grid(row=0,column=0,columnspan=2,sticky=W) >self.inst_lbl=Label(self,text="Enter A Number

Re: [Tutor] pickle in unicode format

2005-04-07 Thread BRINER Cedric
On Tue, 2005-04-05 at 11:33 -0700, Danny Yoo wrote: > > > > I have this dictionnary : > > > > > > a={'partition': u'/export/diskH1/home_evol/ricquebo', > > > 'rsmFirstname': u'Fran\xe7ois', > > > 'rsmLastname': u'Ricquebourg', > > > 'size': u'8161222.0', > > > 'size_max': '1'} > > > > > > and