Re: c[:]()

2007-05-30 Thread Tijs
Warren Stringer wrote: c[:]() # i wanna > TypeError: 'tupple' object is not callable > c[:] equals c (in expressions), so c[:]() is equivalent to c() c[:][0] # huh? > a c[:][0] is c[0] is a [i() for i in c] # too long and ...huh? > a > b > [None,None] > #---

RE: c[:]()

2007-05-30 Thread Warren Stringer
Oops! guess I should have tested my rather hasty complaint about executable containers. This is nice: def a(): return 'b' def b(): print 'polly! wakey wakey' c = {} c['a'] = b c[a()]() #works! c[a()]() is a switch statement with an amorphous selector- very handy in its own right. But, using a()

Re: Usage of the __and__ method

2007-05-30 Thread attn . steven . kuo
On May 30, 10:11 pm, theju <[EMAIL PROTECTED]> wrote: > Hello all, > I've two objects (both instances of a class called Person) and I want > to use the __and__ method and print the combined attributes of the two > instances. > > To be precise, here is my code > > class Person: > def __init_

Parsing Rdf (Rewrite)

2007-05-30 Thread Brandon McGinty
Hi All, I'm trying to parse the rdf catalog at: http://www.gutenberg.org/feeds/catalog.rdf.bz2 I've put it into an _ElementTree as follows: import time import xml.etree.cElementTree as et tree = et.parse('c:/tmp/catalog2.rdf') root = tree.getroot() I would think that I could do: etexts=tree.findall

Re: Usage of the __and__ method

2007-05-30 Thread Peter Otten
theju wrote: > I've two objects (both instances of a class called Person) and I want > to use the __and__ method and print the combined attributes of the two > instances. > r = p and q > print r.print_name() > The above output in both cases is giving me a doubt if __and__ method > is over-ridabl

Re: trouble with wxPython intro

2007-05-30 Thread Anthony Irwin
Daniel Gee wrote: > I'm trying to learn WxPython with the tutorial: > http://wiki.wxpython.org/Getting_Started > > But I can't seem to get the example for events to work. I pasted the > code they had directly into an interpreter and it got a dialog to > appear and the program was able to close its

Re: is there a standard way to "install" egg-files under windows ?

2007-05-30 Thread John Nagle
Diez B. Roggisch wrote: > Stef Mientki schrieb: > >> hello, >> >> after 4 months playing around with Python, >> and I still have troubles with egg files. >> Sometimes it works, sometimes it doesn't. >> >> If I google on "python egg", I get lost of links, >> which contains huge pages of information

Re: Usage of the __and__ method

2007-05-30 Thread rishi pathak
This works perfectly well. class Person: def __init__(self,name): self.name = name def print_name(self): print self.name def __and__(self,other): print "self.name : ",self.name print "other.name : ",other.name self.name = '%s AND %s' %(self.name,other.name)

Re: New-style classes and special methods

2007-05-30 Thread Lenard Lindstrom
Raj B wrote: > > Yes, special methods populate the slots in the structures which Python > > uses to represent types. Objects/typeobject.c in the Python source > > distribution does the hard work, particularly in function type_new > > > > Thanks for that quick response. I am quite comfortable

Re: Usage of the __and__ method

2007-05-30 Thread rishi pathak
class Person: def __init__(self,name): self.name = name def print_name(self): print self.name def __and__(self,other): print "self.name : ",self.name print "other.name : ",other.name self.name = '%s AND %s' %(self.name,other.name) return self.name p = Per

Re: wxpython demo error on debian etch

2007-05-30 Thread BartlebyScrivener
On May 29, 1:09 pm, [EMAIL PROTECTED] wrote: > The newer versions of wxPython won't make your Debian crash or > anything. We run Debian at work and I've upgraded the Python to 2.4 > and the wxPython to its newest version. This has not affected the > server's stability in any way. Install like this

Usage of the __and__ method

2007-05-30 Thread theju
Hello all, I've two objects (both instances of a class called Person) and I want to use the __and__ method and print the combined attributes of the two instances. To be precise, here is my code class Person: def __init__(self,name): self.name = name def print_name(self):

matplotlib Basemap help

2007-05-30 Thread simon . murphy . nz
Hi everyone - I'm trying to move all of my MATLAB mapping scripts over to the Basemap toolbox of matplotlib. There are 2 things however that I still can't figure out: 1) When using the Mollweide projection I can't place meridian labels at all (presumably because they converge at the poles). In MAT

Re: ImageMagick Issue

2007-05-30 Thread Michael Bentley
On May 30, 2007, at 11:00 PM, Sick Monkey wrote: When I run the following command: [EMAIL PROTECTED] david.huggins]# identify -format %w '/someDIR/ images/david.huggins/100_0264.JPG' I get the following result 2304 However, when I try to set this value to a variable, ie

Re: Create a new class on the fly

2007-05-30 Thread Alex Martelli
py_genetic <[EMAIL PROTECTED]> wrote: > Is this possible or is there a better way. I need to create a new > class during runtime to be used inside a function. The class > definition and body are dependant on unknows vars at time of exec, > thus my reasoning here. > > class PosRecords(tables.IsDe

ImageMagick Issue

2007-05-30 Thread Sick Monkey
I have the following: OS = RedHat ImagMagick installed. Python v2.5 - When I run the following command: [EMAIL PROTECTED] david.huggins]# identify -format %w '/someDIR/images/david.huggins/100_0264.JPG' I get the following result 2304 However, when I try

Re: Newbie question about string(passing by ref)

2007-05-30 Thread James T. Dennis
Duncan Booth <[EMAIL PROTECTED]> wrote: > lazy <[EMAIL PROTECTED]> wrote: >> I want to pass a string by reference. I understand that strings are >> immutable, but Im not >> going to change the string in the function, just to aviod the overhead >> of copying(when pass-by-value) because the >> strin

Re: How to parse usenet urls?

2007-05-30 Thread [EMAIL PROTECTED]
> Are you aware of nntplib? > > http://docs.python.org/lib/module-nntplib.html I am, but I once I got into the article itself, I couldn't figure out how to "call" a link inside the resulting message text: import nntplib username = my username password = my password nntp_server = 'newsclip.ap.org'

Re: paste text with newlines into raw_input?

2007-05-30 Thread half . italian
On May 30, 2:04 pm, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > Using Python on Debian Etch. > > What is the best way to paste a block of text in at the command > prompt. > > I'm trying something like: > > Quote = raw_input("Paste quote here: ") > > Which works great for one line of text with a

Re: Newbie question about string(passing by ref)

2007-05-30 Thread James T. Dennis
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > Python does NOT support pass by reference. Nor does it do pass by value. > Both of those models might describe what other languages do, but they > don't describe what Python does. > Python's passing model is different from both pass by reference

trouble with wxPython intro

2007-05-30 Thread Daniel Gee
I'm trying to learn WxPython with the tutorial: http://wiki.wxpython.org/Getting_Started But I can't seem to get the example for events to work. I pasted the code they had directly into an interpreter and it got a dialog to appear and the program was able to close itself, but my own copy won't wor

Re: How to parse usenet urls?

2007-05-30 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to parse newsgroup messages, and I need to follow URLs in > this format: news://some.server. I can past them into a newsreader > with no problem, but I want to do it programatically. > > I can't figure ou

Re: calling Postgresql stored procedure

2007-05-30 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, Alchemist <[EMAIL PROTECTED]> wrote: > I am using Python 2.4 and Postgresql 8.2 database server. > > On the database I have created a stored function, example, > CREATE OR REPLACE FUNCTION calculateaverage() > > I created a new python script and would like to cal

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread Charles Sanders
Dave Hansen wrote: > > The date is about right (actually, a little early: ASR-33, 1965; C, > about 1970), but you can't program C on an ASR-33. Keywords are all > lower case, and always have been. "IF" is a syntax error... > But the Unix terminal drivers of the day for upper case only

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread Roy Smith
Dave Hansen <[EMAIL PROTECTED]> wrote: > On May 27, 3:25 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > > Ben Finney <[EMAIL PROTECTED]> wrote: > > > Is C no longer a "major" language? The long-standing convention there > > > is for lower_case_with_underscores. > > > > Which dates back to the days of

Re: paste text with newlines into raw_input?

2007-05-30 Thread Daniel Gee
#!/usr/bin/python print "paste quote:" emptycount = 0 lines = [] while emptycount < 2: t = raw_input() if len(t) == 0: emptycount +=1 else: emptycount=0 lines.append(t) lines.append("\n") quote = " ".join(lines[:-3])

Re: RDFXML Parser For "qualified Dublin Core" Database File

2007-05-30 Thread Steve Holden
Brandon McGinty wrote: > Hi, > Thanks for the info. The speed is fantastic. 58 mb in under 15 sec, just as > shown. > I did notice that in this rdf file, I can't do any sort of find or findall. > I haven't been able to find any documentation on how to search. For > instance, in perl, one can do a s

Re: RDFXML Parser For "qualified Dublin Core" Database File

2007-05-30 Thread Steve Holden
Brandon McGinty wrote: [actually he top-posted, but I have moved his comments down because he probably doesn't realise it's naughty] > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Steve Holden > Sent: Tuesday, May 29, 2007 11:30 PM > To: python-lis

THE UNIVERSAL GOD BODY

2007-05-30 Thread [EMAIL PROTECTED]
THE UNIVERSAL GOD BODY http://groups.yahoo.com/group/Multidimensionalman/ Introduction to The Universal God Body: We have now established that our bodies consist of 4 Personality Bodies and 4 Spiritual Bodies. We have also established that the life which exists in the cellular, plant, and animal ki

Re: New-style classes and special methods

2007-05-30 Thread Alex Martelli
Raj B <[EMAIL PROTECTED]> wrote: > > Yes, special methods populate the slots in the structures which > Python > > uses to represent types. Objects/typeobject.c in the Python source > > distribution does the hard work, particularly in function type_new > > > > Thanks for that quick respons

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread Frank Swarbrick
Tim Roberts wrote: > Frank Swarbrick <[EMAIL PROTECTED]> wrote: >> Then you'd really love COBOL! >> >> :-) >> >> Frank >> COBOL programmer for 10+ years > > Hey, did you hear about the object-oriented version of COBOL? They call it > "ADD ONE TO COBOL". I know you were joking, but the COBOL 2002

Re: Create a new class on the fly

2007-05-30 Thread Steven D'Aprano
On Wed, 30 May 2007 17:44:06 -0700, py_genetic wrote: > > Is this possible or is there a better way. I need to create a new > class during runtime to be used inside a function. The class > definition and body are dependant on unknows vars at time of exec, > thus my reasoning here. You might wan

Re: Examples of high-quality python code?

2007-05-30 Thread Steve Howell
--- kaens <[EMAIL PROTECTED]> wrote: > > Anyhow, I'm looking to expand my understanding of > python, and I feel > that one of the best ways to do that is looking at > other peoples code. > A lot of the built-in Python modules are implemented in pure Python. If you are using any of those so far

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread kaens
On 30 May 2007 17:28:39 -0700, Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > kaens <[EMAIL PROTECTED]> wrote: > > > >I would also recommend to stay away from any "for dummies" or "in x > >(hours/days)" books. They can be decent introductory material, but > >unless you are rea

Examples of high-quality python code?

2007-05-30 Thread kaens
Hey everyone, I'm relatively new to python - I actually picked it up to see how quickly I could start building non-trivial apps with it. Needless to say, I was quite pleased. Anyhow, I'm looking to expand my understanding of python, and I feel that one of the best ways to do that is looking at ot

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread Carl Banks
On May 26, 11:36 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > Steve, sorry for taking your thread down a rathole. I hope we can > move any further PEP-8-related discussion (if the point merits any) to > this thread. Identifiers should just allow spaces. first element.get item(selected value)

How to parse usenet urls?

2007-05-30 Thread [EMAIL PROTECTED]
I'm trying to parse newsgroup messages, and I need to follow URLs in this format: news://some.server. I can past them into a newsreader with no problem, but I want to do it programatically. I can't figure out how to follow these links - anyone have any ideas? -- http://mail.python.org/mailman/li

Create a new class on the fly

2007-05-30 Thread py_genetic
Is this possible or is there a better way. I need to create a new class during runtime to be used inside a function. The class definition and body are dependant on unknows vars at time of exec, thus my reasoning here. class PosRecords(tables.IsDescription): class A(object): self.__init__(s

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread Shane Geiger
Here are some excellent online books and tutorials to get started with: http://www.python.org/doc/tut/ http://www.ibiblio.org/obp/thinkCSpy/ http://www.python.org/topics/learn/prog.html http://www.python.org/topics/learn/non-prog.html http://docs.python.org/lib/ http://diveintopython.org/ h

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread Dave Hansen
Apologies for jumping into the thread late. On May 27, 3:25 pm, Roy Smith <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> wrote: > > Is C no longer a "major" language? The long-standing convention there > > is for lower_case_with_underscores. > > Which dates back to the days of ASR-33'

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread Aahz
In article <[EMAIL PROTECTED]>, kaens <[EMAIL PROTECTED]> wrote: > >I would also recommend to stay away from any "for dummies" or "in x >(hours/days)" books. They can be decent introductory material, but >unless you are really really new to programming, you probably wouldn't >be getting enough inf

RE: c[:]()

2007-05-30 Thread Warren Stringer
Hey Dustan, very cool! The first hit on "python is not java" turns up the dirtsimple blog, which kicked my asp -- so, to speak (reptile not server pages - mon dieu, I'm explain a pun, how wretched) ... Dirtsimple mentions shallow versus deep. Damn! First off, I love dots. They're easy to type. I

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread kaens
On 30 May 2007 11:25:22 -0700, Katie Tam <[EMAIL PROTECTED]> wrote: > I am new to this filed and begin to learn this langague. Can you tell > me the good books to start with ? > > > Katie Tam > Network administrator > http://www.linkwaves.com/main.asp > http://www.linkwaves.com > > -- > http://mail

Re: c[:]()

2007-05-30 Thread Dustan
On May 30, 5:37 pm, "Warren Stringer" <[EMAIL PROTECTED]> wrote: > Hey many thanks for the replies! > > Ah, so is seems that c[:][:][:][:][:][:][:][:][:][:][:][0]() > also work ... > > Ah well, can't have everything. Guess I was inspired by the alphabetically > adjacent message "Call for Ruby Champ

RE: c[:]()

2007-05-30 Thread Warren Stringer
Hey many thanks for the replies! Ah, so is seems that c[:][:][:][:][:][:][:][:][:][:][:][0]() also work ... Ah well, can't have everything. Guess I was inspired by the alphabetically adjacent message "Call for Ruby Champion". Would have been nice for it work - a more elegant iterator would be har

Re: replace the base class

2007-05-30 Thread Matimus
This is a rather simplistic example, but you may be able to use a mixin class to achieve what you need. The idea is that you write a class that overrides only what is needed to add the new functionality. For you it would be Color. [code] class Graph(object): def _foo(self): print "Grap

with ctypes, how to parse a multi-string

2007-05-30 Thread Eric
Hi, I am currently dealing with ctypes, interfacing with winscard libbrary (for smart card access). Several APIs (e.g. SCardListReaderGroupsW ) take a pointer to an unicode string as a parameter , which points at function return to a "sequence" of unicode strings, NULL terminated. The last strin

Re: c[:]()

2007-05-30 Thread Brian van den Broek
Warren Stringer said unto the world upon 05/30/2007 05:31 PM: > Hmmm, this is for neither programmer nor computer; this is for a user. If I > wanted to write code for the benefit for the computer, I'd still be flipping > switches on a PDP-8. ;-) > > This is inconsistent: > > why does c[:][0]() w

Re: c[:]()

2007-05-30 Thread irstas
On May 31, 12:31 am, "Warren Stringer" <[EMAIL PROTECTED]> wrote: > This is inconsistent: > > why does c[:][0]() work but c[:]() does not? > Why does c[0]() has exactly the same results as c[:][0]() ? > Moreover, c[:][0]() implies that a slice was invoked It's not inconsistent, but [:] probably do

RE: c[:]()

2007-05-30 Thread Hamilton, William
> From: Warren Stringer > Hmmm, this is for neither programmer nor computer; this is for a user. If > I > wanted to write code for the benefit for the computer, I'd still be > flipping > switches on a PDP-8. ;-) > > This is inconsistent: > > why does c[:][0]() work but c[:]() does not? > Why does

Re: Resize image NO PIL!!

2007-05-30 Thread Aahz
In article <[EMAIL PROTECTED]>, cbmeeks <[EMAIL PROTECTED]> wrote: > >My stupid host (pair.com) doesn't have PIL installed and I'm too much >of a stupid newbie to figure out how to get it to work with them >(access denied while installing it, of course). > >Also, they don't have any python interfa

Re: xmlrpclib hangs execution

2007-05-30 Thread Arno Stienen
Tijs wrote: >> Arno Stienen wrote: >>> Perhaps I should be a bit more specific. When using this code to connect >>> to a remote XML-RPC server (C++, xmlrpc++0.7 library): >>> >>>import xmlrpclib >>>server = xmlrpclib.Server("http://10.10.101.62:29500";) >>>print

RE: c[:]()

2007-05-30 Thread Warren Stringer
Hmmm, this is for neither programmer nor computer; this is for a user. If I wanted to write code for the benefit for the computer, I'd still be flipping switches on a PDP-8. ;-) This is inconsistent: why does c[:][0]() work but c[:]() does not? Why does c[0]() has exactly the same results as c[

Re: print bypasses calling write method for objects inheriting from file?

2007-05-30 Thread MisterPete
On May 31, 5:54 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Wed, 30 May 2007 04:24:30 -0300, Peter Otten <[EMAIL PROTECTED]> > > escribió: > > >>> I created an object that inherits from file and was a bit surprised to > >>> find thatprintseems to bypass the write me

Re: xmlrpclib hangs execution

2007-05-30 Thread Arno Stienen
Tijs, Thank you very much for specific comments. They are most useful, and I'll try both strategies. If the latter works out, I'll post the results back on the list. Bye, Arno. Tijs wrote: > Arno Stienen wrote: > >> Arno Stienen wrote: >>> Perhaps I should be a bit more specific. When using

Re: replace the base class

2007-05-30 Thread Larry Bates
aspineux wrote: > Hi > > I would like a kind of function able to replace the base class like > that: > > class Graph: > pass > > class Circle(Graph): > pass > > class Square(Graph): > pass > > class ColorGraph: > pass > > def Adopt(new_base_class, child_class, old_base_class):

paste text with newlines into raw_input?

2007-05-30 Thread BartlebyScrivener
Using Python on Debian Etch. What is the best way to paste a block of text in at the command prompt. I'm trying something like: Quote = raw_input("Paste quote here: ") Which works great for one line of text with a single newline. It gets stripped. Okay. Is there a way to paste in a block of te

Re: file / module / package - import problem

2007-05-30 Thread aspineux
The filename and its path is in global variable __file__ (that is different in any source file) try import os.path file=open(os.path.join(os.path.dirname(__file__), 'hauteur.yaml')) On 30 mai, 22:22, EuGeNe Van den Bulke <[EMAIL PROTECTED]> wrote: > Hi there, > > I have a "problem" which co

replace the base class

2007-05-30 Thread aspineux
Hi I would like a kind of function able to replace the base class like that: class Graph: pass class Circle(Graph): pass class Square(Graph): pass class ColorGraph: pass def Adopt(new_base_class, child_class, old_base_class): return newclass ColorCircle=Adopt(Col

file / module / package - import problem

2007-05-30 Thread EuGeNe Van den Bulke
Hi there, I have a "problem" which could be a bad design on my behalf but I am not sure so ... I have a package WMI which contains a module hauteur.py which, when imported, load data from a file located in WMI/data/. In hauteur.py I call open('data/hauteur.yaml'). test.py WMI/ hauteur.py

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread sail0r
Katie Tam wrote: > I am new to this filed and begin to learn this langague. Can you tell > me the good books to start with ? My favorite is the O'Reilly jython book. This book is specifically about the python interpreter written in java but I have always found it to be a well written explanation of

Re: speeding things up with C++

2007-05-30 Thread Jorgen Grahn
On 26 May 2007 02:19:39 -0700, bullockbefriending bard <[EMAIL PROTECTED]> wrote: ... > Essentially, I need to pass a list of 6-tuples containing only > integers to my new sadly necessary super-fast compiled language > function which i am not looking forward to writing: > > input: [(1,2,3,4,5,6),

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread John J. Lee
Steven Bethard <[EMAIL PROTECTED]> writes: > John J. Lee wrote: [...] > > Even as a native English speaker, some of these are tricky -- > > e.g. urllib has a private class named "addinfourl". "What's this > > 'fourl' we're adding in?" > > (In fact, the method adds attributes named "info" and "url"

Re: c[:]()

2007-05-30 Thread Carsten Haese
On Wed, 2007-05-30 at 11:48 -0700, Warren Stringer wrote: > I want to call every object in a tupple, like so: > > #-- > def a: print 'a' > def b: print 'b' > c = (a,b) > > >>>c[:]() # i wanna > [...] > Is there something obvious that I'm missing? Yes: Py

Re: is there a standard way to "install" egg-files under windows ?

2007-05-30 Thread Duncan Booth
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > setuptools - which you install using the ez_setup.py - will install a > script called easy_install. Under unix, this is installed in /usr/bin, > I'm not sure where it is installed under windows - go use a search. It puts easy_install.exe (and vari

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Diez B. Roggisch
Steve Holden schrieb: > Diez B. Roggisch wrote: >> Karim Ali schrieb: > [...] >> >> install cygwin bash, and use >> >> tail out.log >> > I think Diez meant > > tail -f out.log I did. Thanks. diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread 7stud
In my opinion, "Beginning Python: From Novice to Professional" is a horrible book. I constantly have to consult "Learning Python(2nd ed.) to clear up all the blunders in Beginning Python. In addition, Learning Python(2nd ed) has exercises and Beginning Python doesn't. So I would recommend "Learni

Trying to render a pie chart

2007-05-30 Thread erikcw
HI all, I'm trying to use Matplotlib to render a pie chart for a django site I'm working on. I can't figure out how to get rid of the grey background, or make the dimensions square (it's getting stretched). Here is the code: def oldchart(request): from PIL import Image as PILImage from

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread kyosohma
On May 30, 1:25 pm, Katie Tam <[EMAIL PROTECTED]> wrote: > I am new to this filed and begin to learn this langague. Can you tell > me the good books to start with ? > > Katie Tam > Network administratorhttp://www.linkwaves.com/main.asphttp://www.linkwaves.com Depends on what you like. For easy stu

Re: How can an Exception pass over an "except" clause ?

2007-05-30 Thread Nebur
> > @Tijs: I think when re-raising, the backtrace will always point to the > line where it was re-raised but not to line 1265. (Or can we re-raise > an exception so that it preserves the backtrace of the "original" > exception?) @Tijs: Because of distrusting my own text above, I've checked re- rai

Re: How can an Exception pass over an "except" clause ?

2007-05-30 Thread Gabriel Genellina
En Wed, 30 May 2007 15:30:43 -0300, Nebur <[EMAIL PROTECTED]> escribió: > @Tijs: I think when re-raising, the backtrace will always point to the > line where it was re-raised but not to line 1265. (Or can we re-raise > an exception so that it preserves the backtrace of the "original" > exception

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Steve Holden
Diez B. Roggisch wrote: > Karim Ali schrieb: [...] > > install cygwin bash, and use > > tail out.log > I think Diez meant tail -f out.log regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb htt

Re: Off Topic: What is the good book to learn Python ?

2007-05-30 Thread Joe Riopel
I am new to Python but these 2 have been great resources, so far: http://diveintopython.org/toc/index.html http://docs.python.org/tut/ -- http://mail.python.org/mailman/listinfo/python-list

c[:]()

2007-05-30 Thread Warren Stringer
I want to call every object in a tupple, like so: #-- def a: print 'a' def b: print 'b' c = (a,b) >>>c[:]() # i wanna TypeError: 'tupple' object is not callable >>>c[0]() # expected a >>>c[:][0] # huh? a >>> [i() for i in c] # too long and ...huh? a b

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Matteo
On May 30, 1:29 pm, Matteo <[EMAIL PROTECTED]> wrote: > - Write an autoflush class: > class AutoFlush: > def __init__(self, stream): > self.stream = stream > def write(self, text): > self.stream.write(text) > self.stream.flush() > > ... > flog=open('out.log','a

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Diez B. Roggisch
Karim Ali schrieb: > Hi, > > I am writing a program that will take several days to execute :) and > would like to append to a log file but be able to open that file at any > time and see the errors that have occured. > > So this is what I am doing: > > -

Re: is there a standard way to "install" egg-files under windows ?

2007-05-30 Thread Diez B. Roggisch
Stef Mientki schrieb: > hello, > > after 4 months playing around with Python, > and I still have troubles with egg files. > Sometimes it works, sometimes it doesn't. > > If I google on "python egg", I get lost of links, > which contains huge pages of information, > and I'm totally scared off. >

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Grant Edwards
On 2007-05-30, Karim Ali <[EMAIL PROTECTED]> wrote: > Hi, > > I am writing a program that will take several days to execute :) and would > like to append to a log file but be able to open that file at any time and > see the errors that have occured. > > So this is what I am doing: > > ---

Re: How can an Exception pass over an "except" clause ?

2007-05-30 Thread Nebur
> However by being *VERY* perverse, I was able to reproduce the above > error by overwriting AttributeError with some other exception class (say > SyntaxError): > AttributeError = SyntaxError > Then your code will be will produce a real AttributeError, but miss it > because (despite the spelli

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Matteo
On May 30, 1:03 pm, "Karim Ali" <[EMAIL PROTECTED]> wrote: > Hi, > > I am writing a program that will take several days to execute :) and would > like to append to a log file but be able to open that file at any time and > see the errors that have occured. > > So this is what I am doing: > > --

Off Topic: What is the good book to learn Python ?

2007-05-30 Thread Katie Tam
I am new to this filed and begin to learn this langague. Can you tell me the good books to start with ? Katie Tam Network administrator http://www.linkwaves.com/main.asp http://www.linkwaves.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python -- prolog bridge error

2007-05-30 Thread yuce
I've updated install doc for pyswip, you can have a look at: http://code.google.com/p/pyswip/wiki/INSTALL Happy hacking, Yuce -- http://mail.python.org/mailman/listinfo/python-list

is there a standard way to "install" egg-files under windows ?

2007-05-30 Thread Stef Mientki
hello, after 4 months playing around with Python, and I still have troubles with egg files. Sometimes it works, sometimes it doesn't. If I google on "python egg", I get lost of links, which contains huge pages of information, and I'm totally scared off. I've used several methods, the last one, s

Appending a log file and see progress as program executes

2007-05-30 Thread Karim Ali
Hi, I am writing a program that will take several days to execute :) and would like to append to a log file but be able to open that file at any time and see the errors that have occured. So this is what I am doing: -- flog = open('out.log', 'a') ...

Re: print bypasses calling write method for objects inheriting from file?

2007-05-30 Thread Peter Otten
Gabriel Genellina wrote: > En Wed, 30 May 2007 04:24:30 -0300, Peter Otten <[EMAIL PROTECTED]> > escribió: > >>> I created an object that inherits from file and was a bit surprised to >>> find that print seems to bypass the write method for objects >>> inheriting from file. An optimization I sup

Re: Creating a distro of python... What would you include in it?

2007-05-30 Thread yuce
re: BJörn, I think selecting a GPL license will increase the number of usable packages, since using Python license with GPL is perfectly fine as long as the whole software is licensed under GPL [I am not really sure it is a must to license the whole package under GPL] re: farksimm; I'd put (in nor

Re: Python 2.5 and WXPython demo's

2007-05-30 Thread Andrew P
On May 30, 12:24 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Andrew P wrote: > > Hello, > > > I am new (very) to Python and have just down loaded the latest version > > of Python (2.5) and WXPython (2.8). > > > For some reason I cannot get the WXPython demo to run at all. I run > > windows XP and

Re: print bypasses calling write method for objects inheriting from file?

2007-05-30 Thread Gabriel Genellina
En Wed, 30 May 2007 04:24:30 -0300, Peter Otten <[EMAIL PROTECTED]> escribió: >> I created an object that inherits from file and was a bit surprised to >> find that print seems to bypass the write method for objects >> inheriting from file. An optimization I suppose. Does this surprise >> anyo

Help with ctypes and PAM

2007-05-30 Thread [EMAIL PROTECTED]
Hello, I've been trying to write a PAM module using ctypes. In the conversation function (my_conv in the script below), you're passed in a pam_response** pointer. You're supposed to allocate an array of pam_response's and set the pointer's value to the new array. Then you fill in the array with

Re: google maps api for py?

2007-05-30 Thread Jon Crump
Kev, Geopy is pretty cool: http://exogen.case.edu/projects/geopy/ On Wed, 30 May 2007, Bell, Kevin wrote: > I see that the weapon of choice for google maps is javascript... Is > there anything for python? > > > > Kev > > -- http://mail.python.org/mailman/listinfo/python-list

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-30 Thread Szabolcs Nagy
Joe Riopel wrote: > Using camel case instead of the under_score means less typing. I am lazy. > > fooBar > foo_bar camel case makes source code extremely ugly in weird disturbing way YMMV -- http://mail.python.org/mailman/listinfo/python-list

Re: writing to a file

2007-05-30 Thread sturlamolden
On May 30, 4:53 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > However, numpy has a properly working memory mapped array class, > numpy.memmap. It seems that NumPy's memmap uses a buffer from mmap, which makes both of them defunct for large files. Damn. mmap must be fixed. -- http://mail.p

Re: Creating a distro of python... What would you include in it?

2007-05-30 Thread Shane Geiger
This is for Windows only, but since your target audience is newbies, that might be fine. Python Sumo-Distribution for Windows - Freely downloadable Python distributions for Windows with many extra packages already installed and ready for use. -- http://code.enthought.com/enthon/ BJörn Li

Re: Tkinter Listbox - Different Text colors in one listbox

2007-05-30 Thread rahulnag22
On May 30, 6:04 am, [EMAIL PROTECTED] wrote: > On May 29, 2:02 pm, [EMAIL PROTECTED] wrote: > > > Hi, > > Is it possible to havedifferentitems in alistboxindifferentcolors? Or is it > > justonecolor for all items in alistbox? > > Thanks > > Rahul > > from Tkinter import * > > root = Tk() > l = Lis

Re: Creating a distro of python... What would you include in it?

2007-05-30 Thread BJörn Lindqvist
On 30 May 2007 08:25:48 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am creating a distro of Python to be licensed as GPL am > wondering, what would anyone suggest as to 3rd party modules being put > into it (non-commercial of course!)? I know I'd put MySQLdb into it at > the very le

Re: google maps api for py?

2007-05-30 Thread Daniel Nogradi
> I see that the weapon of choice for google maps is javascript... Is > there anything for python? I wrote the following for finding the latitude/longitude of a location. You need to set the variable 'key' to the actual key you got from google. (Indentation might get mixed up on the way.) H

Re: Anyone else has seen "forrtl: error (200) ..."

2007-05-30 Thread Tijs
Alexander Eisenhuth wrote: > Hello, > > Ctrl+C is not passed to the interpreter (i guess it) while I'm executing a > script. Instead i get: > forrtl: error (200): program aborting due to control-C event > I don't know what forrtl is, but I think it is hijacking your SIGINT signal handler. Pytho

Re: How can an Exception pass over an "except" clause ?

2007-05-30 Thread Tijs
Nebur wrote: > I'm using the contract.py library, running Python 2.4.4. > > Now I'm confronted with the following exception backtrace: > (...) > File "/usr/lib/python2.4/site-packages/contract.py", line 1265, in > _check_preconditions > p = f.__assert_pre > AttributeError: 'function' objec

Re: How can an Exception pass over an "except" clause ?

2007-05-30 Thread Gary Herron
Nebur wrote: > I'm using the contract.py library, running Python 2.4.4. > > Now I'm confronted with the following exception backtrace: > (...) > File "/usr/lib/python2.4/site-packages/contract.py", line 1265, in > _check_preconditions > p = f.__assert_pre > AttributeError: 'function' object

Re: Creating a distro of python... What would you include in it?

2007-05-30 Thread Simon Hibbs
On 30 May, 16:25, [EMAIL PROTECTED] wrote: > I am creating a distro of Python to be licensed as GPL am > wondering, what would anyone suggest as to 3rd party modules being put > into it (non-commercial of course!)? I know I'd put MySQLdb into it at > the very least. Any suggestions? What you p

  1   2   >