py2exe with python 2.5

2007-08-10 Thread vedrandekovic
Hello, Now,I was install python 2.5 and remove python 2.4 completely.After I write: $ python mysetup.py py2exe ... import py2exe_ util ImportError: Module use of conflicts with this version of Python ...ok, I know what is a problem, I haven't remove python completely, in my computer is o

is there anybody using __del__ correctly??

2007-08-10 Thread Michele Simionato
The title is provocative, of course ;) However, I was browsing through our codebase here at work and I noticed a few usages of __del__ as a resource finalizer (i.e. __del__ just calls a close method). I consider this practice an error, since with __del__ you are never sure that the resource will

Re: The Future of Python Threading

2007-08-10 Thread Jean-Paul Calderone
On Fri, 10 Aug 2007 10:01:51 -, "Justin T." <[EMAIL PROTECTED]> wrote: >Hello, > >While I don't pretend to be an authority on the subject, a few days of >research has lead me to believe that a discussion needs to be started >(or continued) on the state and direction of multi-threading python. >

Re: The Future of Python Threading

2007-08-10 Thread Chris Mellon
On 8/10/07, Ben Sizer <[EMAIL PROTECTED]> wrote: > On 10 Aug, 15:38, Ben Finney <[EMAIL PROTECTED]> > wrote: > > "Justin T." <[EMAIL PROTECTED]> writes: > > > The truth is that the future (and present reality) of almost every > > > form of computing is multi-core, and there currently is no effectiv

Re: The Future of Python Threading

2007-08-10 Thread brad
Justin T. wrote: > Hello, > > While I don't pretend to be an authority on the subject, a few days of > research has lead me to believe that a discussion needs to be started > (or continued) on the state and direction of multi-threading python. This is all anecdotal... threads in Python work great

building a rather simple server in python

2007-08-10 Thread boazin
Hi all, I was trying to build a rather simple server (with a twist) using asyncore and got myself complicated. Well, here's the deal: My server will handle multiple connections, some require reply, and some not (they will disconnect by themselves) all the clients want to to deliver binary data to

cookielib

2007-08-10 Thread Boris Ozegovic
Hi I have HTTP client which accepts cookies. If client allready has cookie, but that cookie has expired, server sends him new cookie, and in response object Set-Cookie: header everything is fine, but if I reload request, client sends expired cookie, and not the new one. In cookiejar there is onl

Re: is there anybody using __del__ correctly??

2007-08-10 Thread Steven Bethard
Raymond Hettinger wrote: > [Michele Simionato] >> Here and there I hear rumors about deprecating __del__ and >> nothing >> happens, are there any news about that? Expecially concerning Py3k? > > I was writing a Py3K PEP advocating the elimination of __del__ > because: > > * 'with closing()' and

Re: The Future of Python Threading

2007-08-10 Thread Jean-Paul Calderone
On Fri, 10 Aug 2007 16:37:19 -, "Justin T." <[EMAIL PROTECTED]> wrote: >On Aug 10, 3:52 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> On Fri, 10 Aug 2007 10:01:51 -, "Justin T." <[EMAIL PROTECTED]> wrote: >> >Hello, >> >> >While I don't pretend to be an authority on the subject, a f

Re: The Future of Python Threading

2007-08-10 Thread Justin T.
On Aug 10, 3:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Justin T. wrote: > > Hello, > > > While I don't pretend to be an authority on the subject, a few days of > > research has lead me to believe that a discussion needs to be started > > (or continued) on the state and direction of multi-thr

building a rather simple server in python

2007-08-10 Thread boazin
Hi all, I was trying to build a rather simple server (with a twist) using asyncore and got myself complicated. Well, here's the deal: My server will handle multiple connections, some require reply, and some not (they will disconnect by themselves) all the clients want to to deliver binary data to

Leo 4.4.4 beta 1 released

2007-08-10 Thread Edward K Ream
Leo 4.4.4 beta is available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.4.4: - A thre

Re: The Future of Python Threading

2007-08-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > >This would of course make C extensions more complicated... It's even worse than that. One of the goals for Python is to make it easy to call into random libraries, and there are still plenty around that aren't thread-s

Re: Ipc mechanisms and designs.

2007-08-10 Thread Alex Martelli
king kikapu <[EMAIL PROTECTED]> wrote: > Hi, > > inspired of the topic "The Future of Python Threading", i started to > realize that the only way to utilize the power of multiple cores using > Python, is spawn processes and "communicate" with them. > > If we have the scenario: > > 1. Windows (m

Re: The Future of Python Threading

2007-08-10 Thread Ben Sizer
On 10 Aug, 15:38, Ben Finney <[EMAIL PROTECTED]> wrote: > "Justin T." <[EMAIL PROTECTED]> writes: > > The truth is that the future (and present reality) of almost every > > form of computing is multi-core, and there currently is no effective > > way of dealing with concurrency. > > Your post seems

Ipc mechanisms and designs.

2007-08-10 Thread king kikapu
Hi, inspired of the topic "The Future of Python Threading", i started to realize that the only way to utilize the power of multiple cores using Python, is spawn processes and "communicate" with them. If we have the scenario: 1. Windows (mainly) development 2. Processes are running in the same ma

Re: The Future of Python Threading

2007-08-10 Thread Nick Craig-Wood
Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Justin T. wrote: > > > The detrimental effects of the GIL have been discussed several > > times and nobody has ever done anything about it. > > Also it has been discussed that dropping the GIL concept requires > very fine locking mechanisms ins

Re: High performance binary data

2007-08-10 Thread sturlamolden
On Aug 10, 2:26 am, Steve <[EMAIL PROTECTED]> wrote: > I want to ready binary data from a udp socket effeciently as possible > in python. I know of the struct package but do people have any tips > when dealing with binary data in python? Is there a library or api > that is faster when dealing wit

Re: The Future of Python Threading

2007-08-10 Thread king kikapu
> All of which is avoided by designing the program to operate as > discrete processes communicating via well-defined IPC mechanisms. Hi Ben, i would like to learn more about this, have you got any links to give me so i can have a look ? -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython before MainLoop

2007-08-10 Thread Steve Holden
[david] wrote: > [...] I don't think wxPython is really ready for Windows. > I don't think you are really ready to for GUIs ;-) Fortunately, it doesn't matter what *I* think. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holden

Re: High performance binary data

2007-08-10 Thread Nick Craig-Wood
Steve <[EMAIL PROTECTED]> wrote: > I want to ready binary data from a udp socket effeciently as possible > in python. I know of the struct package but do people have any tips > when dealing with binary data in python? Is there a library or api > that is faster when dealing with binary data. I

Re: wxPython before MainLoop

2007-08-10 Thread Bjoern Schliessmann
[david] wrote: > I'm disappointed that I didn't get a wxPython solution. > > If the only way to get wxPython to correctly handle > this simple task is to code around it, LOL -- did you try coding this app with native windows means, like MFC? You will have *exactly* the same problem, and *exactl

Re: The Future of Python Threading

2007-08-10 Thread Aahz
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > >I doubt that a thread on c.l.py is going to change much. It's the >python-dev and py3k lists where you'll need to take up the cudgels, >because I can almost guarantee nobody is going to take the GIL out of >2.6 or 2.7.

AttributeError: 'module' object has no attribute 'HTTPSHandler'

2007-08-10 Thread [EMAIL PROTECTED]
Hi I built and installed python 2.5 from source and when I do this: opener = urllib2.build_opener(SmartRedirectHandler(), DefaultErrorHandler(), urllib2.HTTPSHandler()) I get this error. AttributeError: 'module' object has no attribute 'HTTPSHandler' What should I do? -- http://mail.python.org/

Re: Puzzled by "is"

2007-08-10 Thread Trent Mick
Dick Moores wrote: > At 06:13 PM 8/9/2007, Ben Finney wrote: >> It's important to also realise that the language is *deliberately* >> non-committal on whether any given value will have this behaviour; >> that is, it's entirely left to the language implementation which >> optimisation trade-offs to

Re: Stackless Integration

2007-08-10 Thread Terry Reedy
"Justin T." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | > And as far as I know or | > could find in the PEP index, C. Tismer has never submitted a PEP asking | > that it be made so. Doing so would mean a loss of control, so there is a | > downside as well as the obvious upside

Re: beginner whitespace question

2007-08-10 Thread eggie5
On Aug 9, 10:37 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Dan Bishop wrote: > >> Tabs are for tables, hence the name. "Use spaces for space and use tabs > >> for tables" can be a little mnemonic to help you remember the rules. We > >> can make a little song together if you can think of some thi

Re: is there anybody using __del__ correctly??

2007-08-10 Thread Michele Simionato
On Aug 10, 7:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > There were also a few recipes posted during this discussion that wrap > weakrefs up a bit nicer so it's easier to use them in place of __del__: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/519635http://aspn.activestate.c

Re: (Re)announcing APL 2007

2007-08-10 Thread rjp
On Aug 6, 9:20 am, Paul Mansour <[EMAIL PROTECTED]> wrote: > APL2007 Roll Call: Is anyone going to this? > > I'm thinking about going, but I don't want to the only one to show up, > as in San Diego. Here here. Sorry to mention the elephant in the room, but this discussion begs the obvious questi

Re: The Future of Python Threading

2007-08-10 Thread Justin T.
On Aug 10, 3:52 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 10 Aug 2007 10:01:51 -, "Justin T." <[EMAIL PROTECTED]> wrote: > >Hello, > > >While I don't pretend to be an authority on the subject, a few days of > >research has lead me to believe that a discussion needs to be star

Re: is there anybody using __del__ correctly??

2007-08-10 Thread Raymond Hettinger
[Michele Simionato] > Here and there I hear rumors about deprecating __del__ and > nothing > happens, are there any news about that? Expecially concerning Py3k? I was writing a Py3K PEP advocating the elimination of __del__ because: * 'with closing()' and try/finally are the preferred ways of ca

Re: py2exe with python 2.5

2007-08-10 Thread vedrandekovic
On 10 kol, 14:38, Ant <[EMAIL PROTECTED]> wrote: > On Aug 10, 11:47 am, [EMAIL PROTECTED] wrote: > > > On 10 kol, 11:02, Ant <[EMAIL PROTECTED]> wrote: > ... > > yes,Python 2.5 is on the path, but how can I remove panda3d from that > > path? > > Hit Win - Break to bring up the System Properties dia

Re: The Future of Python Threading

2007-08-10 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: >Justin T. wrote: > >> The detrimental effects of the GIL have been discussed several >> times and nobody has ever done anything about it. > >Also it has been discussed that dropping the GIL concept requires >very fine

Re: Deleting objects on the fly

2007-08-10 Thread Terry Reedy
"Campbell Barton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Michele Simionato wrote: | > Probably not, 'del x' just decrements the reference count, Or as http://docs.python.org/ref/del.html puts it, " Deletion of a name removes the binding of that name from the local or glob

Re: Smoother Lines in Turtle Graphics

2007-08-10 Thread kyosohma
On Aug 9, 6:56 pm, tomy <[EMAIL PROTECTED]> wrote: > Hi All > I am a newbie to turtle graphics in python, so sorry if you find this > question too easy. > How can I get smoother lines in turtle graphics? > I am using python on windows. > > Thanks in advance You may be better off using PIL or pygam

Re: Puzzled by "is"

2007-08-10 Thread Marc 'BlackJack' Rintsch
On Fri, 10 Aug 2007 10:57:22 -0700, Dick Moores wrote: > At 06:13 PM 8/9/2007, Ben Finney wrote: >>Others have already said that it's an implementation optimisation, >>which seems to partly answer your question. >> >>It's important to also realise that the language is *deliberately* >>non-committa

pat-match.lisp or extend-match.lisp in Python?

2007-08-10 Thread ekzept
anyone have either pat-match.lisp or extend-match.lisp redone in Python? or how about knowing where there might be such a thing? sources: http://norvig.com/paip/patmatch.lisp http://www.cs.northwestern.edu/academics/courses/325/programs/extend-match.lisp -- http://mail.python.org/mailm

Re: Does PyModule_GetDict return information about class method variables?

2007-08-10 Thread Marc 'BlackJack' Rintsch
On Fri, 10 Aug 2007 05:54:03 -0700, MD wrote: > On Aug 10, 12:43 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> class A(object): >> def foo(self): >> bar = 42 >> >> The local name `bar` only exists if `foo()` is called on an instance of `A`. > >Thanks for your reply. I

Re: Ipc mechanisms and designs.

2007-08-10 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, king kikapu <[EMAIL PROTECTED]> wrote: > Hi, > > inspired of the topic "The Future of Python Threading", i started to > realize that the only way to utilize the power of multiple cores using > Python, is spawn processes and "communicate" with them. > > If we have

Re: wxPython before MainLoop

2007-08-10 Thread kyosohma
On Aug 9, 8:51 pm, "[david]" <[EMAIL PROTECTED]> wrote: > I'm disappointed that I didn't get a wxPython solution. > > If the only way to get wxPython to correctly handle > this simple task is to code around it, I don't think > wxPython is really ready for Windows. > > Is there a better place to ask

Re: Python MAPI

2007-08-10 Thread kyosohma
On Aug 10, 5:05 am, vasudevram <[EMAIL PROTECTED]> wrote: > On Jul 23, 6:07 pm, [EMAIL PROTECTED] wrote: > > >Well, I ran Process Monitor with some filters enabled to only watch > > Thunderbird and MS Word. Unfortunately, that didn't give me any of the > registry edits, so I disabled my filters and

Re: Does PyModule_GetDict return information about class method variables?

2007-08-10 Thread MD
Hi Marc, Thanks for your reply. I am calling my extension function from the class method itself. So at that point the variable does exist. I am puzzled why PyModule_GetDict is not able to access the variable even though it does exist at that point. Thanks, -Manas On Aug 10, 12:43 am, Marc 'Bla

Re: Question about properties.

2007-08-10 Thread Gerardo Herzig
king kikapu wrote: >On Aug 10, 1:33 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > >>On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote: >> >> >>>Hi, >>> >>> >>>i read in a book the following code snippet that is dealing with >>>properties: >>> >>> >>>class Protec

Re: py2exe with python 2.5

2007-08-10 Thread Ant
On Aug 10, 11:47 am, [EMAIL PROTECTED] wrote: > On 10 kol, 11:02, Ant <[EMAIL PROTECTED]> wrote: ... > yes,Python 2.5 is on the path, but how can I remove panda3d from that > path? Hit Win - Break to bring up the System Properties dialog (you can also get here through the Control Panel). Go to th

Re: Question about properties.

2007-08-10 Thread Steve Holden
king kikapu wrote: > On Aug 10, 1:33 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote: >>> Hi, >>> i read in a book the following code snippet that is dealing with >>> properties: >>> class ProtectAndHideX(object): >>> def __init__

Re: subprocess.Popen(cmd) question

2007-08-10 Thread WolfgangZ
WolfgangZ schrieb: > Hello, > > I'm starting some subprocesses inside a loop. The processes run > independent and dont need any communication between each other. Due to > memory issues I need to limit the number of running processes to around > 10. How can I insert a break into my loop to wait

Re: The Future of Python Threading

2007-08-10 Thread Paul Boddie
On 10 Aug, 12:01, "Justin T." <[EMAIL PROTECTED]> wrote: > > While I don't pretend to be an authority on the subject, a few days of > research has lead me to believe that a discussion needs to be started > (or continued) on the state and direction of multi-threading python. > > Python is not multi-

Re: subprocess.Popen(cmd) question

2007-08-10 Thread Peter Otten
WolfgangZ wrote: > I'm starting some subprocesses inside a loop. The processes run > independent and dont need any communication between each other. Due to > memory issues I need to limit the number of running processes to around > 10. How can I insert a break into my loop to wait until some proce

Re: Smoother Lines in Turtle Graphics

2007-08-10 Thread Ant
On Aug 10, 11:41 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > tomy wrote: > > Hi All ... > What turtle graphics? I'm not aware that there is some > standard-turtle-graphics available, so it might be a problem of your > turtle-graphics-package. > > Diez import turtle Its part of the standar

Re: The Future of Python Threading

2007-08-10 Thread Steve Holden
Justin T. wrote: > Hello, > > While I don't pretend to be an authority on the subject, a few days of > research has lead me to believe that a discussion needs to be started > (or continued) on the state and direction of multi-threading python. [...] > What these seemingly unrelated thoughts come d

Re: Question about properties.

2007-08-10 Thread king kikapu
On Aug 10, 1:33 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote: > > Hi, > > > i read in a book the following code snippet that is dealing with > > properties: > > > class ProtectAndHideX(object): > > def __init__(self, x): > >

Re: Smoother Lines in Turtle Graphics

2007-08-10 Thread Diez B. Roggisch
tomy wrote: > Hi All > I am a newbie to turtle graphics in python, so sorry if you find this > question too easy. > How can I get smoother lines in turtle graphics? > I am using python on windows. What turtle graphics? I'm not aware that there is some standard-turtle-graphics available, so it mig

Re: Issues of state

2007-08-10 Thread Steve Holden
greg wrote: > Jay Loden wrote: >> Like most things involving dynamic client side-javascript code and AJAX >> technology, it's a lot harder than you'd like it to be to solve the problem, >> but >> in cases where the Back button is really an issue, it's worth the effort. > > So if you're willing to

Re: Question about properties.

2007-08-10 Thread dijkstra . arjen
On Aug 10, 12:21 pm, king kikapu <[EMAIL PROTECTED]> wrote: > Hi, > > i read in a book the following code snippet that is dealing with > properties: > > class ProtectAndHideX(object): > def __init__(self, x): > assert isinstance(x, int), '"x" must be an integer!"' > self.__x = ~

Question about properties.

2007-08-10 Thread king kikapu
Hi, i read in a book the following code snippet that is dealing with properties: class ProtectAndHideX(object): def __init__(self, x): assert isinstance(x, int), '"x" must be an integer!"' self.__x = ~x def get_x(self): return ~self.__x x = property(get_x)

Re: beginner whitespace question

2007-08-10 Thread Ben Finney
James Stroud <[EMAIL PROTECTED]> writes: > When you want to screw your whitespace--don't! > Take this little pledge and I know you won't: James, you're a poet And you don't even realise -- \ "[...] a Microsoft Certified System Engineer is to information | `\ technology as a McDonald

Re: Python MAPI

2007-08-10 Thread vasudevram
On Jul 23, 6:07 pm, [EMAIL PROTECTED] wrote: >Well, I ran Process Monitor with some filters enabled to only watch Thunderbird and MS Word. Unfortunately, that didn't give me any of the registry edits, so I disabled my filters and ran it without. Now I have a log file with 28,000 entries. It's amaz

Re: Deleting objects on the fly

2007-08-10 Thread Campbell Barton
Michele Simionato wrote: > On Aug 10, 2:25 am, Godzilla <[EMAIL PROTECTED]> wrote: >> Hello, >> >> I wish to know whether I should delete objects created on the fly via >> the "del obj" statement. I noticed the RAM usage increased whenever >> the application is being run for a long time. I am creat

The Future of Python Threading

2007-08-10 Thread Justin T.
Hello, While I don't pretend to be an authority on the subject, a few days of research has lead me to believe that a discussion needs to be started (or continued) on the state and direction of multi-threading python. Python is not multi-threading friendly. Any code that deals with the python inte

Re: wxPython - drawing without paint event

2007-08-10 Thread 7stud
On Aug 9, 7:46 pm, Matt Bitten <[EMAIL PROTECTED]> wrote: > I've got a wxPython program that needs to do some drawing on a DC on a > regular basis And there is no event, > so my code doesn't get called. What do I do? Then the event is: "on a regular basis", i.e. the passage of time. You can us

Re: is there anybody using __del__ correctly??

2007-08-10 Thread greg
Michele Simionato wrote: > So I did, and to my dismay 95% of the __del__ methods in the standard > library are just calling a close method! You can't conclude that this is wrong just from looking at the __del__ method itself. You need to consider whether there is any way the thing being closed cou

Re: how to get output.

2007-08-10 Thread indu_shreenath
On Aug 10, 12:02 am, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I corrected a typ below. > > > On Aug 9, 12:50 pm, [EMAIL PROTECTED] wrote: > >> Hey, > > >> I did write the following: > >> but it does not work. > > >> import subprocess as sp > >> try: > >> p = sp.Pope

subprocess.Popen(cmd) question

2007-08-10 Thread WolfgangZ
Hello, I'm starting some subprocesses inside a loop. The processes run independent and dont need any communication between each other. Due to memory issues I need to limit the number of running processes to around 10. How can I insert a break into my loop to wait until some processes are finis

float to string with different precision

2007-08-10 Thread zunbeltz
Hi, I have to print float numbers to a file. Each float should be 5 characters in width (4 numbers and the decimal point). My problem is that I do not now how to specify float to have different numbers of decimals. For example 5.32 -> 5.320 10.356634 -> 10.357 289.234 -> 289.2 In the string form

Re: Misleading wikipedia article on Python 3?

2007-08-10 Thread greg
Evan Klitzke wrote: > You can easily modify print in a safe way. Yes, but you'd still have to replace the builtin print function with your own to get it used by non-cooperative code. That doesn't seem to gain you much over replacing sys.stdout with something that intercepts and logs stuff written

Re: float to string with different precision

2007-08-10 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I have to print float numbers to a file. Each float should be 5 > characters in width (4 numbers and the decimal point). > My problem is that I do not now how to specify float to have different > numbers of decimals. For example > > 5.32 -> 5.320 > 10.356634 -> 10.357

Re: Issues of state

2007-08-10 Thread greg
Jay Loden wrote: > Like most things involving dynamic client side-javascript code and AJAX > technology, it's a lot harder than you'd like it to be to solve the problem, > but > in cases where the Back button is really an issue, it's worth the effort. So if you're willing to put in a huge amount

Re: pep 3116 behaviour on non-blocking reads

2007-08-10 Thread greg
Antoon Pardon wrote: > I would like the developers to reconsider and return 0 bytes when no > bytes are available and let None indicate end of file. That would be a major departure from the way IO has always been handled before in Python, which follows the Unix model. Also, only code that deals w

Re: py2exe with python 2.5

2007-08-10 Thread Ant
On Aug 10, 8:39 am, [EMAIL PROTECTED] wrote: > Hello, > > Now,I was install python 2.5 and remove python 2.4 completely.After I > write: > $ python mysetup.py py2exe > ... > import py2exe_ util > ImportError: Module use of conflicts with this version of Python > > ...ok, I know what is a p

Re: tempfile behavior

2007-08-10 Thread greg
Marc 'BlackJack' Rintsch wrote: > File descriptors are integers. It's a low level C thing. Either use the > low level functions in `os` or open the file with the `filename`. In particular, os.fdopen(fd) will give you a file object. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

com: makepy gencache.EnsureModule

2007-08-10 Thread Kai Rosenthal
Hello, I' having a problem with gencache.EnsureModule: I used win32com\client\makepy.py to successfully generate Python sources. Unfortunately, after I call win32com.client.Dispatch(), the object I get back is of type "COMObject" instead of one of the generated classes. In particular, I'm trying

Re: Stackless Integration

2007-08-10 Thread Bruno Desthuilliers
Steve Holden a écrit : > Bruno Desthuilliers wrote: >> Jean-Paul Calderone a écrit : >>> On Thu, 09 Aug 2007 09:00:27 -, "Justin T." <[EMAIL PROTECTED]> >>> wrote: Hi, I've been looking at stackless python a little bit, and it's awesome. My question is, why hasn't it been i

Re: programmatically define a new variable on the fly

2007-08-10 Thread Bruno Desthuilliers
Lee Sander a écrit : > Hi, > > I would like to define a new variable which is not predefined by me. > For example, > I want to create an array called "X%s" where "%s" is to be determined > based on the data I am processing. So, for example, if I the file > I'm reading has > g 99 > on the first lin

Re: Question about properties.

2007-08-10 Thread Marc 'BlackJack' Rintsch
On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote: > Hi, > > i read in a book the following code snippet that is dealing with > properties: > > class ProtectAndHideX(object): > def __init__(self, x): > assert isinstance(x, int), '"x" must be an integer!"' > self.__x = ~x

Re: Issues of state

2007-08-10 Thread Jay Loden
Steve Holden wrote: > greg wrote: >> Jay Loden wrote: >>> Like most things involving dynamic client side-javascript code and AJAX >>> technology, it's a lot harder than you'd like it to be to solve the >>> problem, but >>> in cases where the Back button is really an issue, it's worth the effort. >

Re: float to string with different precision

2007-08-10 Thread Zentrader
On Aug 10, 1:12 am, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I have to print float numbers to a file. Each float should be 5 > > characters in width (4 numbers and the decimal point). > > My problem is that I do not now how to specify float to have different > > number

Python Dies on "make install"

2007-08-10 Thread fartknuckle
When I try to build and install python from source It configures and makes fine but upon 'make install' I always get to this point: Listing /usr/local/lib/python2.5/xml/sax ... Compiling /usr/local/lib/python2.5/xml/sax/__init__.py ... Compiling /usr/local/lib/python2.5/xml/sax/_exceptions.py

Re: The Future of Python Threading

2007-08-10 Thread Luc Heinrich
Justin T. <[EMAIL PROTECTED]> wrote: > What these seemingly unrelated thoughts come down to is a perfect > opportunity to become THE next generation language. Too late: :) -- Luc Heinrich -- http://mail.python.org/mailman/listinfo/python-list

Re: The Future of Python Threading

2007-08-10 Thread Ben Finney
"Justin T." <[EMAIL PROTECTED]> writes: > The truth is that the future (and present reality) of almost every > form of computing is multi-core, and there currently is no effective > way of dealing with concurrency. Your post seems to take threading as the *only* way to write code for multi-core s

Re: Question about properties.

2007-08-10 Thread Dustan
On Aug 10, 5:31 am, [EMAIL PROTECTED] wrote: > On Aug 10, 12:21 pm, king kikapu <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > i read in a book the following code snippet that is dealing with > > properties: > > > class ProtectAndHideX(object): > > def __init__(self, x): > > assert isin

Re: Question about properties.

2007-08-10 Thread Antti Rasinen
> Hi, > > i read in a book the following code snippet that is dealing with > properties: > > class ProtectAndHideX(object): > def __init__(self, x): > assert isinstance(x, int), '"x" must be an integer!"' > self.__x = ~x > > def get_x(self): > return ~self.__x > >

Re: Smoother Lines in Turtle Graphics

2007-08-10 Thread Steve Holden
Jeremy Sanders wrote: > Ant wrote: > >> Python: Batteries and Turtles included! > > I didn't know that! It looks like turtle is based on Tk, which doesn't have > antialiasing yet (see http://wiki.tcl.tk/10101 ), so it can't really be > made nice and smooth (unless you could somehow use tkzinc/tkp

Re: The Future of Python Threading

2007-08-10 Thread Bjoern Schliessmann
Justin T. wrote: > The detrimental effects of the GIL have been discussed several > times and nobody has ever done anything about it. Also it has been discussed that dropping the GIL concept requires very fine locking mechanisms inside the interpreter to keep data serialised. The overhead managi

Re: Smoother Lines in Turtle Graphics

2007-08-10 Thread Jeremy Sanders
Ant wrote: > Python: Batteries and Turtles included! I didn't know that! It looks like turtle is based on Tk, which doesn't have antialiasing yet (see http://wiki.tcl.tk/10101 ), so it can't really be made nice and smooth (unless you could somehow use tkzinc/tkpath to draw with). I suppose turtl

Re: Question about properties.

2007-08-10 Thread king kikapu
Maybe is just a writers' "play" and nothing else. -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe with python 2.5

2007-08-10 Thread vedrandekovic
On 10 kol, 11:02, Ant <[EMAIL PROTECTED]> wrote: > On Aug 10, 8:39 am, [EMAIL PROTECTED] wrote: > > > > > Hello, > > > Now,I was install python 2.5 and remove python 2.4 completely.After I > > write: > > $ python mysetup.py py2exe > > ... > > import py2exe_ util > > ImportError: Module use

Re: wxPython before MainLoop

2007-08-10 Thread Chris Mellon
On 8/9/07, Heikki Toivonen <[EMAIL PROTECTED]> wrote: > [david] wrote: > > I'd like to refresh the display before I start the main loop. > > We have this kind of situation in Chandler, where we display and update > the splash screen before we enter MainLoop. > > 1. Create app object >http://lxr

Fwd: AttributeError: 'module' object has no attribute 'HTTPSHandler'

2007-08-10 Thread Matt McCredie
> I built and installed python 2.5 from source and when I do this: > > opener = urllib2.build_opener(SmartRedirectHandler(), > DefaultErrorHandler(), urllib2.HTTPSHandler()) > > I get this error. > AttributeError: 'module' object has no attribute 'HTTPSHandler' > > What should I do? You need `_ss

Re: programmatically define a new variable on the fly

2007-08-10 Thread Bart Ogryczak
On 10 ago, 00:11, Lee Sander <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to define a new variable which is not predefined by me. > For example, > I want to create an array called "X%s" where "%s" is to be determined > based on the data I am processing. So, for example, if I the file > I'm rea

Re: Threaded Design Question

2007-08-10 Thread Graeme Glass
Using IPC is just adding needles complexity to your program. Instead of constantly scanning the directory for files and then adding them to a Queue, and then having to worry if that specific file may have already been popped off the queue and is currently running by one of the workers, just poll th

Re: Stackless Integration

2007-08-10 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : > Steve Holden a écrit : (snip) >> Twisted is a complex set of packages > > Sure. Now I may be dumb, but I thought it was about stackless, not about > Twisted... Sorry, didn't saw your other post. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython before MainLoop

2007-08-10 Thread Chris Mellon
On 8/9/07, [david] <[EMAIL PROTECTED]> wrote: > I'm disappointed that I didn't get a wxPython solution. > > If the only way to get wxPython to correctly handle > this simple task is to code around it, I don't think > wxPython is really ready for Windows. > This sort of blathering is really just in

Re: The Future of Python Threading

2007-08-10 Thread kyosohma
On Aug 10, 5:57 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Justin T. wrote: > > Hello, > > > The nice thing is that this requires a fairly doable amount of work. > > First, stackless should be integrated into the core. Then there should > > be an effort to remove the reliance on the GIL for pyth

Re: The Future of Python Threading

2007-08-10 Thread brad
brad wrote: > This is all anecdotal... threads in Python work great for me. I like > Ruby's green threads too, I forgot to mention that Ruby is moving to a GIL over green threads in v2.0 -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzled by "is"

2007-08-10 Thread Dick Moores
At 06:13 PM 8/9/2007, Ben Finney wrote: >Content-Transfer-Encoding: base64Grzegorz >Słodkowicz <[EMAIL PROTECTED] [EMAIL PROTECTED] >theorisation but I'd rather expect the interpreter > > simply not to create a second tuple while there already is an > > identical one. > >Others have already sai

Re: The Future of Python Threading

2007-08-10 Thread Justin T.
On Aug 10, 2:02 pm, [EMAIL PROTECTED] (Luc Heinrich) wrote: > Justin T. <[EMAIL PROTECTED]> wrote: > > What these seemingly unrelated thoughts come down to is a perfect > > opportunity to become THE next generation language. > > Too late: > > :) > > -- > Luc Heinrich Uh oh

Re: Python Dies on "make install"

2007-08-10 Thread Jarek Zgoda
fartknuckle napisał(a): > When I try to build and install python from source It configures and > makes fine but upon 'make install' I always get to this > point: > > > > Listing /usr/local/lib/python2.5/xml/sax ... > Compiling /usr/local/lib/python2.5/xml/sax/__init__.py ... > Compiling /usr/l

Module imports during object instantiation

2007-08-10 Thread Ritesh Raj Sarraf
Hi, I've been very confused about why this doesn't work. I mean I don't see any reason why this has been made not to work. class Log: def __init__(self, verbose, lock = None): if verbose is True: self.VERBOSE = True else: self.VERBOSE = False if lock is

Re: The Future of Python Threading

2007-08-10 Thread Bjoern Schliessmann
Nick Craig-Wood wrote: [GIL] > That is certainly true. However the point being is that running > on 2 CPUs at once at 95% efficiency is much better than running on > only 1 at 99%... How do you define this percent efficiency? >>> The truth is that the future (and present reality) of almost >>>

Re: Module imports during object instantiation

2007-08-10 Thread James Stroud
Ritesh Raj Sarraf wrote: > Hi, > > I've been very confused about why this doesn't work. I mean I don't see any > reason why this has been made not to work. > > class Log: > > def __init__(self, verbose, lock = None): > > if verbose is True: > self.VERBOSE = True >

  1   2   >