Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Fredrik Lundh
Sorin Schwimmer wrote: I am thinking on something in the following form: code import time import thread delay=True def fn() global delay time.sleep(your_amount_of_time_in_seconds) delay=False thread.start_new_thread(fn,()) while delay: statement 1 statement 2 ...

distributing modules to machines

2006-08-29 Thread r1pp3r
I'm in the the process of designing a build system written in python. It runs from a central server with various build machines hosting server processes, written in Python. Pyro is the chosen RPC mechanism. What I would like to do is have the system update itself on demand. In other words, pass

SWIG wrapper/Python2.5c1 problem

2006-08-29 Thread andrew . gregory
If compiling a SWIG wrapper with MinGW 3.2.3 (Windows) get the following compilation error: pyprog_wrap.cxx: In function `int SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)': pyprog_wrap.cxx:2051: invalid conversion from `const char*' to `char*' Extract from wrapper: /*

Re: How ahead are you guys in the (Python) real world?

2006-08-29 Thread [EMAIL PROTECTED]
Ray wrote: Since I haven't used Python at work, I am using Python 2.5 right now. However I wonder, how fast are you guys moving from version to version at work? As an illustration my ex-company just moved to Java 5, which was released around... what, 2-3 years ago? (While I am running Java 6

Re: ntp in python

2006-08-29 Thread Janto Dreijer
Jeremy Sanders wrote: Janto Dreijer wrote: I want to measure the packet delivery delays over various network links. For this I need to synchronise the times of the sender and receiver, either against NTP or eachother. Couldn't you just use NTP itself to get the delivery delay? You can

Re: Desktop Notification/Alerts In Python

2006-08-29 Thread Chaos
alex23 wrote: Chaos wrote: I am looking for ways to have a Desktop Alert, like the one most IM Messengers have (MSN, AIM) at the lower right above the taskbar. Can anyone point me to the right resources to use? Under Windows, they're called balloon tips. Here's a thread from a few years

Re: distributing modules to machines

2006-08-29 Thread Fredrik Lundh
r1pp3r wrote: What I would like to do is have the system update itself on demand. In other words, pass pickled objects (the code comprising the server) down the pipeline to the server, have them copied to the right place, and then restart the server which can then invoke the new code. should

Re: about daemons and IPC

2006-08-29 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: Hey people! For the first time I'm doing a client/server application, and I'm really confused with IPC stuff. [...] Any suggestions? http://pyro.sourceforge.net depending on your needs --Irmen -- http://mail.python.org/mailman/listinfo/python-list

sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread gmax2006
Hi, I use RedHat linux. How can I find where exactly the current python script is running? I use this code: #test.py import os,sys print sys.argv os.chdir(os.path.dirname(sys.argv[0])) It doesn't work when I run this command from the directory that test.py is located: python test.py That

Issues with Installer written in Python for Linux

2006-08-29 Thread [EMAIL PROTECTED]
c.l.p- I am undertaking writing an installer for a software package using Python. It is exclusively for Linux. Because this is an installer and has to run on numerous Linux distros, it is presenting some unique challenges. First off, I have begun this project by writing a text mode only

SOAP web services

2006-08-29 Thread Yusnel Rojas
I'm trying to make the wsdl asociated with this sample but I cannot make it workimport SOAPpydef doUpper(word): return word.upper()server = SOAPpy.SOAPServer((, 8000)) server.registerFunction(doUpper)server.registerFunction(who)server.serve_forever()can anyone tell me how to do this?anyone who

Re: ntp in python

2006-08-29 Thread Janto Dreijer
Janto Dreijer wrote: Jeremy Sanders wrote: Janto Dreijer wrote: I want to measure the packet delivery delays over various network links. For this I need to synchronise the times of the sender and receiver, either against NTP or eachother. Couldn't you just use NTP itself to get

Split with python

2006-08-29 Thread Norman Khine
Hello, I have a csv file which is has a field that has something like: text.csv text (xxx) text (text) (yyy) text (text) (text) (zzz) I would like to split the last '(text)' out and put it in a new column, so that I get: new_test.csv text,(xxx) text (text),(yyy) text (text) (text),(zzz) how

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Adam Jones
Bruno Desthuilliers wrote: Paul Boddie wrote: Ray wrote: (snip) We're a Java shop so our developers are trained in Java, Struts, Tomcat, etc. Any switch to a dynamic language will be a huge change. However it baffles me that they are open to at least a PoC in Rails. but when I

Re: eval() woes

2006-08-29 Thread rdrink
Thanks everyone for you thoughtful replies... And yes Simon you are right... I do need to learn how to read 'tracebacks' (and de-bugging tools in general)... but you are the first person to give me a step-by-step explination, thank you. And LOL you all caught my dropped single-quote ;-) but

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Joachim Durchholz
Gabriel Genellina schrieb: At Tuesday 29/8/2006 07:50, Joachim Durchholz wrote: Wikipedia says it's going from 2NlogN to N. If a sort is massively dominated by the comparison, that could give a speedup of up to 100% (approximately - dropping the logN factor is almost irrelevant, what counts

Re: Split with python

2006-08-29 Thread Tim Chase
Norman Khine wrote: Hello, I have a csv file which is has a field that has something like: text.csv text (xxx) text (text) (yyy) text (text) (text) (zzz) I would like to split the last '(text)' out and put it in a new column, so that I get: new_test.csv text,(xxx) text

python for flash drives

2006-08-29 Thread Putty
Is there such a thing as a special version of python that I can run more efficiently from a flash drive? I'll be at college for hours every day with hours of free time for the next few months, but the only computers at my disposal are windows PCs that use GoBack to auto-revert every reboot. So

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Bruno Desthuilliers
Adam Jones wrote: Bruno Desthuilliers wrote: Paul Boddie wrote: Ray wrote: (snip) We're a Java shop so our developers are trained in Java, Struts, Tomcat, etc. Any switch to a dynamic language will be a huge change. However it baffles me that they are open to at least a PoC in Rails. but

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread Miki
Hello Max, How can I find where exactly the current python script is running? ... That means sys.argv[0] doesn't always contain the full path of running script. sys.path[0] is the script directory, combined with sys.argv[0] you can find the full path to the script. (Note that in some rare

Questoin about outlook calendar

2006-08-29 Thread Gallagher, Tim (NE)
I am trying to pull all my information from outlook calendar so I can send calendar information to my phone via email. I have created a python script that will gather Outlook Calendar information and display it. I am new to python and this is something that I am working on so I can get

Re: unit test for a printing method

2006-08-29 Thread Marco Wahl
Fredrik Lundh [EMAIL PROTECTED] writes: why are you trying to reinvent doctest ? The OP asked for unit test. This could be read that the OP wants to use module unittest. http://docs.python.org/lib/doctest-unittest-api.html Ahh, that's good to know that doctests can be integrated into

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-29 Thread Eyal Lotem
How can I find where exactly the current python script is running? ... That means sys.argv[0] doesn't always contain the full path of running script. sys.path[0] is the script directory, combined with sys.argv[0] you can find the full path to the script. (Note that in some rare cases

Re: Desktop Notification/Alerts In Python

2006-08-29 Thread bugnthecode
Chaos wrote: alex23 wrote: Chaos wrote: I am looking for ways to have a Desktop Alert, like the one most IM Messengers have (MSN, AIM) at the lower right above the taskbar. Can anyone point me to the right resources to use? I get these alerts from gmail-notify. It's for linux, but a

block a network port

2006-08-29 Thread abcd
any ideas on how to block a network port from being used, or one that is currently in use? For example, say I want to block port 23 from being used. by used, I mean allowing connections to or from it. thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Tim Peters
[Joachim Durchholz] Wikipedia says it's going from 2NlogN to N. If a sort is massively dominated by the comparison, that could give a speedup of up to 100% (approximately - dropping the logN factor is almost irrelevant, what counts is losing that factor of 2). [Gabriel Genellina] In fact

Generator chaining?

2006-08-29 Thread John Doe
This is sort of a feature request/idea: Chaining generators. If you have two lists (or tuples) and you add them, the result is a concatenation of the two. I think it would be nice if it was possible to do something similar with generators. The best way to explain is by code example: def

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Joachim Durchholz
Tim Peters schrieb: [Joachim Durchholz] Wikipedia says it's going from 2NlogN to N. If a sort is massively dominated by the comparison, that could give a speedup of up to 100% (approximately - dropping the logN factor is almost irrelevant, what counts is losing that factor of 2). [Gabriel

ANN: Wing IDE 2.1.2 released

2006-08-29 Thread Wingware Announce
Hi, We're happy to announce version 2.1.2 of Wing IDE, an advanced development environment for the Python programming language. This is a bugfix release that improves support for Python 2.5 (2.5c1 is required) and fixes a number of bugs. The release can be downloaded from:

Re: Generator chaining?

2006-08-29 Thread Jean-Paul Calderone
On Tue, 29 Aug 2006 22:41:37 +0300, John Doe [EMAIL PROTECTED] wrote: This is sort of a feature request/idea: Chaining generators. If you have two lists (or tuples) and you add them, the result is a concatenation of the two. I think it would be nice if it was possible to do something similar with

Re: Generator chaining?

2006-08-29 Thread Duncan Booth
John Doe wrote: This is sort of a feature request/idea: Chaining generators. If you have two lists (or tuples) and you add them, the result is a concatenation of the two. I think it would be nice if it was possible to do something similar with generators. The best way to explain is by code

Re: python for flash drives

2006-08-29 Thread Maciej Dziardziel
Putty wrote: Is there such a thing as a special version of python that I can run more efficiently from a flash drive? google for movable python (or similar) -- Maciej Fiedzia Dziardziel ([EMAIL PROTECTED]) In the land of the blind, the one eyed man is king. --

Re: Generator chaining?

2006-08-29 Thread Gabriel Genellina
At Tuesday 29/8/2006 16:41, John Doe wrote: This is sort of a feature request/idea: Chaining generators. If you have two lists (or tuples) and you add them, the result is a concatenation of the two. I think it would be nice if it was possible to do something similar with generators. The best

Re: What do you want in a new web framework?

2006-08-29 Thread Peter Maas
Cliff Wells wrote: On Wed, 2006-08-23 at 22:13 +0200, Peter Maas wrote: Alex Martelli wrote: [...] I have already suggested to the BDFL that he can remedy this situation in Py3k: all he has to do, of course, is to add a LOT more keywords. Here is another remedy: he adds one of the frameworks

Re: What do you want in a new web framework?

2006-08-29 Thread Peter Maas
[EMAIL PROTECTED] wrote: Here is another remedy: he adds one of the frameworks to the standard library :) Peter Maas, Aachen But there are already 3 ;-) http://docs.python.org/lib/module-BaseHTTPServer.html http://docs.python.org/lib/module-SimpleHTTPServer.html

Re: Extending the dict class

2006-08-29 Thread chosechu
Bruno Desthuilliers wrote: It's usually possible to modify third-parts classes behaviour on the fly (googling for 'monkey-patching' should get you started). But true, this doesn't work with builtins. I guess this stems from the fact that Python dictionaries are C creatures and they are

Re: time.clock() going backwards??

2006-08-29 Thread Ralf Muschall
Grant Edwards wrote: This is a _Microsoft_Product_. There doesn't have to be a reason for something to be done in a half-assed manner. No, it is a quantum effect. If the energy of a clock has a lower bound, there must be a nonzero probability for it to run backwards. See [EMAIL PROTECTED]

Re: Coding style and else statements

2006-08-29 Thread Tal Einat
Bruno Desthuilliers wrote: Sam Pointon a écrit : Bruno Desthuilliers wrote: foo = lambda thing: thing and thing + 1 or -1 The and ... or trick is buggy (what if thing == -1?) Yes, true - Should be: foo2 = lambda t: t != -1 and (t and t+1 or -1) or 0 Actually, the common

Re: block a network port

2006-08-29 Thread Larry Bates
abcd wrote: any ideas on how to block a network port from being used, or one that is currently in use? For example, say I want to block port 23 from being used. by used, I mean allowing connections to or from it. thanks in advance. This is not really a Python question. Blocking ports is

Re: python for flash drives

2006-08-29 Thread tobiah
You could always get an mp3 player that windows can see as a drive letter. I'll bet the I/O would be quite fast. Plus, you would be getting an mp3 player. If money is a concern, check out used ones on ebay. Putty wrote: Is there such a thing as a special version of python that I can run

Re: Max OSX and Excel

2006-08-29 Thread John Machin
Jorge Vargas wrote: On 28 Aug 2006 15:50:57 -0700, John Machin [EMAIL PROTECTED] wrote: Jorge Vargas wrote: On 8/28/06, Johanna Pfalz [EMAIL PROTECTED] wrote: To be more specific, I'm interested in reading in certain rows and columns from an excel spreadsheet directly without

Python for Windows

2006-08-29 Thread mistral
I need compile code written in Python. I use Windows 98SE. Should I download Python for Windows installer? http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi Will the msi installer modify registry or other system files? Does it possible install Python not touching registry and system files?

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Tim Peters
[Joachim Durchholz] Wikipedia says it's going from 2NlogN to N. If a sort is massively dominated by the comparison, that could give a speedup of up to 100% (approximately - dropping the logN factor is almost irrelevant, what counts is losing that factor of 2). [Gabriel Genellina] In fact

Re: Split with python

2006-08-29 Thread John Machin
Tim Chase wrote: Norman Khine wrote: Hello, I have a csv file which is has a field that has something like: text.csv text (xxx) text (text) (yyy) text (text) (text) (zzz) I would like to split the last '(text)' out and put it in a new column, so that I get: new_test.csv

question about SOAPpy

2006-08-29 Thread m.banaouas
Hello Pythoneers: I would like to ask you a simple question: Are you satisfied by SOAPpy module? Actually, I use this module since a year and i immediately found it very well-implemented, corresponding to dynamic meta-data discovering nature of SOAP/WSDL. BUT i read sometimes threads saying

Re: NumPy 1.0b4 now available

2006-08-29 Thread [EMAIL PROTECTED]
Travis E. Oliphant wrote: The 4th beta release of NumPy 1.0 has just been made available. NumPy 1.0 represents the culmination of over 18 months of work to unify the Numeric and Numarray array packages into a single best-of-breed array package for Python. NumPy supports all the features of

Re: python for flash drives

2006-08-29 Thread Fuzzyman
Putty wrote: Is there such a thing as a special version of python that I can run more efficiently from a flash drive? I'll be at college for hours every day with hours of free time for the next few months, but the only computers at my disposal are windows PCs that use GoBack to auto-revert

Re: Split with python

2006-08-29 Thread tobiah
Tim Chase wrote: Norman Khine wrote: Hello, I have a csv file which is has a field that has something like: text.csv text (xxx) text (text) (yyy) text (text) (text) (zzz) I would like to split the last '(text)' out and put it in a new column, so that I get: new_test.csv text,(xxx)

Re: newbe question about removing items from one file to another file

2006-08-29 Thread [EMAIL PROTECTED]
Anthra Norell wrote: Dexter, I looked at the format specification. It contains an example: --- CsoundSynthesizer; ; test.csd - a Csound structured data file CsOptions -W -d -o tone.wav /CsOptions CsVersion;optional section

Re: NumPy 1.0b4 now available

2006-08-29 Thread Robert Kern
[EMAIL PROTECTED] wrote: Travis E. Oliphant wrote: The 4th beta release of NumPy 1.0 has just been made available. NumPy 1.0 represents the culmination of over 18 months of work to unify the Numeric and Numarray array packages into a single best-of-breed array package for Python. NumPy

Re: Split with python

2006-08-29 Thread John Machin
tobiah wrote: Of course, fixing the csv file takes a little more work. It sounds like the test lines given were just one of the fields, and there are the quotes to worry about. [snip] But then this fails if there are commas in the data. I could split and join on ',' but then that fails

Re: How to let a loop run for a while before checking for breakcondition?

2006-08-29 Thread matt
IMHO you're better off avoiding all this... It makes the code unnecessarily complicated when you're not sure if this is a performance bottleneck or not... Common advice is to write the code as simple as possible first, then go back and optimize as needed using the profiler. This is where

Re: Split with python

2006-08-29 Thread bearophileHUGS
Norman Khine: I have a csv file which is has a field that has something like: text (xxx) text (text) (yyy) text (text) (text) (zzz) I would like to split the last '(text)' out and put it in a new column, so that I get: text,(xxx) text (text),(yyy) text (text) (text),(zzz) Maybe

Re: Split with python

2006-08-29 Thread Gabriel Genellina
At Tuesday 29/8/2006 20:31, tobiah wrote: I have a csv file which is has a field that has something like: But then this fails if there are commas in the data. I could split and join on ',' but then that fails when 'x' is either the first or last field. Are there tools in the csv module that

Re: newbe question about removing items from one file to another file

2006-08-29 Thread Simon Forman
[EMAIL PROTECTED] wrote: Anthra Norell wrote: Dexter, I looked at the format specification. It contains an example: --- CsoundSynthesizer; ; test.csd - a Csound structured data file CsOptions -W -d -o tone.wav /CsOptions

Re: Coding style and else statements

2006-08-29 Thread Carl Banks
tobiah wrote: def foo(thing): if thing: return thing + 1 else: return -1 def foo(thing): if thing: return thing + 1 return -1 Obviously both do the same thing. The first is possibly clearer, while the second is more

Re: subprocess woes

2006-08-29 Thread Simon Forman
Dennis Lee Bieber wrote: On Tue, 29 Aug 2006 18:17:47 +0530, km [EMAIL PROTECTED] declaimed the following in comp.lang.python: ##code start ## import subprocess as sp x = 'GSQIPSHYWKKNLWYYSHEIDGGCHNMW' p0 = sp.Popen([echo,x], stdout=sp.PIPE) Why use this at all? p1 =

Variables in nested functions

2006-08-29 Thread zero . maximum
Is it possible to change the value of a variable in the outer function if you are in a nested inner function? For example: def outer(): a = outer def inner(): print a a = inner # I'm trying to change the outer 'a' here, # but this

Re: NumPy 1.0b4 now available

2006-08-29 Thread [EMAIL PROTECTED]
Robert Kern wrote: [EMAIL PROTECTED] wrote: Travis E. Oliphant wrote: The 4th beta release of NumPy 1.0 has just been made available. NumPy 1.0 represents the culmination of over 18 months of work to unify the Numeric and Numarray array packages into a single best-of-breed array

Re: Variables in nested functions

2006-08-29 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: Is it possible to change the value of a variable in the outer function if you are in a nested inner function? The typical kludge is to wrap the variable in the outer function inside a mutable object, then pass it into the inner using a default argument: def outer():

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread alf
Fredrik Lundh wrote: http://www.catb.org/~esr/faqs/smart-questions.html#writewell /F and /F means? -- http://mail.python.org/mailman/listinfo/python-list

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-29 Thread Robert Kern
alf wrote: Fredrik Lundh wrote: http://www.catb.org/~esr/faqs/smart-questions.html#writewell /F and /F means? It's his signature. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as

Re: Questoin about outlook calendar

2006-08-29 Thread Roger Upole
Gallagher, Tim (NE) wrote : import win32com.client import time import datetime outlook = win32com.client.Dispatch(Outlook.Application) namespace = outlook.GetNamespace(MAPI) appointments = namespace.GetDefaultFolder(9).Items #print appointments.count x = 4 # This is a number for one of

Re: TNEF decoder

2006-08-29 Thread Simon Forman
David Isaac wrote: I'm aware of http://cheeseshop.python.org/pypi/pytnef/ but it uses the tnef utility, and I'd like a pure Python solution (along the lines of http://www.freeutils.net/source/jtnef/ ). Is there one? Thanks, Alan Isaac A place I once worked at had a project that included

Re: TNEF decoder

2006-08-29 Thread hg
Simon Forman wrote: David Isaac wrote: I'm aware of http://cheeseshop.python.org/pypi/pytnef/ but it uses the tnef utility, and I'd like a pure Python solution (along the lines of http://www.freeutils.net/source/jtnef/ ). Is there one? Thanks, Alan Isaac A place I once worked at had

Allowing ref counting to close file items bad style?

2006-08-29 Thread Dan
Is this discouraged?: for line in open(filename): do something with line That is, should I do this instead?: fileptr = open(filename) for line in fileptr: do something with line fileptr.close() Can I count on the ref count going to zero to close the file?

Re: What do you want in a new web framework?

2006-08-29 Thread Alex Martelli
Peter Maas [EMAIL PROTECTED] wrote: Cliff Wells wrote: On Wed, 2006-08-23 at 22:13 +0200, Peter Maas wrote: Alex Martelli wrote: [...] I have already suggested to the BDFL that he can remedy this situation in Py3k: all he has to do, of course, is to add a LOT more keywords. Here is

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Paul Rubin
Dan [EMAIL PROTECTED] writes: Is this discouraged?: for line in open(filename): do something with line Yes. Can I count on the ref count going to zero to close the file? You really shouldn't. It's a CPython artifact. I understand that the upcoming 'with' statement will

Re: block a network port

2006-08-29 Thread abcd
Larry Bates wrote: This is not really a Python question. Blocking ports is a function of your firewall solution. ok, no of any python solutions? or command-line firewalls? -- http://mail.python.org/mailman/listinfo/python-list

Re: refering to base classes

2006-08-29 Thread glenn
Chaz Ginger wrote: Chaz Ginger wrote: glenn wrote: hi - Im quite new to python, wondering if anyone can help me understand something about inheritance here. In this trivial example, how could I modify the voice method of 'dog' to call the base class 'creatures' voice method from with

Re: refering to base classes

2006-08-29 Thread glenn
Bruno Desthuilliers wrote: glenn wrote: hi - Im quite new to python, wondering if anyone can help me understand something about inheritance here. In this trivial example, how could I modify the voice method of 'dog' to call the base class 'creatures' voice method from with in it?

Re: block a network port

2006-08-29 Thread alex23
abcd wrote: ok, no of any python solutions? or command-line firewalls? You did try searching Google for python firewall, right? http://www.google.com.au/search?q=python+firewall The very first entry is a pointer to a solution for Windows. You really need to provide more information if you

Re: block a network port

2006-08-29 Thread Butternut Squash
abcd wrote: Larry Bates wrote: This is not really a Python question. Blocking ports is a function of your firewall solution. ok, no of any python solutions? or command-line firewalls? So now you're question is how to write a firewall in python? You can probably bind to all the ports

Re: refering to base classes

2006-08-29 Thread glenn
Hi Roberto If you want dog.voice() to just print voice: bark, you just have to omit the voice method for the dog class: it will be inherited from creature. I would have thought this would be correct, but in this case, plus in others im playin with, I get this issue: ---

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Dan
Paul Rubin wrote: Dan [EMAIL PROTECTED] writes: Is this discouraged?: for line in open(filename): do something with line Yes. Well, not what I wanted to hear, but what I expected. Thanks, Dan -- dedded att verizon dott net --

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread [EMAIL PROTECTED]
Paul Rubin wrote: Dan [EMAIL PROTECTED] writes: Is this discouraged?: for line in open(filename): do something with line Yes. Can I count on the ref count going to zero to close the file? You really shouldn't. It's a CPython artifact. I disagree, somewhat. No, you

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Paul Rubin
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: I disagree, somewhat. No, you shouldn't count on the ref count per se going to 0. And you shouldn't count on the file object being GC'd _immediately_ after the last reference is destroyed. You should be able to rely on it being GC'd at some point

Re: Issues with Installer written in Python for Linux

2006-08-29 Thread Stephan Kuhagen
[EMAIL PROTECTED] wrote: I am undertaking writing an installer for a software package using Python. It is exclusively for Linux. Because this is an installer and has to run on numerous Linux distros, it is presenting some unique challenges. I had the same problem to solve as you, and I hope,

Naming conventions (was: Re: refering to base classes)

2006-08-29 Thread Ben Finney
glenn [EMAIL PROTECTED] writes: Bruno Desthuilliers wrote: It might be better to use newstyle classes if you can. Also, the convention is to use CamelCase for classes names (unless you have a strong reason to do otherwise). Note that this style is more correctly called TitleCase, since

Releasing GIL in unknown state

2006-08-29 Thread Farshid Lashkari
Hi, Is there a proper way for C code to ensure that the GIL is released? I know about PyGILState_Ensure and PyGILState_Release, but that is to ensure the GIL is acquired. I have some extension code that does heavy processing and I want to release the GIL, but the code can't be sure that the

Re: Naming conventions (was: Re: refering to base classes)

2006-08-29 Thread Jean-Paul Calderone
On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney [EMAIL PROTECTED] wrote: glenn [EMAIL PROTECTED] writes: Bruno Desthuilliers wrote: It might be better to use newstyle classes if you can. Also, the convention is to use CamelCase for classes names (unless you have a strong reason to do

Re: unicode table of character implementation in python

2006-08-29 Thread Tim Roberts
Martin v. Löwis [EMAIL PROTECTED] wrote: In any case, somebody pointed you to the Unicode code blocks. I think these are Asian scripts (I may have missed some): 0530..058F; Armenian 0590..05FF; Hebrew ... This is a fabulously useful list, Martin. Did you get this from a web page? Can you tell

Re: Firewire comms using Python?

2006-08-29 Thread Tim Roberts
Fraggle69 [EMAIL PROTECTED] wrote: Does anyone have any idea of how I can use Python to get images from my firewire camera?? I am using python under winXP pro You can try http://videocapture.sourceforge.net. The web page focuses on USB webcams, but if it's using a standard XP interface

Re: Allowing ref counting to close file items bad style?

2006-08-29 Thread Fredrik Lundh
Dan wrote: Is this discouraged?: for line in open(filename): do something with line That is, should I do this instead?: fileptr = open(filename) for line in fileptr: do something with line fileptr.close() depends on the use case; in a small

Re: How to let a loop run for a while before checking for break condition?

2006-08-29 Thread Matimus
Claudio Grondi wrote: Sometimes it is known in advance, that the time spent in a loop will be in order of minutes or even hours, so it makes sense to optimize each element in the loop to make it run faster. One of instructions which can sure be optimized away is the check for the break

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-29 Thread Fredrik Lundh
Tim Peters wrote: OTOH, current versions of Python (and Perl) just curious, but all this use of ( Perl) mean that the Perl folks have implemented timsort ? /F -- http://mail.python.org/mailman/listinfo/python-list

[ python-Bugs-1545696 ] structmember T_LONG won't accept a python long

2006-08-29 Thread SourceForge.net
Bugs item #1545696, was opened at 2006-08-24 00:07 Message generated for change (Comment added) made by rupole You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1545696group_id=5470 Please note that this message will contain a full copy of the comment

<    1   2