Re: Python books?

2007-03-15 Thread Paul Hummer
Alex Martelli wrote: BartlebyScrivener [EMAIL PROTECTED] wrote: On Mar 14, 3:50 pm, [EMAIL PROTECTED] (Aahz) wrote: Some people prefer shorter books -- Python for Dummies (for new programmers) and Python in a Nutshell (for experienced programmers) both try to give a thorough

Re: Mocking OpenOffice in python?

2007-03-15 Thread olive
On Mar 14, 9:39 am, PaoloB [EMAIL PROTECTED] wrote: Hi everyone, Since OO is shipped with Py 2.3 only, I use Jython to drive OO through its Java API. Our app is a mix of: - ODT XML scrapping/templating based on Dom4j which, surprisingly, when use with Jython, is the most pythonic XML API I have

what are Python equivalent to MATLAB persistent or C++ static?

2007-03-15 Thread dmitrey
Thank you in advance, Dmitrey -- http://mail.python.org/mailman/listinfo/python-list

Python eggs and openSuse 10.2 errors

2007-03-15 Thread Turd Flop Down M'leg
Heyas So I got all hooked on python eggs at pycon, but then I got all hooked on openSuse 10.2 (with the xgl cube and the beryl fanciness, and some other misc debris). Unfortunately, it doesnt appear that openSuse 10.2, which is using python 2.5, wants to play nicely with python eggs. When I try

Re: design question: no new attributes

2007-03-15 Thread Harold Fellermann
Hi Alan, One last point. While I remain interested in examples of how late addition ofattributesto class instances is useful, I must note that everyone who responded agreed that it has been a source of bugs. This seems to argue against a general ban on locking objects in some way, in some

Re: Python eggs and openSuse 10.2 errors

2007-03-15 Thread Turd Flop Down M'leg
Ahh bother... After messing around with yast, I realized that I didnt have the python dev packages installed. Once I installed them with yast, I just had to create a directory 'site-packages' under /usr/local/lib/ python2.5 and it all worked fine... Bah! --

Re: Python eggs and openSuse 10.2 errors

2007-03-15 Thread Robert Kern
Turd Flop Down M'leg wrote: Heyas So I got all hooked on python eggs at pycon, but then I got all hooked on openSuse 10.2 (with the xgl cube and the beryl fanciness, and some other misc debris). Unfortunately, it doesnt appear that openSuse 10.2, which is using python 2.5, wants to play

mindSHIFT's InterScan MSS has removed attachment(s)

2007-03-15 Thread IMSS
The advanced content filter defined by mindSHIFT Technologies has removed the attachment(s) from the following message based on attachment type. Reference Information: Message sender: python-list@python.org Message recipients: [EMAIL PROTECTED] Message subject:

Re: Box plot in Python

2007-03-15 Thread James Stroud
Sebastian Bassi wrote: Hello, Is there a graphic package for Python that provides support for box plots? (see http://en.wikipedia.org/wiki/Box_plot and http://en.wikipedia.org/wiki/Image:R-speed_of_light_boxplot.png for information on box plots). I have N sets of data, each with X

Re: Constructor of object

2007-03-15 Thread inline
Thanks. But can I change returned by xml.get_widget() object type from gtk.Window to HelloWindow? -- http://mail.python.org/mailman/listinfo/python-list

Re: Attribute monitoring in a class

2007-03-15 Thread Bruno Desthuilliers
Gabriel Genellina a écrit : En Wed, 14 Mar 2007 10:01:54 -0300, Joel Andres Granados [EMAIL PROTECTED] escribió: Bruno Desthuilliers wrote: Joel Andres Granados a écrit : I'm working with code that is not of my authorship and there is a class attribute that is changes by directly

Sorry (was Re: Cteni unicode retezcu ze souboru UTF-8 s BOM?)

2007-03-15 Thread Petr Prikryl
Sorry for the mess, The message should have been sent to the Czech Python mailing list. My fault. pepr Petr Prikryl wrote... Ahoj všeci, Tak nějak prakticky poprvé se dostávám k tomu, jak přečíst unicode řetězce ze souboru, který je uložen ve formátu UTF-8 se signaturou na začátku (BOM).

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread Laurent Pointal
Paul Rubin a écrit : Laurent Pointal [EMAIL PROTECTED] writes: Both work, you may prefer xrange/iteritems for iteration on large collections, you may prefer range/items when processing of the result value explicitly need a list (ex. calculate its length) or when you are going to manipulate

Re: spawn process in a new console window

2007-03-15 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : On Mar 14, 9:56 pm, [EMAIL PROTECTED] wrote: Hello, I have a script that launches a sequence of other programs, some GUI, some console. I'd like the console programs to launch in their own console window, instead of all of them sharing the script's console. How

Re: what are Python equivalent to MATLAB persistent or C++ static?

2007-03-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], dmitrey wrote: Thank you in advance, For what? Hint: Don't hide the question in the subject line. I don't know MATLAB's `persistent` but I know that ``static`` in C++ can be used in different places with different meanings. It seems you are asking questions how to

Re: most complete xml package for Python?

2007-03-15 Thread John Machin
On Mar 15, 9:04 am, metaperl [EMAIL PROTECTED] wrote: On Mar 14, 5:34 pm, John Machin [EMAIL PROTECTED] wrote: Given keywords like Amara and Elementtree and past history, it looked to me like a troll of one kind trying to incite a troll of another kind to pop out from under the bridge and

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread bearophileHUGS
Laurent Pointal: you may prefer range/items when processing of the result value explicitly need a list (ex. calculate its length) Creating a very long list just to know the len of an iterator is barbaric, so sometimes I use this: def leniter(iterator): if hasattr(iterator, __len__):

Re: Python books?

2007-03-15 Thread André
On Mar 15, 2:38 am, [EMAIL PROTECTED] (Alex Martelli) wrote: BartlebyScrivener [EMAIL PROTECTED] wrote: On Mar 14, 3:50 pm, [EMAIL PROTECTED] (Aahz) wrote: Some people prefer shorter books -- Python for Dummies (for new programmers) and Python in a Nutshell (for experienced programmers)

Re: most complete xml package for Python?

2007-03-15 Thread Paul Boddie
On 14 Mar, 17:45, Steve Holden [EMAIL PROTECTED] wrote: Although the phrase without even checking them all out hardly lends credence to the OP's assertion of Amara's superiority, and does tend to support a hypothesis involving some ulterior motive (or would if less ingenuously done). It's an

Computer Job Vacancy

2007-03-15 Thread sumberbisnis
Computer Job Vacancy http://www.jobbankdata.com/job-computer.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: print and softspace in python

2007-03-15 Thread Bruno Desthuilliers
Phoe6 a écrit : print and softspace in python In python, whenever you use print statement Drop the '' part. It's just the default Python shell prompt. it will append a newline by default. If you don't want newline to be appended, you got use a comma at the end (print 10,) When, you have a

Re: Returning other instance from __init__

2007-03-15 Thread Paul Boddie
On 15 Mar, 06:21, [EMAIL PROTECTED] (Alex Martelli) wrote: Paulo da Silva [EMAIL PROTECTED] wrote: I would like to implement something like this: class C1: def __init__(self,xxx): if ... : self.foo = foo self.bar =

Re: Circular Class Logic

2007-03-15 Thread half . italian
Remove the line above and add this below: def initFoo(): import baz Foo.baz = baz.Baz() initFoo() I got it to work, but I had to add a check to see if the class variable had been set.. def initBaz(): import Baz Foo.baz = Baz.Baz() class Foo: baz = None def __init__(self):

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: Laurent Pointal: you may prefer range/items when processing of the result value explicitly need a list (ex. calculate its length) Creating a very long list just to know the len of an iterator is barbaric, so sometimes I use this: def leniter(iterator): if

cx_Oracle and unicode data

2007-03-15 Thread looping
Hi, I need to get data from an Oracle DB that contains unicode data (chinese text). But the chinese data that I receive is wrong (only ¿). After a look at the Oracle documentation I've found an environment variable called NLS_LANG that you could set to define what charset the DB client use and it

Re: Tools for GUI/graphics

2007-03-15 Thread [EMAIL PROTECTED]
You should take a look at matplotlib (http:// matplotlib.sourceforge.net/). It's possible to integrate the graphic display into a python application, as well as writing files and display them in a browser. Bernhard -- http://mail.python.org/mailman/listinfo/python-list

Re: spawn process in a new console window

2007-03-15 Thread eglaser
Greg, Thanks for the tip. I will check out subprocess. Eli -- http://mail.python.org/mailman/listinfo/python-list

Re: spawn process in a new console window

2007-03-15 Thread eglaser
On Mar 15, 5:12 am, Laurent Pointal [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] a écrit : On Mar 14, 9:56 pm, [EMAIL PROTECTED] wrote: Hello, I have a script that launches a sequence of other programs, some GUI, some console. I'd like the console programs to launch in their own

Re: cx_Oracle and unicode data

2007-03-15 Thread GHUM
loo ping, But it's not what I call a 'clean' solution and I suppose that it must exist another way to force the client DB to use UTF8, or another solution to get my data. I share your feeling. I asked a similiar question ~1 year ago; and: your solution is the only one. The oracle-libs get

Re: Circular Class Logic

2007-03-15 Thread Paul McGuire
On Mar 15, 7:01 am, [EMAIL PROTECTED] wrote: Remove the line above and add this below: def initFoo(): import baz Foo.baz = baz.Baz() initFoo() I got it to work, but I had to add a check to see if the class variable had been set.. def initBaz(): import Baz Foo.baz =

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread Bruno Desthuilliers
Steve Holden a écrit : [EMAIL PROTECTED] wrote: Laurent Pointal: you may prefer range/items when processing of the result value explicitly need a list (ex. calculate its length) Creating a very long list just to know the len of an iterator is barbaric, so sometimes I use this: def

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread bearophileHUGS
Steve Holden: once you know how long it is you no longer have access to the elements. Or did I miss something? Now and then I need to know how many elements there are, and not what they are, so in those situations storing them isn't necessary. Bye, bearophile --

Re: looking for a simple crypto library

2007-03-15 Thread hg
P?nar Yanarda? wrote: Hi all, I'm looking for a crypto library which can simply: - extracts a public key from a (X.509) certificate, - supports public-key algorithms. Any suggestions? With love, -- P?nar PINguAR Yanarda? http://pinguar.org pyopenssl ? --

Re: ANN: ActivePython 2.5.0.0 is now available

2007-03-15 Thread dan . shechter
On Mar 13, 9:56 pm, Trent Mick [EMAIL PROTECTED] wrote: I'm happy to announce that ActivePython 2.5.0.0 is now available for download from: http://www.activestate.com/products/activepython/ This is the first release of ActivePython for Python version 2.5. Apologies for the long delay

Re: Box plot in Python

2007-03-15 Thread Rob Clewley
Matplotlib supports boxplots in a very straightforward fashion and is reasonably documented (just google it!) I actually just submitted a patch for extra boxplot features in matplotlib, which you can find on the sourceforge patch tracker. -Rob --

wxTextCtrl - copy and paste 65, 000 characters of text into it only seems to hold 30, 003

2007-03-15 Thread abcd
I have a wxTextCtrl: wx.TextCtrl(self.myPanel, -1, , style=wx.TE_MULTILINE) I take a set of text (65,000 characters), and paste it into the text control. all looks well. Then when I click a button I print out the entered text and the length of that text. Here is what I am seeing... 1. Paste

Re: Returning other instance from __init__

2007-03-15 Thread Alex Martelli
Paul Boddie [EMAIL PROTECTED] wrote: ... class C1: def __init__(self,xxx): ... Use __new__ for such purposes, not __init__. (You need to make C1 newstyle, e.g. inherit from object, to make special method __new__ work). Call me a traditionalist, but why wouldn't a

Re: Returning other instance from __init__

2007-03-15 Thread Paulo da Silva
Alex Martelli escreveu: Paulo da Silva [EMAIL PROTECTED] wrote: ... E.g.: class C1(object): def __new__(cls, xxx): if xxx: return type.__new__(cls, xxx) else: return C1.load(xxx) @staticmethod def load(xxx): return ...whatever... def __init__(self,

Multiline code - trailing slash usage

2007-03-15 Thread abcd
When do I need to use a trailing slash to separate code over multiple lines. For example: x = hello world, this is my multiline + \ string x = {'name' : \ 'bob'} Do I need to use the \ in the above examples? When do i need to use it? --

Re: Returning other instance from __init__

2007-03-15 Thread Paul Boddie
On 15 Mar, 15:50, [EMAIL PROTECTED] (Alex Martelli) wrote: Paul Boddie [EMAIL PROTECTED] wrote: Call me a traditionalist, but why wouldn't a factory function be good enough? That depends on whether you need name C1 to refer to a class, or not. Right. If you want name C1 to be usable

Pickle Problem

2007-03-15 Thread tonyr1988
I'm a complete python n00b writing my first program (or attempting to, anyway). I'm trying to make the transition from Java, so if you could help me, it would be greatly appreciated. Here's the code I'm stuck on (It's very basic): class DemoClass: def __init__(self):

Re: Multiline code - trailing slash usage

2007-03-15 Thread Steve Holden
abcd wrote: When do I need to use a trailing slash to separate code over multiple lines. For example: x = hello world, this is my multiline + \ string x = {'name' : \ 'bob'} Do I need to use the \ in the above examples? When do i need to use it? It's only needed

Re: Multiline code - trailing slash usage

2007-03-15 Thread Larry Bates
abcd wrote: When do I need to use a trailing slash to separate code over multiple lines. For example: x = hello world, this is my multiline + \ string x = {'name' : \ 'bob'} Do I need to use the \ in the above examples? When do i need to use it? You need to use

Re: Multiline code - trailing slash usage

2007-03-15 Thread Steven Bethard
abcd wrote: When do I need to use a trailing slash to separate code over multiple lines. For example: x = hello world, this is my multiline + \ string Yes. x = {'name' : \ 'bob'} No. You don't need trailing slashes whenever there's a pair of {}, [] or () wrapping

Re: Pickle Problem

2007-03-15 Thread Mike Kent
On Mar 15, 11:13 am, tonyr1988 [EMAIL PROTECTED] wrote: if __name__=='__main__': x = DemoClass x.WriteToFile You meant to create a DemoClass instance object, but instead, you obtained a reference to the class object. You want 'x = DemoClass()' instead. You meant to call the

Re: Pickle Problem

2007-03-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], tonyr1988 wrote: if __name__=='__main__': x = DemoClass x.WriteToFile In Python classes, functions and methods are first class objects. You bind the `DemoClass` class object to the name `x`, you are *not* creating an instance of `DemoClass`. Then you access

Re: Multiline code - trailing slash usage

2007-03-15 Thread Bruno Desthuilliers
abcd a écrit : When do I need to use a trailing slash to separate code over multiple lines. For example: x = hello world, this is my multiline + \ string Here you don't need the + x = {'name' : \ 'bob'} And here you don't need the antislash Do I need to use the \ in

Re: Pickle Problem

2007-03-15 Thread Larry Bates
tonyr1988 wrote: I'm a complete python n00b writing my first program (or attempting to, anyway). I'm trying to make the transition from Java, so if you could help me, it would be greatly appreciated. Here's the code I'm stuck on (It's very basic): class DemoClass: def __init__(self):

Re: Pickle Problem

2007-03-15 Thread Jerry Hill
On 15 Mar 2007 08:13:53 -0700, tonyr1988 [EMAIL PROTECTED] wrote: if __name__=='__main__': x = DemoClass x.WriteToFile Here, you're binding the Class DemoClass to the name x. What you probably meant to do is create a new instance of DemoClass, and bind that to name x, like

Re: Multiline code - trailing slash usage

2007-03-15 Thread Christoph Haas
On Thursday 15 March 2007 15:57, abcd wrote: When do I need to use a trailing slash to separate code over multiple lines. For example: x = hello world, this is my multiline + \ string Needed. Although you can omit the +. x = {'name' : \ 'bob'} Not needed because you are

Re: Pickle Problem

2007-03-15 Thread Gary Herron
tonyr1988 wrote: I'm a complete python n00b writing my first program (or attempting to, anyway). I'm trying to make the transition from Java, so if you could help me, it would be greatly appreciated. Here's the code I'm stuck on (It's very basic): class DemoClass: def __init__(self):

Re: Multiline code - trailing slash usage

2007-03-15 Thread Duncan Booth
Steve Holden [EMAIL PROTECTED] wrote: x = hello world, this is my multiline \ string and this would have saved you a run-time string concatenation :) or use parentheses for an alternative which doesn't need the backslash: x = (hello world, this is my multiline

Re: Pickle Problem

2007-03-15 Thread Sönmez Kartal
Hi, You should write your last two lines as ... x = DemoClass() x.WriteToFile() Don't miss paranthesis again... :) Maybe there are still some mistakes too. Does dump method writes list's elements? Sönmez tonyr1988 wrote: I'm a complete python n00b writing my first program

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread Duncan Booth
[EMAIL PROTECTED] (Alex Martelli) wrote: Of course this is a little like the Heisenberg uncertainty principle if the iterator has no __len__ attribute - once you know how long it is you no longer have access to the elements. Or did I miss something? Right. However, return sum(1 for _ in

Re: looking for a simple crypto library

2007-03-15 Thread Paul Rubin
PÑnar Yanarda¿ [EMAIL PROTECTED] writes: I'm looking for a crypto library which can simply: - extracts a public key from a (X.509) certificate, - supports public-key algorithms. www.trevp.com/tlslite -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiline code - trailing slash usage

2007-03-15 Thread Ben Finney
abcd [EMAIL PROTECTED] writes: When do I need to use a trailing slash to separate code over multiple lines. For example: x = hello world, this is my multiline + \ string You can either do that, or you can use parentheses: x = ( foo + bar ) Note that you can make

Re: ANN: ActivePython 2.5.0.0 is now available

2007-03-15 Thread Trent Mick
[EMAIL PROTECTED] wrote: is ctypes supported on ActivePython for Windows x64? No. http://aspn.activestate.com/ASPN/docs/ActivePython/2.5/whatsincluded.html My understanding (from http://www.python.org/sf/1545507) is that ctypes isn't yet ported to Windows/AMD64. That may have changed

Re: what are Python equivalent to MATLAB persistent or C++ static?

2007-03-15 Thread [EMAIL PROTECTED]
Marc 'BlackJack' Rintsch wrote: In [EMAIL PROTECTED], dmitrey wrote: Thank you in advance, For what? Hint: Don't hide the question in the subject line. I don't know MATLAB's `persistent` but I know that ``static`` in C++ can be used in different places with different meanings. It seems

Re: Passing a FILE* from Python into a MinGW/SWIG module

2007-03-15 Thread Ross Ridge
John Pye [EMAIL PROTECTED] wrote: Is there an official workaround for this? Presumably I need to implement a mingw-compatible version of all the 'file' class in Python, eg I'm not familiar with SWIG, but why not pass Python's own file class? Method calls on Python's file class will be dispatched

Re: Pickle Problem

2007-03-15 Thread tonyr1988
On Mar 15, 10:38 am, Gary Herron [EMAIL PROTECTED] wrote: tonyr1988 wrote: I'm a complete python n00b writing my first program (or attempting to, anyway). I'm trying to make the transition from Java, so if you could help me, it would be greatly appreciated. Here's the code I'm stuck on

Re: Passing a FILE* from Python into a MinGW/SWIG module

2007-03-15 Thread Tommy Nordgren
On 14 mar 2007, at 11.57, John Pye wrote: Hi all I understand that I can't hope to pass a FILE* from the Windows version of Python into a SWIG module that I've built using MinGW gcc/g+ +, because apparently the FILE* structure are different and incompatible. Is there an official

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread skip
Duncan I think I'd prefer the barbaric: Duncanreturn len(list(iterator)) Duncan since at least it is guaranteed to terminate. Are you sure? There's no guarantee that an iterator will terminate: len(list(itertools.cycle(range(10 Skip --

Using wildcards with Popen in the Subprocess module

2007-03-15 Thread William Hudspeth
Hello, I am needing to pass an argument to the Popen function of the Subprocess module that includes a wildcard in the filename. It seems that Popen is not able to expand wildcards, and treats a filename that includes a wildcard as a literal. EX. var1=/path_to_files/filnames*.doc

Re: looking for a simple crypto library

2007-03-15 Thread hg
Paul Rubin wrote: tlslite cool ! -- http://mail.python.org/mailman/listinfo/python-list

Re: most complete xml package for Python?

2007-03-15 Thread Diez B. Roggisch
metaperl schrieb: On Mar 14, 5:34 pm, John Machin [EMAIL PROTECTED] wrote: Given keywords like Amara and Elementtree and past history, it looked to me like a troll of one kind trying to incite a troll of another kind to pop out from under the bridge and chew on his ankle :-) Well, I'm

Re: logging and wx.Timer

2007-03-15 Thread hg
hg wrote: Jordan wrote: On Mar 14, 1:52 am, hg [EMAIL PROTECTED] wrote: Hi, I read that logging was thread safe ... but can I use it under a GUI timer ? Thanks, hg That was barely enough information to be worthy of a reply. Need more than that. What do you mean under a gui

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], skip wrote: Are you sure? There's no guarantee that an iterator will terminate: len(list(itertools.cycle(range(10 You have infinite memory? ;-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: ActivePython 2.5.0.0 is now available

2007-03-15 Thread Thomas Heller
Trent Mick schrieb: [EMAIL PROTECTED] wrote: is ctypes supported on ActivePython for Windows x64? No. http://aspn.activestate.com/ASPN/docs/ActivePython/2.5/whatsincluded.html My understanding (from http://www.python.org/sf/1545507) is that ctypes isn't yet ported to Windows/AMD64.

Re: Box plot in Python

2007-03-15 Thread Sebastian Bassi
On 3/15/07, Rob Clewley [EMAIL PROTECTED] wrote: Matplotlib supports boxplots in a very straightforward fashion and is reasonably documented (just google it!) I actually just submitted a patch for extra boxplot features in matplotlib, which you can find on the sourceforge patch tracker. OK, I

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread bearophileHUGS
Alex Martelli: Right. However, return sum(1 for _ in iterator) may be a handier way to express the same desctructive semantics as the last 4 lines here. With the speed tests I have done my version did come out as the faster one. Bye, bearophile --

right-format of integer output as text

2007-03-15 Thread dmitrey
hi all, I need printing the following: 1 2 3 ... 9 10 ... 99 100 ... 999 1000 1001 ... how can I implement this one in the simpliest way? Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

right-format of integer output as text

2007-03-15 Thread dmitrey
hi all, I need printing the following: 1 2 3 ... 9 10 ... 99 100 ... 999 1000 1001 ... how can I implement this one in the simpliest way? Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list

Re: right-format of integer output as text

2007-03-15 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], dmitrey wrote: how can I implement this one in the simpliest way? Thank you in advance, In [45]: '%10d' % 1 Out[45]: ' 1' In [46]: '%10d' % 42 Out[46]: '42' In [47]: '%10d' % 1 Out[47]: ' 1' Ciao, Marc 'BlackJack' Rintsch --

Re: right-format of integer output as text

2007-03-15 Thread dmitrey
There are some errors occured in displaing previous message, I meant all right borders are the same, + some number of spaces before integer numbers, according to the number of digits D. -- http://mail.python.org/mailman/listinfo/python-list

Re: Circular Class Logic

2007-03-15 Thread half . italian
Just initialize Folder at module level - see below. -- Paul class Disk(Folder): def __init__(self,driveLetter): super(Disk,self).__init__(driveLetter+:/) What is going on there? Is it just explicitly calling the super's init function? How is that really different from this:

Re: right-format of integer output as text

2007-03-15 Thread dmitrey
Thank you Marc, it is exactly the same I asked for. D. -- http://mail.python.org/mailman/listinfo/python-list

os.path.isfile with *.tar.gz

2007-03-15 Thread Boudreau, Emile
Hello All, I'm new to Python and it looks like people that post here do get a good answer back so I figured I'd try my luck. I'm trying to check a directory to see if there is a file that has the name startOfString + some version number + inst.tar.gz (component-8.3.16-inst.tar.gz) The

Re: Circular Class Logic

2007-03-15 Thread Paul McGuire
On Mar 15, 1:55 pm, [EMAIL PROTECTED] wrote: class Disk(Folder): def __init__(self,driveLetter): super(Disk,self).__init__(driveLetter+:/) What is going on there? Is it just explicitly calling the super's init function? What is going on is that Disk is being initialized with

Re: Using wildcards with Popen in the Subprocess module

2007-03-15 Thread kyosohma
On Mar 15, 2:04 pm, William Hudspeth [EMAIL PROTECTED] wrote: Hello, I am needing to pass an argument to the Popen function of the Subprocess module that includes a wildcard in the filename. It seems that Popen is not able to expand wildcards, and treats a filename that includes a wildcard

Re: Using wildcards with Popen in the Subprocess module

2007-03-15 Thread Fabio FZero
You could use glob and expand the resulting list to astring manually, but you have to make sure the command accepts the command file1 file2 file3... format. FZero On Mar 15, 4:04 pm, William Hudspeth [EMAIL PROTECTED] wrote: Hello, I am needing to pass an argument to the Popen function of the

problem with str()

2007-03-15 Thread 7stud
I can't get the str() method to work in the following code(the last line produces an error): class test: class test def __init__(self): I am init func! self.num = 10 self.num2 = 20 def someFunc(self):

Re: os.path.isfile with *.tar.gz

2007-03-15 Thread Steve Holden
Boudreau, Emile wrote: Hello All, I'm new to Python and it looks like people that post here do get a good answer back so I figured I'd try my luck. I'm trying to check a directory to see if there is a file that has the name startOfString + some version number + inst.tar.gz

Re: os.path.isfile with *.tar.gz

2007-03-15 Thread Tim Golden
Boudreau, Emile wrote: Hello All, I'm new to Python and it looks like people that post here do get a good answer back so I figured I'd try my luck. I'm trying to check a directory to see if there is a file that has the name startOfString + some version number + inst.tar.gz

New Chess Module

2007-03-15 Thread shatranjchess
I'm releasing a new python chess module called shatranj. You can get it from www.employees.org/~stannous/shatranj until I move the project to sourceforge or some other place. It's a text based (bitboard) chess engine that implements an alphabeta search with iterative deepening. It also has a

Re: printing to a redirected stdout from a process that was called with 21 /dev/null

2007-03-15 Thread [EMAIL PROTECTED]
On Jan 29, 7:12 pm, Pappy [EMAIL PROTECTED] wrote: SHORT VERSION:PythonFile B changes sys.stdout to a file so all 'prints' are written to the file. Pythonfile A launchespythonfile B with os.popen(./B 2^1 dev/null ). PythonB's output disappears into never-never land. LONG VERSION: I am

Re: Importing WMI in a child Thread throws an error

2007-03-15 Thread kyosohma
On Feb 28, 3:08 pm, Tim Golden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Feb 27, 3:32 pm, Tim Golden [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: The problem I have is that since I import WMI, it takes a long time and we have users complaining about it. So I stuck the

Re: Circular Class Logic

2007-03-15 Thread Gabriel Genellina
En Thu, 15 Mar 2007 09:01:07 -0300, [EMAIL PROTECTED] escribió: I got it to work, but I had to add a check to see if the class variable had been set.. class Foo: baz = None def __init__(self): if Foo.baz == None: Foo.baz = True initBaz() This is a different approach.

Re: merits of Lisp vs Python

2007-03-15 Thread John J. Lee
Jorge Godoy [EMAIL PROTECTED] writes: [EMAIL PROTECTED] (John J. Lee) writes: John Nagle [EMAIL PROTECTED] writes: John J. Lee wrote: Graham Dumpleton [EMAIL PROTECTED] writes: On Mar 11, 12:31 pm, [EMAIL PROTECTED] (John J. Lee) wrote: Is it possible to ask mod_python to

Re: Importing WMI in a child Thread throws an error

2007-03-15 Thread Tim Golden
If you want to post some specific code examples, I'm happy to talk you through possible optimisations. TJG Sorry I didn't reply right away. Here's the straight WMI code I'm using: c = wmi.WMI() for i in c.Win32_ComputerSystem(): mem = int(i.TotalPhysicalMemory)

Re: problem with str()

2007-03-15 Thread Matimus
Don't use built-ins as variable names. Your code will work if you change this: methodList = [str for str in names if callable(getattr(obj, str))] to this: methodList = [s for s in names if callable(getattr(obj, s))] -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with str()

2007-03-15 Thread Larry Bates
7stud wrote: I can't get the str() method to work in the following code(the last line produces an error): class test: class test def __init__(self): I am init func! self.num = 10 self.num2 = 20 def

Re: problem with str()

2007-03-15 Thread kyosohma
On Mar 15, 2:49 pm, 7stud [EMAIL PROTECTED] wrote: I can't get the str() method to work in the following code(the last line produces an error): class test: class test def __init__(self): I am init func! self.num = 10

Re: problem with str()

2007-03-15 Thread Terry Reedy
7stud [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] |I can't get the str() method to work in the following code(the last | line produces an error): If you 'print str' here | methodList = [str for str in names if callable(getattr(obj, str))] and again here, you will see the

Re: problem with str()

2007-03-15 Thread 7stud
Sheesh! You would think that after looking at every inch of the code for way too many hours, at some point that would have poked me in the eye. Thanks all. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter menu toplevel or frame

2007-03-15 Thread Matimus
Please tell me is here anything that I should change. The way you have written it, master _must_ be a Toplevel object. So, maybe parent is the correct name, but it doesn't really matter. As a side note, there is no reason for this class to inherit Frame. Aside from packing and sizing the frame,

Re: dict.items() vs dict.iteritems and similar questions

2007-03-15 Thread Duncan Booth
Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: In [EMAIL PROTECTED], skip wrote: Are you sure? There's no guarantee that an iterator will terminate: len(list(itertools.cycle(range(10 You have infinite memory? ;-) Strangely, Skip's example is exactly the one I tested before

Re: New Chess Module

2007-03-15 Thread shatranjchess
On Mar 15, 4:46 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: written in Python, it's not blazingly fast...but Kasparov doesn't even look at 2k nodes per second, does he? ;-) Wow, cool. Out of curiosity how many nodes per second does it look at? depends on your

Re: most complete xml package for Python?

2007-03-15 Thread Paul Boddie
Diez B. Roggisch wrote: metaperl schrieb: Well, I'm not a troll. And I am now even less impressed with ElementTree. It does not preserve the document but reforms it in certain cases. script/script gets rewritten as script / which leads to problems when embedding Dojo Rich

Re: Using wildcards with Popen in the Subprocess module

2007-03-15 Thread William Hudspeth
Hello Mike, Thanks for responding. I need to pass multiple filenames to an executable. The filenames are similar to one another, but differ only slightly, hence the use of the wildcard. The executable works well from the command line if I pass in a wildcard filename, but Popen can't expand the

Python shell on mac os x

2007-03-15 Thread Bert Heymans
Hi! I'm using iTerm on the mac the keymapping isn't right. On Linux and Windows it's really nice to be able to hit up to get the previous command. Does anyone know a way to get the Pyhton shell to work like on other systems, I always get this when I hit the direction keys: ^[OA^[OC^[OD I've

  1   2   >