Assertion in Python

2006-10-05 Thread vmalhotra
Hi All, I want to do verification in my scripts. So for that what i am doing here are shown below: 1. Telnet to one router. 2. Configure router. 3. Configure routing. Now after doing all these i have to check showinterfaces. So i execute command show interface and saved the output in one file.

Re: Python/Tkinter crash.

2006-10-05 Thread Eric Brunel
On Wed, 04 Oct 2006 20:02:56 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Eric Brunel" <[EMAIL PROTECTED]> wrote: >> I know the problem happens sometimes on one of my Tkinter applications, >> but I never succeeded in reproducing it systematically. I've browsed the >> tcl bugs, but did

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Steve Holden
Ben Finney wrote: > Steve Holden <[EMAIL PROTECTED]> writes: > > >>And I'd prefer it if you'd drop this subject. So, if you have >>nothing new to say, kindly leave it. > > > I'm happy to, but: > > >>You appear to be prepared to go to any length short of providing >>effort to support the open

Re: Python/Tkinter crash.

2006-10-05 Thread Fredrik Lundh
Eric Brunel wrote: > AFAIK, Tkinter is not thread safe. Using some kind of lock to serialize > the calls from different threads may seem to work (I never tested it > actually), but the safest way I found to use threads with Tkinter was to > call it only from the thread where the main loop ex

Re: How can I correct an error in an old post?

2006-10-05 Thread Tim Roberts
Jorgen Grahn <[EMAIL PROTECTED]> wrote: > >On Mon, 02 Oct 2006 16:36:24 +0100, Steve Holden <[EMAIL PROTECTED]> wrote: > >> I'd appreciate it if all >> concerned would close this thread now. > >I think you are overreacting. This was a thread with three (3) postings, in >a high-volume newsgroup, wi

Re: hex sending

2006-10-05 Thread Tim Roberts
"hiroc" <[EMAIL PROTECTED]> wrote: >s.send("abc") # send test string > >I need to send hex:"10 06 00 0f 02 bc d1" instead of "abc" > >hoW? One ugly way is s.send( "\x10\x06\x00\x0f\x02\xbc\xd1" ) -- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/ma

Re: Assertion in Python

2006-10-05 Thread Gabriel Genellina
At Thursday 5/10/2006 04:09, vmalhotra wrote: Now the problem which i am facing is how to do assertion from that output. e.g output is something like this eth0 is up OSPF not enabled on this interface eth1 is up Internet Address 192.168.1.2/24, Area 0.0.0.0 Router ID 192.168.1.2, Network

Re: hex sending

2006-10-05 Thread Paul Rubin
"hiroc" <[EMAIL PROTECTED]> writes: > s.send("abc") # send test string > I need to send hex:"10 06 00 0f 02 bc d1" instead of "abc" See the binascii module: import binascii # a2b_hex stands for "ascii to binary conversion, hex format" # you must remove the spaces binary = binascii.a2

Re: Long Tkinter Menu

2006-10-05 Thread Eric Brunel
On Thu, 05 Oct 2006 02:33:54 +0200, Dustan <[EMAIL PROTECTED]> wrote: > I don't know if this is because of Tkinter (ie Tk) itself or the > Windows default way of handling things, but when I create a very long > menu (my test is shown below), the way it displays is rather sucky; the > menu stretche

Re: A Universe Set

2006-10-05 Thread Duncan Booth
Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: >> - the wildcard object, which compares equal to everything else >> - infinite xrange()s >> - the black hole function 'def f(*args): pass' >> - the identity function 'def f(x): return x' > > Any use cases for these? > I gue

Applications written in TkInter

2006-10-05 Thread Franz Steinhaeusler
Hi, I wonder, if there is a site with a collection of written TkInter programs. I did not find any summary. for pyGtk there exist for example: http://www.pygtk.org/applications.html and for wxPython: http://wiki.wxpython.org/index.cgi/wxPythonPit_Apps -- Franz Steinhaeusler -- http://mail

Re: Where is Python in the scheme of things?

2006-10-05 Thread Bruno Desthuilliers
gord wrote: > As a complete novice in the study of Python, I am asking myself where this > language is superior or better suited than others. For example, all I see in > the tutorials are lots of examples of list processing, arithmetic > calculations - all in a DOS-like environment. s/DOS-like/

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Georg Brandl
Ilias Lazaridis wrote: > Giovanni Bajo wrote: >> Hello, >> >> I just read this mail by Brett Cannon: >> http://mail.python.org/pipermail/python-dev/2006-October/069139.html >> where the "PSF infrastracture committee", after weeks of evaluation, >> recommends >> using a non open source tracker (cal

Re: Python/Tkinter crash.

2006-10-05 Thread Hendrik van Rooyen
"Russell E. Owen" <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > > >Hi, > > > >I get the following: > > > >[EMAIL PROTECTED]:~/Controller/lib> python display.py > >UpdateStringProc should not be invoked for type font > >Aborted >

Re: Python/Tkinter crash.

2006-10-05 Thread Hendrik van Rooyen
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "Eric Brunel" <[EMAIL PROTECTED]> wrote: > > > > On Wed, 04 Oct 2006 10:33:55 +0200, Hendrik van Rooyen > > <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > > I get the following: > > > > > > [EMAIL PROTECTED]:~/Controller/lib> python display.py

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Fredrik Lundh
Georg Brandl wrote: >> The python foundation suggests a non-python non-open-source bugtracking >> tool for python. > > Actually, it suggests two bugtracking tools, one of them written in > Python. the announcemant's subject line said "recommendation for a new issue tracker", though; not "we nee

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Georg Brandl
Fredrik Lundh wrote: > Georg Brandl wrote: > >>> The python foundation suggests a non-python non-open-source bugtracking >>> tool for python. >> >> Actually, it suggests two bugtracking tools, one of them written in >> Python. > > the announcemant's subject line said "recommendation for a new is

Re: Python/Tkinter crash.

2006-10-05 Thread Paul Rubin
"Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > I am not sure how to do this - once I have called the Tkinter > mainloop - that main thread is essentially event driven - and > figuring out how to get it to poll a queue for content is not > obvious - I suppose I could arrange some external wake u

Re: Access to static members from inside a method decorator?

2006-10-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > I'm developing a library at the moment that involves many classes, some > of which have "exposed" capabilities. I'm trying to design a nice > interface for both exposing those capabilities, and inspecting > instances to find out what capabilities they have. > > At the m

embedding python -- windows specify problems

2006-10-05 Thread John Pye
Hi all I have been working on some new code that embeds python in an C application. The embedding is working fine under Linux but crashing under Windows (XP) when I reach the following step. PyRun_AnyFile(f,name); If there's some python exception being thrown by the PyRun_AnyFile call, how ca

Re: Hands on Documentation for Python methods and Library

2006-10-05 Thread Richard Jones
Wijaya Edward wrote: > One can do the following with Perl > > $ perldoc -f chomp > $ perldoc -f function_name $ pydoc dir $ pydoc function_name or $ pydoc math $ pydoc module_name Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Giovanni Bajo
Martin v. Löwis wrote: >> In fact, are you absolutely positive that you need so much effort to >> maintain an existing bugtracker installation? I know for sure that >> GCC's Bugzilla installation is pretty much on its own; Daniel Berlin >> does some maintainance every once in a while (upgrading wh

Multiple calls to logging.config.fileConfig

2006-10-05 Thread Almad
Hi, our applications can have plugins as subpackages and I'd like to allow them to use their own logger as well as it's configuration. I thought that best way will be their own configuration file passed to fileConfig. However, I run into problems... 1) It seems that I cannot refer to something f

Re: embedding python -- windows specify problems

2006-10-05 Thread Fredrik Lundh
John Pye wrote: > I have been working on some new code that embeds python in an C > application. The embedding is working fine under Linux but crashing > under Windows (XP) when I reach the following step. > > PyRun_AnyFile(f,name); > > If there's some python exception being thrown by the PyRun_An

Re: embedding python -- windows specify problems

2006-10-05 Thread Fredrik Lundh
> the contents and the layout of the FILE structure isn't defined "isn't standardized", that is. -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary of list from a file

2006-10-05 Thread [EMAIL PROTECTED]
limodou wrote: > On 4 Oct 2006 13:11:15 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > limodou wrote: > > > here is my program > > > > > > d = {} > > > for line in file('test.txt'): > > > line = line.strip() > > > if line: > > > k, v = line.strip().split() > > > d.s

Re: Python/Tkinter crash.

2006-10-05 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Eric Brunel wrote: > > > AFAIK, Tkinter is not thread safe. Using some kind of lock to serialize > > the calls from different threads may seem to work (I never tested it > > actually), but the safest way I found to use threads with Tkinter was to > > cal

Re: dictionary of list from a file

2006-10-05 Thread Peter Otten
[EMAIL PROTECTED] wrote: > for line in (l.rstrip("\n") for l in file("test.txt", "rU") if l[0] != > "\n"): >    k, v = line.split() >    d.setdefault(k, []).append(v) Note that this snippet will produce the same output with or without the rstrip() method call. Peter -- http://mail.python.org/ma

Re: Where is Python in the scheme of things?

2006-10-05 Thread Andy Dingley
gord wrote: > As a complete novice in the study of Python, I am asking myself where this > language is superior or better suited than others. I use it, and see it primarily, as a Perl killer. It also does for Ruby and our infernal shell scripts. I've never considered using Python instead of VB.

Re: releasing memory to malloc

2006-10-05 Thread MrJean1
The memory manager in the latest Python release 2.5 does return freed memory to the underlying system, if possible. For more details, see the 5th bullet on this page . /Jean Brouwers [EMAIL PROTECTED] wrote: > The workaround I went with made use of

Re: Python/Tkinter crash.

2006-10-05 Thread Hendrik van Rooyen
"Paul Rubin" wrote: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > > I am not sure how to do this - once I have called the Tkinter > > mainloop - that main thread is essentially event driven - and > > figuring out how to get it to poll a queue for content is not >

Why do this?

2006-10-05 Thread Matthew Warren
Ok, not really python focused, but it feels like the people here could explain it for me :) Now, I started programming when I was 8 with BBC Basic. I never took any formal classes however, and I have never become an expert programmer. I'm an average/hobbyist programmer with quite a few languages

Re: Long Tkinter Menu

2006-10-05 Thread Dustan
Eric Brunel wrote: > On Thu, 05 Oct 2006 02:33:54 +0200, Dustan <[EMAIL PROTECTED]> wrote: > > > I don't know if this is because of Tkinter (ie Tk) itself or the > > Windows default way of handling things, but when I create a very long > > menu (my test is shown below), the way it displays is rath

Re: Why do this?

2006-10-05 Thread Hari Sekhon
Do whichever makes you happy I'd say The only real difference is coding style and the formatting options of the %s way that I can see. %s is negligibly slower in my tests, but we're talking the tiniest fraction of a second over thousands of iterations, not worth considering... -h Hari Sekhon

Re: Python/Tkinter crash.

2006-10-05 Thread Steve Holden
Hendrik van Rooyen wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > >>Eric Brunel wrote: >> >> >>>AFAIK, Tkinter is not thread safe. Using some kind of lock to serialize >>>the calls from different threads may seem to work (I never tested it >>>actually), but the safest way I found to use thr

RE: Why do this?

2006-10-05 Thread Tim Golden
[Matthew Warren] | Now, I started programming when I was 8 with BBC Basic. Hey, likewise! (Except I was 12 when it came out!) | I learned over the years to do things like the following, and I like | doing it like this because of readability, something Python seems to | focus on :- | | Print "Th

Re: Why do this?

2006-10-05 Thread Mikael Olofsson
Matthew Warren wrote: > I learned over the years to do things like the following, and I like > doing it like this because of readability, something Python seems to > focus on :- > > Print "There are "+number+" ways to skin a "+furryanimal > > But nowadays, I see things like this all over the plac

Re: Why do this?

2006-10-05 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Matthew Warren wrote: > I learned over the years to do things like the following, and I like > doing it like this because of readability, something Python seems to > focus on :- > > Print "There are "+number+" ways to skin a "+furryanimal > > But nowadays, I see things li

Re: Why do this?

2006-10-05 Thread Duncan Booth
"Matthew Warren" <[EMAIL PROTECTED]> wrote: > Print "There are "+number+" ways to skin a "+furryanimal > > But nowadays, I see things like this all over the place; > > print("There are %s ways to skin a %s" % (number, furryanimal)) > > Now I understand there can be additional formatting benefit

Testing if an object is a function

2006-10-05 Thread Claus Tondering
If I want to test if an object, x, is an integer, I can call isinstance(x, int). But what do I do if I want to test if x is a function? I can do this: if isinstance(x, type(lambda: None)): ... But it does not seem very elegant to me. Surely there is a simpler way to specify a type object

Re: Testing if an object is a function

2006-10-05 Thread Fredrik Lundh
Claus Tondering wrote: > But what do I do if I want to test if x is a function? > > I can do this: > > if isinstance(x, type(lambda: None)): ... > > But it does not seem very elegant to me. > > Surely there is a simpler way to specify a type object that is the type > of a function. if cal

Re: excepthook doesn't give exact line number

2006-10-05 Thread Hari Sekhon
I've tried the sample code you provided but it seems to just hang, it must be doing something but unfortunately it must take too long, by which time a second control-c gives an awful dual traceback message showing the original traceback and the new one from the tbiter() func. I've tried a few

RE: Why do this?

2006-10-05 Thread Matthew Warren
> > | Now, I started programming when I was 8 with BBC Basic. > > Hey, likewise! (Except I was 12 when it came out!) I think it came out before I was 8, and I started out with print and input. Not sure if that's 'real' programming - I don't think I graduated to ifs and thens and gotos and gosubs

Re: A Universe Set

2006-10-05 Thread Jorgen Grahn
On Wed, 04 Oct 2006 11:00:28 -0400, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: >> - infinite xrange()s > > itertools.count()? Oops! You're right. The itertools documentation even refers to the SML and Haskell languages. And it contains itertools.izip(), another thing on my wis

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Also, having a variable of type str called 'number' seems > perverse (and > probably error prone), so I suspect I might need something like: > And not something I would normally do, but for hastily written contrived examples I might :) >print "There are "+str(number)+" ways to skin a "

Re: Why do this?

2006-10-05 Thread Ivan Voras
Duncan Booth wrote: > print "There are"+number+"ways to skin a"+furryanimal > > or at least something equivalent to it. If I try to make the same mistake > with a format string it jumps out to me as wrong: > > "There are%sways to skin a%s" % (number, furryanimal) Related to this, formatting wi

Re: Testing if an object is a function

2006-10-05 Thread Claus Tondering
Fredrik Lundh wrote: > if callable(x): Perfect. Thank you. -- Claus Tondering -- http://mail.python.org/mailman/listinfo/python-list

Re: excepthook doesn't give exact line number

2006-10-05 Thread Hari Sekhon
Thanks for the pointer, I've now got this giving me the right line number when an exception occurs, although I still get an empty stack trace from print "Stack Trace:\n%s\n" % str(traceback.print_exc(2)) inside the excepthook. Any ideas why this is? Is there no traceback since the tracebac

Re: Why do this?

2006-10-05 Thread Maric Michaud
Le jeudi 05 octobre 2006 13:16, Ivan Voras a écrit : > print "'"+var1+"','"+var2'"+","+var3 > > the above is much more readable as > > print "'%s', '%s', %s" % (var1, var2, var3) It feels not IMO, one proof I see is that you forgot the spaces after periods in your first example, and it's even not

RE: Why do this?

2006-10-05 Thread Matthew Warren
> Duncan Booth wrote: > > > print "There are"+number+"ways to skin a"+furryanimal > > > > or at least something equivalent to it. If I try to make > the same mistake > > with a format string it jumps out to me as wrong: > > > > "There are%sways to skin a%s" % (number, furryanimal) > > Relate

Subclassing built-in classes

2006-10-05 Thread MonkeeSage
I know that python doesn't allow extending built-in objects like the str class; but you can subclass them using a class of the same name and thus shadow them to get the same general effect (albeit you have to use the explicit constructor rather than literals). class str(str): def display(self):

RE: Why do this?

2006-10-05 Thread Tim Golden
[Matthew Warren] | Blame outlook and AutoCaps. If number were a number I would write | | print "There are",number,"ways to skin a "+furryanimal You see now that strikes me as a bit mixed up. Why not simply use? print "a", number, "c", string | > altho' print is slated for replacement by a func

Re: A Universe Set

2006-10-05 Thread Jorgen Grahn
On Thu, 05 Oct 2006 00:02:51 +0200, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: > Any use cases for these? >> - the wildcard object, which compares equal to everything else Like someone else wrote, for quick-and-dirty comparisons or lists and dictionaries where I don'

Re: dictionary of list from a file

2006-10-05 Thread [EMAIL PROTECTED]
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > for line in (l.rstrip("\n") for l in file("test.txt", "rU") if l[0] != > > "\n"): > > \001\001\001k,\001v\001=\001line.split() > > \001\001\001d.setdefault(k,\001[]).append(v) > > Note that this snippet will produce the same output with or without

Re: Subclassing built-in classes

2006-10-05 Thread Steve Holden
MonkeeSage wrote: > I know that python doesn't allow extending built-in objects like the > str class; but you can subclass them using a class of the same name and > thus shadow them to get the same general effect (albeit you have to use > the explicit constructor rather than literals). > > class s

RE: Why do this?

2006-10-05 Thread Matthew Warren
> [Matthew Warren] > > | Blame outlook and AutoCaps. If number were a number I would write > | > | print "There are",number,"ways to skin a "+furryanimal > > You see now that strikes me as a bit mixed up. Why not simply use? > > print "a", number, "c", string > Habit (not always a good thing.

Asychronous execution *with* return codes?

2006-10-05 Thread utabintarbo
I hope I have not overlooked a solution already posted, but I seem to be unable to suss out a way to achieve both multiple console-less executions of a given (console) application and gathering the return code from the application. What I have found: import subprocess # gives back return code, b

Re: Subclassing built-in classes

2006-10-05 Thread MonkeeSage
Steve Holden wrote: > Unfortunately the literals are interpreted during bytecode generation, > before the compiled program is available, and your modifications to > __builtns__ haven't been made, so the answer is "no", I'm afraid. Ah! That makes sense. I guess the only way to do it would be to add

Re: Subclassing built-in classes

2006-10-05 Thread Maric Michaud
Le jeudi 05 octobre 2006 14:20, Steve Holden a écrit : > Unfortunately the literals are interpreted during bytecode generation, > before the compiled program is available, and your modifications to > __builtns__ haven't been made, so the answer is "no", I'm afraid. But what prevents to interpret l

Re: Asychronous execution *with* return codes?

2006-10-05 Thread MonkeeSage
utabintarbo wrote: > pid = subprocess.Popen([app] + lstArgs).pid Check out the poll() method and the returncode attribute: http://docs.python.org/lib/node533.html Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: embedding python -- windows specify problems

2006-10-05 Thread John Pye
Hi Fredrik, Thanks very much for that reply. Your suggestion sounds feasible, I guess. Taking what you said, and thinking about how I could avoid adding an additional intepreter step, I thought that I could try the following: pyfile = PyFile_FromString(name,"r"); if(pyfile==NULL){

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -> > Python 2.5 introduced a dictionary type with automatic > > creation of values, > > ala Perl: > > > > === > > from collections import defaultdict > > > > d = defaultdict(list) > > for line in fl: > > k, v = line.strip().split() > > d[k].append(v

RE: dictionary of list from a file

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Giovanni Bajo > Sent: 04 October 2006 15:17 > To: python-list@python.org > Subject: Re: dictionary of list from a file > > [EMAIL PROTECTED] wrote: > > > while(){ > > @info=split

Re: can't open chm files all of a sudden

2006-10-05 Thread John Salerno
Dennis Lee Bieber wrote: > On Wed, 04 Oct 2006 22:36:10 -0400, John Salerno > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> John Machin wrote: >> >>> 4. Have you done a full virus and spy-ware scan? Do you regularly >>> install Windows updates from Microsoft? >> Well, this

Re: Subclassing built-in classes

2006-10-05 Thread Steve Holden
Maric Michaud wrote: > Le jeudi 05 octobre 2006 14:20, Steve Holden a écrit : > >>Unfortunately the literals are interpreted during bytecode generation, >>before the compiled program is available, and your modifications to >>__builtns__ haven't been made, so the answer is "no", I'm afraid. > > >

Re: socket client server... simple example... not working...

2006-10-05 Thread SpreadTooThin
Jean-Paul Calderone wrote: > On 4 Oct 2006 19:31:38 -0700, SpreadTooThin <[EMAIL PROTECTED]> wrote: > >client: > > > >import socket > >s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > >s.connect(("192.168.1.101", 8080)) > >print 'Connected' > >s.send('ABCD') > > Here you didn't check the re

Re: Python to use a non open source bug tracker?

2006-10-05 Thread skip
Ben> This thread was started on the shock of realising that a non-free Ben> tool was even being *considered* for the new Python bug Ben> tracker. Those are the terms on which I've been arguing. Of course, the candidate trackers have been known for months. Messages have been posted to

How do I read Excel file in Python?

2006-10-05 Thread kath
How do I read an Excel file in Python? I have found a package to read excel file, which can be used on any platform. http://www.lexicon.net/sjmachin/xlrd.htm I installed and working on the examples, I found its printing of cell's contents in a different manner. >>> import xlrd >>> book=xlrd.open

Getting a ValueError with comtypes

2006-10-05 Thread winkatl1213
Hello, I am working with comtypes to interface Microsoft's DirectShow library. First, I found a Type Library on the internet that was created for accessing DirectShow from .NET. It seems that DirectShow only comes with IDL files and no type library. This got me started. The following line impo

Re: Asychronous execution *with* return codes?

2006-10-05 Thread utabintarbo
MonkeeSage wrote: > utabintarbo wrote: > > pid = subprocess.Popen([app] + lstArgs).pid > > Check out the poll() method and the returncode attribute: > http://docs.python.org/lib/node533.html > Thanks for the reply. If I understand your meaning, I should do something like this (given I wish to ru

Re: What value should be passed to make a function use the default argument value?

2006-10-05 Thread Antoon Pardon
On 2006-10-04, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Georg Brandl wrote: > >> This is an issue in most Python documentation: you're not told >> if the described function is implemented in C, and if it is >> keyword arg-enabled. The arguments must be given names though, >> to be able to documen

Re: socket client server... simple example... not working...

2006-10-05 Thread Jean-Paul Calderone
On 5 Oct 2006 07:01:50 -0700, SpreadTooThin <[EMAIL PROTECTED]> wrote: > [snip] > >Jean-Paul many thanks for this and your effort. >but why is it every time I try to do something with 'stock' python I >need another package? Maybe you are trying to do things that are too complex :) >By the time I'

Re: Subclassing built-in classes

2006-10-05 Thread Maric Michaud
Le jeudi 05 octobre 2006 15:52, Steve Holden a écrit : > > But what prevents to interpret literals as a call to __builtins__ objects > > and functions ? optimization ? what else ? > > > When are literals interpreted? During translation into bytecode. agreed, but what's the problem with this ? We

building strings from variables

2006-10-05 Thread Gal Diskin
Following a discussion with an associate at work about various ways to build strings from variables in python, I'd like to hear your opinions and preferred methods. The methods we discussed are: 1. some_string = "cd %s ; %s %d %s %s" % ( working_dir, ssh_cmd, some_count, some_param1, some_param2)

Oracle database export

2006-10-05 Thread Tor Erik Soenvisen
Hi, I need to export an Oracle database to a DDL-formated file. On the Web, I found a Python script that did exactly this for a MS Access database, but not one for Oracle databases. Does anyone know of such a tool or Python script. regards tores -- http://mail.python.org/mailman/listinfo/pytho

Restoring override of urllib.URLopener.open_https

2006-10-05 Thread Bakker A
Hi, the M2Crypto library overrides the urllib.URLopener.open_https method, causing a urllib.urlopen to a https: server to fail in my case. My python is not that strong, so is there a way to set urllib.URLopener.open_https back to the original code? I prefer not to modify M2Crypto. Thanks,

Re: Access to static members from inside a method decorator?

2006-10-05 Thread glen . coates . bigworld
Bruno Desthuilliers wrote: > [EMAIL PROTECTED] wrote: > > I'm developing a library at the moment that involves many classes, some > > of which have "exposed" capabilities. I'm trying to design a nice > > interface for both exposing those capabilities, and inspecting > > instances to find out what

Re: MySQLdb for Python 2.5

2006-10-05 Thread FatherAntox
Martin v. Löwis wrote: > Harold Trammel schrieb: > > Does anyone know the status of a version of MySQLdb that will work with > > Python 2.5? > > AFAICT, MySQLdb 1.2.1 builds and works just fine. > > Regards, > Martin Hi Martin, What is your setup as I am receiving a number of "Cannot open ..." e

Re: How do I read Excel file in Python?

2006-10-05 Thread John Machin
kath wrote: > How do I read an Excel file in Python? > > I have found a package to read excel file, which can be used on any > platform. Hi Sudhir, So far, so good :-) > > http://www.lexicon.net/sjmachin/xlrd.htm > I installed and working on the examples, I found its printing of cell's > content

Re: Getting a ValueError with comtypes

2006-10-05 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hello, > > I am working with comtypes to interface Microsoft's DirectShow library. Cool, another one using comtypes! > First, I found a Type Library on the internet that was created for > accessing DirectShow from .NET. It seems that DirectShow only comes > with ID

Re: Access to static members from inside a method decorator?

2006-10-05 Thread Maric Michaud
Le jeudi 05 octobre 2006 17:18, [EMAIL PROTECTED] a écrit : > I guess my solution is slightly less elegant because > it requires this ugly explicit init call outside the classes that it > actually deals with, however it is more efficient because the dir() > pass happens once on module load, instead

RE: building strings from variables

2006-10-05 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Gal Diskin > Sent: 05 October 2006 16:01 > To: python-list@python.org > Subject: building strings from variables > > Following a discussion with an associate at work about various ways to > b

Re: Asychronous execution *with* return codes?

2006-10-05 Thread Justin
If you're on a POSIX system, you could use the usual fork/exec/wait: import os for lstArgs in pileOflstArgs: pid = os.fork() if not pid: os.execv( app, lstArgs ) for i in range(len(pileOflstArgs)): pid, status = os.wait() Of couse, os.wait() will block until a child exits. Lo

Re: user modules

2006-10-05 Thread Tuomas
Cameron Walsh wrote: > Hi, > > I'm writing a python program to analyse and export volumetric data. To > make development and extension easier, and to make it more useful to the > public when it is released (LGPL), I would like to enable users to place > their own python files in a "user_extens

Re: Why do this?

2006-10-05 Thread Terry Reedy
"Matthew Warren" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I learned over the years to do things like the following, and I like > doing it like this because of readability, something Python seems to > focus on :- > > Print "There are "+number+" ways to skin a "+furryanimal In

Re: ANN: Tftpy 0.1 - Pure Python TFTP Library

2006-10-05 Thread msoulier
msoulier wrote: > Announcing new project, Tftpy, a Pure Python TFTP implementation. > > About Release 0.1: > == > > This is an initial release in the spirit of "release early, release > often". Currently the sample client works, supporting RFC 1350. The > server is not yet implement

Re: Oracle database export

2006-10-05 Thread Diez B. Roggisch
Tor Erik Soenvisen wrote: > Hi, > > I need to export an Oracle database to a DDL-formated file. On the Web, I > found a Python script that did exactly this for a MS Access database, but > not one for Oracle databases. > > Does anyone know of such a tool or Python script. Oracle is equipped with

Re: Getting a ValueError with comtypes

2006-10-05 Thread winkatl1213
Thomas, Thanks a ton for the quick response. I called GetModule('quartz.dll'), and now I can at least call IMediaControl::Run. I get another error, but that's my problem (I don't have the graph set correctly yet). You mentioned that you sometimes create a type library for creating the interface

Re: What value should be passed to make a function use the default argument value?

2006-10-05 Thread Fredrik Lundh
Antoon Pardon wrote: > The first module I looked in to check this, it wasn't true. In the Queue > Module is isn't explicitly written that maxsize is a keyword argument yet > Queue.Queue(maxsize=9) works just fine. it's not a matter whether it works fine in any given version of Python, it's a mat

Re: building strings from variables

2006-10-05 Thread Rainy
Gal Diskin wrote: > Following a discussion with an associate at work about various ways to > build strings from variables in python, I'd like to hear your opinions > and preferred methods. The methods we discussed are: > 1. some_string = "cd %s ; %s %d %s %s" % ( working_dir, ssh_cmd, > some_cou

weakSet

2006-10-05 Thread jean . philippe . mague
Hello, Has anyone ever think about a set wich references its elements weakly ? The *easy* solution would provide a WeakSet class with the following behavior: >>>s=set([a, b]) >>>ws=WeakSet([b,c]) >>>(ws&s).__class__() is WeakSet True >>>s&ws TypeError: unsupported operand type(s) for &: 'set' and

RE: Where is Python in the scheme of things?

2006-10-05 Thread Sells, Fred
Every C++ and Java programmer that I know, who have done a moderate sized project in Python (thus requiring learning it's strengths) states that they hope to never go back to C++ or Java. I cannot comment on VB programmers, since I don't speak to them ;) -- http://mail.python.org/mailman/listinfo

Re: user modules

2006-10-05 Thread Juho Schultz
Cameron Walsh wrote: > Hi, > > I'm writing a python program to analyse and export volumetric data. To > make development and extension easier, and to make it more useful to the > public when it is released (LGPL), I would like to enable users to place > their own python files in a "user_extensions

Re: How do I read Excel file in Python?

2006-10-05 Thread kath
John Machin wrote: > kath wrote: > > How do I read an Excel file in Python? > > > > I have found a package to read excel file, which can be used on any > > platform. > > Hi Sudhir, > So far, so good :-) > > > > > http://www.lexicon.net/sjmachin/xlrd.htm > > I installed and working on the examples,

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Michael Ströder
Giovanni Bajo wrote: > Martin, I am by no means understimating Daniel's work. I am just noting that > the spare-time work he did is, by definition, much much lower than the "6-10 > people" that the PSF infrastructure committee is calling for. I would like > this > statement to be officially reduce

Re: weakSet

2006-10-05 Thread Tim Peters
[EMAIL PROTECTED] > Has anyone ever think about a set wich references its elements weakly ? Yes, and there are excruciating subtleties. I only implemented as much of one as ZODB needed at the time: # A simple implementation of weak sets, supplying just enough of Python's # sets.Set interface for

Re: How do I read Excel file in Python?

2006-10-05 Thread Matimus
> the date( 8/9/2006 ) in Excel file, i am getting the value as 38938.0, > which I get when I convert date values to general format in Excel. I > want the actual date value. How do get that? 38938 appears to be the date in days since 1/1/1900. I'm sure someone can help you figure out how to conver

Re: Access to static members from inside a method decorator?

2006-10-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Bruno Desthuilliers wrote: (snip) >> class Exposing(object): >> @classmethod >> def get_exposed_methods(cls): >> try: >> exposeds = cls._exposed_methods >> except AttributeError: >> exposeds = [] >> for name in dir(cls): >> obj = geta

Re: Access to static members from inside a method decorator?

2006-10-05 Thread Bruno Desthuilliers
Maric Michaud wrote: > Le jeudi 05 octobre 2006 17:18, [EMAIL PROTECTED] a écrit : >> I guess my solution is slightly less elegant because >> it requires this ugly explicit init call outside the classes that it >> actually deals with, however it is more efficient because the dir() >> pass happens o

Re: Python to use a non open source bug tracker?

2006-10-05 Thread Fredrik Lundh
Michael Ströder wrote: > Glancing over this thread I wonder what these people are supposed to do. > Any list of requirements available? from the original announcement (linked from the first post in this thread): "In order for Roundup to be considered equivalent in terms of an overall track

  1   2   3   >