Re: Multi-threaded SSL

2006-02-17 Thread cowbertvonmoo
Thanks Alex. I hadn't noticed that example. I gave it a shot and still have the synchronization problems. While this may be because of a lack of understanding of twisted threads (again, perhaps I'm just not looking in the right places, but even the the API reference is sparse of explanation), I

Re: commenting out blocks of code

2006-02-17 Thread Atanas Banov
Neil Hodgson wrote: > Hi Steven, > > It is *easy* to detect when a line is already commented. It starts with a > > #. The ~ is superfluous. > > It is not usual to change a line from being code to being a comment > as most lines of code make no sense as English text. If you do sometimes > want

Re: RSA in python

2006-02-17 Thread Abhisek Datta
Hello, Here is some debugging output: --- pyKB-DEBUG: Connecting to http://192.168.0.2:8080/RPC2 pyKB-DEBUG: Initializing session: (sessionKey: ABCDEFGHIJKLMNO) pyKB-DEBUG: Received public key: -BEGIN RSA PUBLIC KEY- MIGJAoGBALxi3tGXlSwRgn7/Km6mTSge+5ijQgIn3GvnZOeYyOo1DkubVtTaFj26 GWtJo43

Re: Multi-threaded SSL

2006-02-17 Thread Alex Martelli
Kris Kowal <[EMAIL PROTECTED]> wrote: ... > I started with Twisted, but, having looked as far as I can see, SSL is > either not implemented, or not documented for that library. There are > hints that it's in the works, but that's all. So, I've moved on. ??? SSL is fully implemented in Twiste

Re: Scientific Computing with NumPy

2006-02-17 Thread Terry Reedy
"kpp9c" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Numeric, Numarray, & Numpy... some one stick a screwdriver in my > forehead and end the madness that Numeric has become. > For crying all night! Numpy was Numeric's nickname Given that NumPy *is* an updated version of Numeric

How many web framework for python ?

2006-02-17 Thread Bo Yang
Hello everybody , I am a student major in software engeering . I need to do something for my course . There are very good web framework for java and ruby , Is there one for python ? I want to write a web framework for python based on mod_python as my course homework , could you give some advise ?

Activestate python installation

2006-02-17 Thread mik3
hi this is a question regarding installing Activestate python whenever i try to install the latest Activestate Python on WinXP SP2, it gives me error saying "The wizard was interrupted before Activestate 2.4.2 could be completely installed. Your system has not been modified ." any ideas why thi

GDI in python>?

2006-02-17 Thread al pacino
hi, is it possible to address the 'screen pixels' using python , like analogous to older dos( functions that graphics.h provides') or win api calls for gdi. what i want is to display clusters (in differetn colours) on screen using python. thanks. -- http://mail.python.org/mailman/listinfo/pyt

Re: Difference: __iadd__ and __add__

2006-02-17 Thread Jonathan Gardner
I would like to point out that it isn't entirely obvious where to find documentation for this particular thing. I know from experience where to go, but I remember spending a long time trying to hunt this down. For reference, you may want to check out the index of the language reference manual. ht

Re: Delete a file

2006-02-17 Thread Ravi Teja
No! It's .. os.remove(filename) or os.unlink(filename) -- http://mail.python.org/mailman/listinfo/python-list

Multi-threaded SSL

2006-02-17 Thread Kris Kowal
Dear Ophidians, I'm attempting to create an SSL secured, AJAX chat server. I'm moving on the hypothesis that I'll need to hang an XMLHttpRequest response blocking on the server until a new message is ready to be dispatched. This means that my server must be able to handle many open SSL sockets in

Does Plone support distinct sets of users in subgroups?

2006-02-17 Thread wheel
I'm not sure if this is the right venue for Plone questions, if not, could someone ref me to a better one? The discussion groups on the plone site are mailing lists and I'd rather not subscribe quite yet. Does plone support distinct sets of users? That is, on a public website running plone, can

Re: Delete a file

2006-02-17 Thread Frank Potter
system.remove(filename) On 2/18/06, Sbaush <[EMAIL PROTECTED]> wrote: > Hi. > In my application i create a PNG image and i view it in a frame. > How can delete it from my python code? > Bye... > > -- > Sbaush > -- > http://mail.python.org/mailman/listinfo/python-list > > -- http://mail.python.org

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-17 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> not actively encouraged. The tutorial, which is maintained >> and updated, still describes old style classes, and the >> old division behaviour. Perhaps the tutorials needs updating. > My main point was/is: why is there not more di

Re: commenting out blocks of code

2006-02-17 Thread Neil Hodgson
Hi Steven, > I see the developers of Scite are either newbies to GUI programming, or > they operate in a world of their own. Ctrl-Q is reserved for Quit (or > Exit) in every GUI API I know of. I am the developer responsible for SciTE and the Ctrl+Q decision. Ctrl+Q is not reserved for Qui

Re: zope 3.2 and imprt errors

2006-02-17 Thread Benji York
[EMAIL PROTECTED] wrote: > I have the following error > > Python 2.4.2 (#2, Sep 30 2005, 21:19:01) > [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > from zope.app import container container.inte

Re: Komodo - Will it Lock Me In?

2006-02-17 Thread Ravi Teja
> Not sure about the "install-packages-until-you-go-blind" thing. Komodo > doesn't help you install packages into your Python implementation. Nor I think he is confusing with Visual Package Manager. Matt, in most cases, installing packages in Python is about as easy as it gets. As a newbie, you sh

Re: Komodo - Will it Lock Me In?

2006-02-17 Thread Trent Mick
[EMAIL PROTECTED] wrote] > Hi Everybody, > > If I were to use Komodo to write in Python, would it add a lot of goo to my > code such that I would not be able to switch to another IDE without having to > claw my way out of a tarpit first? Nope. Komodo adds no goo to your code (TM). TM's my name,

Re: Does python have an internal data structure with functions imported from a module?

2006-02-17 Thread Schüle Daniel
in case you are trying it in the python shell >>> def foo():return "test" ... >>> import __main__ >>> __main__.__dict__["foo"] >>> __main__.__dict__["foo"]() 'test' >>> otherwise build your own dict with string->function mapping op = { "plus" : lambda x,y:x+y, "minus" : lam

Re: commenting out blocks of code

2006-02-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul McNett <[EMAIL PROTECTED]> wrote: . . . >IMO this is a missing feature in Python. However, if the block of code >you are wanting to comment out doesn't happen to contain any >triple-quote

Re: commenting out blocks of code

2006-02-17 Thread Jean-Paul Calderone
On Sat, 18 Feb 2006 12:36:06 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > [snip] > >Commenting and uncommenting should be two different commands: the whole >point of nested comments is that it allows you to comment a block of text >which may already contain comments. Having one command do bo

Re: Difference: __iadd__ and __add__

2006-02-17 Thread tomerfiliba
__add__ is called for the + operator __iadd__ is called for the += operator if __iadd__ doesnt exist, fallbacks to __add__ you know what they say for such things: rtfm. -- http://mail.python.org/mailman/listinfo/python-list

Komodo - Will it Lock Me In?

2006-02-17 Thread Matt
Hi Everybody, If I were to use Komodo to write in Python, would it add a lot of goo to my code such that I would not be able to switch to another IDE without having to claw my way out of a tarpit first? Any other thoughts on Komodo? I am considering it because I am hoping to find a solution to

Re: commenting out blocks of code

2006-02-17 Thread Steven D'Aprano
On Fri, 17 Feb 2006 19:12:01 -0500, Peter Hansen wrote: > john peter wrote: >> is there a similar mechanism in python, other than prefixing >> the '#' character to the start of each statement i do not >> want to execute (which gets old very quickly if one needs to >> comment and uncomment several

Re: Class subscripting

2006-02-17 Thread Steven D'Aprano
On Sat, 18 Feb 2006 01:09:22 +0100, Ronny Mandal wrote: > Assume we have a class Foo, and instance called bar. > > a variable called baz1 has the value 3.0, baz2 is uninitialized Python doesn't have variables. It has names which are bound to objects. Do you mean that the name baz1 is bound to th

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-17 Thread Steven D'Aprano
On Fri, 17 Feb 2006 14:01:05 -0800, seb.haase wrote: > Thank you very much, Magnus ! > This is the answer I had been waiting for: >> A problem as I see it today, is that this behaviour is >> not actively encouraged. The tutorial, which is maintained >> and updated, still describes old style classe

Re: Scientific Computing with NumPy

2006-02-17 Thread kpp9c
Numeric, Numarray, & Numpy... some one stick a screwdriver in my forehead and end the madness that Numeric has become. Brilliant programming & an almost essential part of scientific & math hacking in python made maddeningly confusing by truly dumb naming scheme. For crying all night! Numpy was Nu

Re: Class subscripting

2006-02-17 Thread skip
Ronny> Assume we have a class Foo, and instance called bar. a variable Ronny> called baz1 has the value 3.0, baz2 is uninitialized Ronny> Is there a way of reflecting the variable with such syntax: Ronny> print bar[], where var_index is a number representing Ronny> internal

Re: Class subscripting

2006-02-17 Thread Larry Bates
Ronny Mandal wrote: > Assume we have a class Foo, and instance called bar. > > a variable called baz1 has the value 3.0, baz2 is uninitialized > > Is there a way of reflecting the variable with such syntax: > > print bar[], where var_index is a number representing > internal index. > > bar[] =

Re: Another stupid newbie question

2006-02-17 Thread Steven D'Aprano
On Fri, 17 Feb 2006 11:51:08 -0800, Byte wrote: > Great, thanks all. Now, how come > > if x == mx: print x > break > > Dosnt work? Do yourself a HUGE favour and read this before posting any more questions to comp.lang.python. Trust me, you really will thank us. http

Re: Print a PDF transparently

2006-02-17 Thread [EMAIL PROTECTED]
> > Where can I find how to send a .ps directly to the printer? > Have you seen this? http://tgolden.sc.sabren.com/python/win32_how_do_i/print.html In particular, the section on using win32print directly. Brian. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question about freeze

2006-02-17 Thread Sybren Stuvel
Martin v. Löwis enlightened us with: > No. You also need to provide static versions of all system > libraries. You can also ship the required .so files along with the program, and set LD_LIBRARY_PATH to include the directory in which you stored those files. This can be easily done by a shell scrip

Re: xml.dom.ext documentation

2006-02-17 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > I figure I must just be missing something, but I can't seem to find > good documentation for xml.dom.ext. What I'm hoping for is just a > simple list of what actually is available in that package (what > other packages get included if you import xml.dom.ext

Re: Class subscripting

2006-02-17 Thread Ian Leitch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ronny Mandal wrote: > Assume we have a class Foo, and instance called bar. > > a variable called baz1 has the value 3.0, baz2 is uninitialized > > Is there a way of reflecting the variable with such syntax: > > print bar[], where var_index is a numb

Re: Exiting os.spawnv's subroutine

2006-02-17 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "IamIan" <[EMAIL PROTECTED]> wrote: > I am using os.spawnv in Python 2.1 to do some geoprocessing in a > subroutine/process. Everything works great, except when the processing > is done the subroutine just waits for a couple minutes before closing > itself and retu

Re: commenting out blocks of code

2006-02-17 Thread Peter Hansen
john peter wrote: > is there a similar mechanism in python, other than prefixing > the '#' character to the start of each statement i do not > want to execute (which gets old very quickly if one needs to > comment and uncomment several statements a couple of > times while "playing around with code

Class subscripting

2006-02-17 Thread Ronny Mandal
Assume we have a class Foo, and instance called bar. a variable called baz1 has the value 3.0, baz2 is uninitialized Is there a way of reflecting the variable with such syntax: print bar[], where var_index is a number representing internal index. bar[] = 4.2. #Setting baz2 to 4.2 Thanks and re

Re: commenting out blocks of code

2006-02-17 Thread Paul McNett
john peter wrote: > in java, i can prevent a block of code from executing > by bracketing the block with comment indicators, as shown > below: > /* > statement1 will not execute; > statement2 will not execute; > */ > statement3 will execute > > is there a similar mechanism in python, other

Re: Checkbuttons in a Text widget

2006-02-17 Thread Lou G
For anyone who might be able to use this technique: I kept playing around and got it to work: for i in nameList: btnText = name[i] self.sv = [] cb = [] cb.append(Checkbutton(self.datalist, text=btnText, variable=self.sv[i], background='white', font=("Courier", 10))) sel

Re: HTTP & tcl

2006-02-17 Thread alf
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Fuzzyman <[EMAIL PROTECTED]> wrote: > > > >alf wrote: > >> Hi > >> > >> I would like to convert the wctpXml-1.3.py program to Tcl (line by > >> line). > >> See http://sourceforge.net/project/showfiles.php?group_id=29217 > >> This program send

Re: Pyserial never read

2006-02-17 Thread [EMAIL PROTECTED]
Hello, I'm not sure I understand precisely your question but maybe you can try a readline and a flushinput like that: import serial port= 0 # or the port where you're device is connected baudrate=9600 # or the baudrate of your device s = serial.Serial(port, baudrate) # Open the port for i in r

Re: RSA in python

2006-02-17 Thread Heikki Toivonen
Abhisek Datta wrote: > I am looking for good RSA implementations in python that can import a > public key in PEM format and encrypt a buffer using the imported > public key. I tried m2crypto, but somehow it is giving me exceptions > which I couldnt solve as of now. What you are trying to do should

Re: How to run shell commands within python

2006-02-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Donn Cave wrote: > You can replace "mv" with os.rename() if you don't > care that it will fail when the destination is on a different > filesystem. Etc. If you care than use `shutil.move()` instead. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailma

commenting out blocks of code

2006-02-17 Thread john peter
 in java, i can  prevent a block of code from executing by bracketing the block with comment indicators, as shown below: /*   statement1 will not execute;   statement2 will not execute; */   statement3 will executeis there a similar mechanism in python, other than prefixing the '#' char

Difference: __iadd__ and __add__

2006-02-17 Thread Ronny Mandal
Can someone please explain or point me to articles regarding these two methods? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Delete a file

2006-02-17 Thread Sbaush
Hi.In my application i create a PNG image and i view it in a frame.How can delete it from my python code?Bye...-- Sbaush -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Oracle Interace on Solaris

2006-02-17 Thread Kenny
Thanks... Im not sure if you would know how to solve this one, but when I ran my setup python scripts I got the error: library -lclntsh not found. In the instantclient folder the library exists... is this a matter of just copying the libraries to a different spot or just setting up the correct envi

Re: Does python have an internal data structure with functions imported from a module?

2006-02-17 Thread Larry Bates
Carl J. Van Arsdall wrote: > Alright, I attempted to post this question yesterday but I don't see it > as showing up, so I apologize in advance if this is a double post. > > Python Gurus: > > Let me elaborate a bit more on this question. Basically, I want to know > if there is some data structur

Re: python spawn new process, rout stdin/out

2006-02-17 Thread kmkz
ok solved that by using the call() method I now have a bigger problem: the executable always wants to open in its own window. how do I stop this? -- http://mail.python.org/mailman/listinfo/python-list

Re: python spawn new process, rout stdin/out

2006-02-17 Thread kmkz
How exactly do I map the main program's STDOUT (what the user sees) to the subprocess' STDOUT? In effect I want it to appear as though they just executed the program itself. -- http://mail.python.org/mailman/listinfo/python-list

Exiting os.spawnv's subroutine

2006-02-17 Thread IamIan
I am using os.spawnv in Python 2.1 to do some geoprocessing in a subroutine/process. Everything works great, except when the processing is done the subroutine just waits for a couple minutes before closing itself and returning to the main script. I have tried using sys.exit() and exit() but these a

Re: Add a month

2006-02-17 Thread Gregory Piñero
Ok, 30 minutes later, here's my best solution. http://www.answermysearches.com/index.php/how-to-add-months-to-a-date-in-python/53/ (Posted on my website to make sure tabs are kept.) Would someone mind double-checking my logic before I put this into production next Tuesday? -Greg On 2/17/06, G

Re: HTTP & tcl

2006-02-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Fuzzyman <[EMAIL PROTECTED]> wrote: > >alf wrote: >> Hi >> >> I would like to convert the wctpXml-1.3.py program to Tcl (line by >> line). >> See http://sourceforge.net/project/showfiles.php?group_id=29217 >> This program sends pages using WCTP. I know nothing about

Re: embedding python in HTML

2006-02-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, John Salerno <[EMAIL PROTECTED]> wrote: >bruno at modulix wrote: > >> You've got to understand that Python is *not* a 'ServerPage' language >> (-> php, asp, jsp etc) in itself. Your server can now run python, fine, >> but *how* ? CGI ? FastCGI ? mod_python ? other ?

xml.dom.ext documentation

2006-02-17 Thread hortitude . eyeball
I figure I must just be missing something, but I can't seem to find good documentation for xml.dom.ext. What I'm hoping for is just a simple list of what actually is available in that package (what other packages get included if you import xml.dom.ext and what functions are available). -- http:/

Re: Python 3000 deat !? Is true division ever coming ?

2006-02-17 Thread seb . haase
Thank you very much, Magnus ! This is the answer I had been waiting for: > A problem as I see it today, is that this behaviour is > not actively encouraged. The tutorial, which is maintained > and updated, still describes old style classes, and the > old division behaviour. My main point was/is:

Re: Add a month

2006-02-17 Thread Jarek Zgoda
Paul Boddie napisał(a): >>what do you expect d_new to be after the operation ? if the answer >>is date(2006,3,17), what's date(2006,1,31) plus one month? > > February 31st, of course: > > http://sql-info.de/mysql/gotchas.html#1_14 MS SQL Server documentation marks dateadd() result as non-deter

Re: Simple question about freeze

2006-02-17 Thread Martin v. Löwis
mrstephengross wrote: > I want to make sure that my native executable is entirely standalone. > That is, it should have no dynamic linking. I've read through a number > of posts on the subject, and think I get it. In order to make this > work, I need to do two things: > > (1) Recompile libpythonXX

Re: Add a month

2006-02-17 Thread Carsten Haese
On Fri, 2006-02-17 at 16:10, Gregory Piñero wrote: > Actually, no wait, that's bad. It doesn't increment the year. > > Does anyone have a simple way to code this? > > -Greg > > > On 2/17/06, Gregory Piñero <[EMAIL PROTECTED]> wrote: > > Here's how I do it: > > > > def monthify(anint): > >

Re: Does python have an internal data structure with functions imported from a module?

2006-02-17 Thread Georg Brandl
Carl J. Van Arsdall wrote: > Alright, I attempted to post this question yesterday but I don't see it > as showing up, so I apologize in advance if this is a double post. > > Python Gurus: > > Let me elaborate a bit more on this question. Basically, I want to know > if there is some data struct

Does python have an internal data structure with functions imported from a module?

2006-02-17 Thread Carl J. Van Arsdall
Alright, I attempted to post this question yesterday but I don't see it as showing up, so I apologize in advance if this is a double post. Python Gurus: Let me elaborate a bit more on this question. Basically, I want to know if there is some data structure in python that maps a string function

Re: Add a month

2006-02-17 Thread Gregory Piñero
Actually, no wait, that's bad. It doesn't increment the year. Does anyone have a simple way to code this? -Greg On 2/17/06, Gregory Piñero <[EMAIL PROTECTED]> wrote: > Here's how I do it: > > def monthify(anint): > if anint%12==0:return 12 > else:return anint%12 > > import datetime > d

Re: Add a month

2006-02-17 Thread Gregory Piñero
Here's how I do it: def monthify(anint): if anint%12==0:return 12 else:return anint%12 import datetime d=datetime.datetime.today() dplus1month=datetime.datetime(d.year,monthify(d.month+1),d.day) We need monthify because adding 1 to 12 is bad otherwise! -Greg On 17 Feb 2006 04:15:39 -08

Re: A way to discover PIDs of child processes?

2006-02-17 Thread schreckmail
Donn, Your suggestion worked perfectly. Thank you for showing me the forest from the trees :-) -- http://mail.python.org/mailman/listinfo/python-list

Click this link, scroll to the bottom, and get your own free mall!!

2006-02-17 Thread nick
http://www.telebay.com/esolutions/mall.html -- http://mail.python.org/mailman/listinfo/python-list

Click this link, scroll to the bottom, and get your own free mall!!

2006-02-17 Thread nick
http://www.telebay.com/esolutions/mall.html -- http://mail.python.org/mailman/listinfo/python-list

Click this link, scroll to the bottom, and get your own free mall!!

2006-02-17 Thread nick
http://www.telebay.com/esolutions/mall.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Databases and python

2006-02-17 Thread Rene Pijlman
Dan Stromberg: >Rene Pijlman: >> Right. My second attempt would be: a BTree with the word as key, and a >> BTree of filenames as value >Would ZODB let me do that? Yes. >I'm puzzled, because: d1={} d={} d[d1] = '' >TypeError: dict objects are unhashable This is using a dict as _ke

Re: Another stupid newbie question

2006-02-17 Thread Byte
Ahhh, Thanks -- /usr/bin/byte -- http://mail.python.org/mailman/listinfo/python-list

Re: Another stupid newbie question

2006-02-17 Thread Byte
Great, thanks all (the point of x = 2 was that i dont understand exactly what True is on while True:) -- /usr/bin/byte -- http://mail.python.org/mailman/listinfo/python-list

Re: Another stupid newbie question

2006-02-17 Thread Georg Brandl
Byte wrote: > Great, thanks all. Now, how come > > if x == mx: print x > break > > Dosnt work? If you have a suite with more than one line, you must put it on a new line. if x == mx: print x break Perhaps it would be good for you to work through the Python T

Re: ANN: Release of NumPy 0.9.5

2006-02-17 Thread vinjvinj
I read some of the earlier threads which essentially said that numpy is about 3-4 times slower then Numeric for smaller arrays. I'm assuming that applies only to operations that apply to the whole arrays. I was curious how the performance of the following operations would compare though: 1. Copyin

Re: Another stupid newbie question

2006-02-17 Thread Byte
Great, thanks all. Now, how come if x == mx: print x break Dosnt work? -- /usr/bin/byte -- http://mail.python.org/mailman/listinfo/python-list

Re: RSA in python

2006-02-17 Thread plahey
Looking at the api documentation again, it is possible that they want this: pubkey = open( 'pubkey.pem', 'rb' ).read() # binary read here? rsa = M2Crypto.RSA.load_pub_key(pubkey) Anyway, things to play with... -- http://mail.python.org/mailman/listinfo/python-list

Re: Evil, evil wxPython (and a glimmer of hope)

2006-02-17 Thread Ville Vainio
Torsten Bronger wrote: > Has Wax exceeded the critical mass so that one can be quite certain > that it will still be maintained, say, next year? (Sincere question > since I don't know.) I was a bit worried about this myself, but after browsing the source I have to say I'm not terribly so anymor

Re: Print a PDF transparently

2006-02-17 Thread bonono
Daniel Crespo wrote: > Yes, I've seen it, but that's it: another program that I have to > install, which I want to avoid. > > I'd be happy if I just do "printer.Print(file.pdf/.ps)" and walá, the > printing just starts (in 98,2000,XP... sounds like a dream), without > having another window opened.

Re: RSA in python

2006-02-17 Thread plahey
stupid question, but did you try: rsa = M2Crypto.RSA.load_pub_key( file("pubkey.pem") ) It is not clear from the documentation what they want for "file" (and because Python has no type declarations, you are left to guess...). May not work... just thought I would ask. -- http://mail.python.org/

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-17 Thread Peter Hansen
Farel wrote: > Tim, Are you saying that: > not (b in m) > is faster than: > b not in m > As Bruno tried to tell you, and I quote: """ Why don't you try by yourself ? hint : from timeit import Timer help(Timer) """ Asking "which is faster" in comp.lang.python is the least efficient

Re: A way to discover PIDs of child processes?

2006-02-17 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Now, because the command is executed in the shell, I end up with the > following process tree: > > PIDPPIDPGID WINPID TTY UIDSTIME COMMAND > 233231562332 3412 con 1012 15:34:11 > /usr/bin/pytho

Re: Apparent eval() leak for python 2.3.5

2006-02-17 Thread Benjamin Niemann
John Marshall wrote: > Hi, > > I am reposting this message from python-dev. > > Could someone please test the code below > to verify that there is indeed a problem > with eval() under python 2.3.5. I have > rebuilt python 2.3.5 under the latest debian > and under RH 7.3 (in case the problem is >

Re: ANN: Release of NumPy 0.9.5

2006-02-17 Thread Robert Kern
vinjvinj wrote: > I use Numeric extensivly and have been thinking of migrating to Numpy. > I have a couple of questions: > > 1. Will the speed of creating new arrays, copying new arrays and > slicing new arrays be similar to Numeric? Various benchmark comparisons with Numeric and numarray have b

Re: Another stupid newbie question

2006-02-17 Thread Ian Leitch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Byte wrote: > How can I make the following code: > > from random import random > > > > def stuff(a, mx): > x = 2 > while x == 2: > x = random() > if x == mx: print x > else: print 'No luck,', x > x = 2 > > S

Re: Another stupid newbie question

2006-02-17 Thread Ravi Teja
Benjamin Niemann wrote: > Byte wrote: > > > How can I make the following code: > > > > from random import random > > > > > > > > def stuff(a, mx): > > x = 2 > > while x == 2: > > x = random() > > if x == mx: print x > > else: print 'No luck,', x > > x = 2 >

Re: Another stupid newbie question

2006-02-17 Thread Benjamin Niemann
Byte wrote: > How can I make the following code: > > from random import random > > > > def stuff(a, mx): > x = 2 > while x == 2: > x = random() > if x == mx: print x > else: print 'No luck,', x > x = 2 > > Stop when x == mx? What's the intention behind

Stackless Python sprint at PyCon 2006

2006-02-17 Thread Richard Tew
There is a Stackless Python sprint planned for PyCon 2006 during the days of the 27th of February to the 2nd of March (the post-conference sprint period). The goal is to update Stackless making it more current and approachable. We are planning to port it to the latest version of Python. But anyo

Another stupid newbie question

2006-02-17 Thread Byte
How can I make the following code: from random import random def stuff(a, mx): x = 2 while x == 2: x = random() if x == mx: print x else: print 'No luck,', x x = 2 Stop when x == mx? Thanks in advance, -- /usr/bin/byte -- http://mail.python.org/mailm

Re: ANN: Release of NumPy 0.9.5

2006-02-17 Thread vinjvinj
I use Numeric extensivly and have been thinking of migrating to Numpy. I have a couple of questions: 1. Will the speed of creating new arrays, copying new arrays and slicing new arrays be similar to Numeric? 2. I have some pyrex code that uses Numeric header files. will they be compatible with nu

Re: Determing whether two ranges overlap

2006-02-17 Thread Ralf Muschall
Robin Haswell wrote: > I can think of lots of ways to do this but it's in a tight loop so I need > it to be as efficient as possible. Any help welcome :-) There are 24 possibilities of having 4 numbers in a row, and the following 6 of them describe nonempty intervals (the remaining 18 are obtaine

Re: Print a PDF transparently

2006-02-17 Thread Daniel Crespo
> Adobe has a Windows PostScript driver for free; but that still > leaves you out... It works as a "printer" but you still have to run the > normal application to print /to/ it -- and that is what you say you > don't want! http://www.adobe.com/support/downloads/detail.jsp?ftpID=1500 Yes, I've seen

Re: Terminating a function

2006-02-17 Thread Ian Leitch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Astan Chee wrote: > I was thinking of threads but I just simply want to terminate a (global) > function after it has been running for more than 5 minutes regardless of > state. > I was assuming I needed threads because it can calculate time elapsed > (

Re: Terminating a function

2006-02-17 Thread [EMAIL PROTECTED]
This might be all you need: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473878 -- http://mail.python.org/mailman/listinfo/python-list

Re: Databases and python

2006-02-17 Thread Dan Stromberg
On Fri, 17 Feb 2006 12:32:52 +0100, Rene Pijlman wrote: > Dan Stromberg: >>> My first attempt would be: a BTree with the word as key, and a 'list of >>> filenames' as value. >>> http://www.zope.org/Wikis/ZODB/FrontPage/guide/node6.html#SECTION00063 >> >>This is basically what I'm d

Apparent eval() leak for python 2.3.5

2006-02-17 Thread John Marshall
Hi, I am reposting this message from python-dev. Could someone please test the code below to verify that there is indeed a problem with eval() under python 2.3.5. I have rebuilt python 2.3.5 under the latest debian and under RH 7.3 (in case the problem is in system libraries). The following code

Re: Print a PDF transparently

2006-02-17 Thread EShames
On 2/17/2006 9:02 AM, Daniel Crespo wrote: > Hi to all, > > I want to print a PDF right from my python app transparently. With > "transparently" I mean that no matter what program handles the print > petition, the user shouldn't be noticed about it. > > For example, when I want to print a PDF,

Re: Print a PDF transparently

2006-02-17 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> Based on all this, I have been investigating about postscript files. I >> realize that printers do handle this language, so I think if I have a >> .ps file and send it directly to the printer, it should do the job, >> ri

How to refer to current Interpreter in script?

2006-02-17 Thread larrydu
Hi, Please excuse me if this is a dumb question, but I am new to python/jython and can't figure this out. Basically I have a java class myClass with a static method myMethod that takes a PythonInterpreter as a parameter. Now I write a jython script in which I try to invoke that method with curren

A way to discover PIDs of child processes?

2006-02-17 Thread schreckmail
Hi all! I'm launching a subprocess using the following code, and I'd like to kill off all associated subprocesses after a given timeout: myproc = popen2.Popen3(command) Now, because the command is executed in the shell, I end up with the following process tree: PIDPPIDPGID WIN

Re: Win32_Process.Create -- not starting process

2006-02-17 Thread EShames
On 2/14/2006 11:25 AM, abcd wrote: > I am using Python to create a process on another computer. Both > computers are on the same domain with admin privileges. > > On computer B I have a batch script which starts a python script. From > computer A I am doing the following: > > import wmi > w = w

Another simple freeze question

2006-02-17 Thread mrstephengross
Is there a user manual for freeze.py? --Steve ([EMAIL PROTECTED]) -- http://mail.python.org/mailman/listinfo/python-list

Profiling/performance monitoring in win32

2006-02-17 Thread Russell Warren
The application we're working on at my company currently has about eleventy billion independent python applications/process running and talking to each other on a win32 platform. When problems crop up and we have to drill down to figure out who is to blame and how, we currently are using the (surp

  1   2   3   >