Re: [ANN] NumPy 1.0b4 now available

2006-08-27 Thread bruce.who.hk
Hi, Travis I just wonder if NumPy 1.0b4 can get along with py2exe? Just a few weeks ago I made a application in Python. At first I used Numpy, it works OK, but I cannot pack it into a workable executable with py2exe and the XXX.log saied that numpy cannot find some module. I found some hints in

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

2006-08-27 Thread Anthra Norell
Eric, Having played around with problems of this kind for quite some time I find them challenging even if I don't really have time to get sidetracked. Your description of the problem makes it all the more challenging, because its 'expressionist' quality adds the challenge of guessing what you

Re: Firewire comms using Python?

2006-08-27 Thread Simon Forman
Fraggle69 wrote: > Hi, > 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 > > Cheers > Fraggle Have you tried google? Peace, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

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

2006-08-27 Thread Simon Forman
[EMAIL PROTECTED] wrote: > def simplecsdtoorc(filename): > file = open(filename,"r") > alllines = file.read_until("") > pattern1 = re.compile(" orcfilename = filename[-3:] + "orc" > for line in alllines: > if not pattern1 > print >>orcfilename, line > > I am

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread Robert Kern
Ray wrote: > fuzzylollipop wrote: >> uh, no, Python predates Ruby by a good bit >> Rails might be "older" than Turbogears but it still JUST went 1.0 >> officially. >> It can't be called "mature' by any defintition. > > But at least in most developers' perception, it is (not necessarily in > the ab

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread Simon Forman
Paul Rubin wrote: > "EP" <[EMAIL PROTECTED]> writes: > > Given that I am looking for matches of all files against all other > > files (of similar length) is there a better bet than using re.search? > > The initial application concerns files in the 1,000's, and I could use > > a good solution for a

Re: Problem of function calls from map()

2006-08-27 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>Well I guess if people wanted to argue for keeping the functionals this >>should be on the list ... > > > who's arguing ? > Please note that word "if", but you are surely aware that there havebeen suggestions that Python's functional programmin

Re: Python + Java Integration

2006-08-27 Thread Steve Holden
Chas Emerick wrote: > On Aug 23, 2006, at 11:50 AM, Ben Sizer wrote: [...] > > I was having a discussion with a friend of mine recently, where I told > him how depressed I became for a period after I realized that sales, > marketing, and perception are all that really matter in this kooky > tec

Re: Python + Java Integration

2006-08-27 Thread Steve Holden
Fredrik Lundh wrote: > Ben Sizer wrote: > > >>Java itself never deserved to be the 'next' anything anyway. > > > I've had a lot of developers come up to me and > say, "I haven't had this much fun in a long time. > It sure beats writing Cobol" -- James Gosling > > > "Java is Objec

Re: Segmentation Fault

2006-08-27 Thread Simon Forman
pycraze wrote: > I would like to ask a question. How do one handle the exception due to > Segmentation fault due to Python ? Our bit operations and arithmetic > manipulations are written in C and to some of our testcases we > experiance Segmentation fault from the python libraries. > > If i know h

Re: time.clock() going backwards??

2006-08-27 Thread Tim Roberts
"Tim Peters" <[EMAIL PROTECTED]> wrote: >[Giovanni Bajo[ >>> I experimented something very strange, a few days ago. I was debugging an >>> application at a customer's site, and the problem turned out to be that >>> time.clock() was going "backwards", that is it was sometimes >>> (randomically) ret

Re: eval() woes

2006-08-27 Thread Simon Forman
rdrink wrote: > n.n.h. (noob needs help) > Ok, I've been beating my head against this for a day... time to ask > others. > To explain things as simply as possible: > I am trying to use eval() to evaluate some simple equations, such as-- > pow(AB,2) > pow(AB,2)+A > pow(A+B,2) > pow(A+B,2)+A > and so

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread Ray
fuzzylollipop wrote: > uh, no, Python predates Ruby by a good bit > Rails might be "older" than Turbogears but it still JUST went 1.0 > officially. > It can't be called "mature' by any defintition. But at least in most developers' perception, it is (not necessarily in the absolute sense, but perh

Improve memory for success

2006-08-27 Thread NRI Events
Hello Everybody, * HAPPY GANESH CHATHURTHI * For any professional or business men memory & Focus are required. I found useful tips to improve Memory & concentration. http://www.nrievents.com/Jai%20Ganesh/Ganesh_Index.htm Thanks & Regards Reddy -- http://mail.python.org/mailman/listinfo/pytho

Re: ASN.1 encoder & decoder

2006-08-27 Thread Doug Stell
Thanks Paul. This is exactly the type andlevel of implementation that I was looking for. I will look at the other implementation again. On 25 Aug 2006 16:32:46 -0700, Paul Rubin wrote: >Doug Stell <[EMAIL PROTECTED]> writes: >> Can anyone provide guidance on building a

Re: Newbie Question. Class definitions on the fly.

2006-08-27 Thread Simon Forman
ishtar2020 wrote: > Hi everyone > > I'm sure this question is kinda stupid and has been answered a few > times before... but I need your help! > > I'm writing a small application where the user can analyze some text > based on a set of changing conditions , and right now I'm stuck on a > point whe

Re: import function from user defined modules

2006-08-27 Thread Simon Forman
groves wrote: > Can anybody give me an example of how to import a function of module X > in module y. And please if yu can use classes(Object oriented approach) > would be great. > > The problem is that I have created a text on canvas, and now I want > that whenever a user right clicks on it, the o

Segmentation Fault

2006-08-27 Thread pycraze
I would like to ask a question. How do one handle the exception due to Segmentation fault due to Python ? Our bit operations and arithmetic manipulations are written in C and to some of our testcases we experiance Segmentation fault from the python libraries. If i know how to handle the exception

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-27 Thread David Isaac
"Jacob Hallen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Unfortunately there is a side effect to slots. They change the behaviour of > the objects that have slots in a way that can be abused by control freaks > and static typing weenies. This is bad, because the contol freaks s

eval() woes

2006-08-27 Thread rdrink
n.n.h. (noob needs help) Ok, I've been beating my head against this for a day... time to ask others. To explain things as simply as possible: I am trying to use eval() to evaluate some simple equations, such as-- pow(AB,2) pow(AB,2)+A pow(A+B,2) pow(A+B,2)+A and so forth... for a variety of math o

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread Paddy
EP wrote: > Hi, > > I'm a bit green in this area and wonder to what extent there may be > some existing Python tools (or if I have to scratch my head real hard > for an appropriate algorithm... ) I'd hate to build an inferior > solution to that someone has painstakingly built before me. > > I hav

Mahogany mail

2006-08-27 Thread David Isaac
Somewhat OT: Just wondering if anyone is doing something cool with the Python support in Mahogany mail. If so, please describe it or post some code. Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question. Class definitions on the fly.

2006-08-27 Thread hiaips
ishtar2020 wrote: > Hi everyone > > I'm sure this question is kinda stupid and has been answered a few > times before... but I need your help! > > I'm writing a small application where the user can analyze some text > based on a set of changing conditions , and right now I'm stuck on a > point wh

Newbie Question. Class definitions on the fly.

2006-08-27 Thread ishtar2020
Hi everyone I'm sure this question is kinda stupid and has been answered a few times before... but I need your help! I'm writing a small application where the user can analyze some text based on a set of changing conditions , and right now I'm stuck on a point where I'd like to automatically gen

Newbie Question

2006-08-27 Thread ishtar2020
Hi everyone I'm sure this question is kinda stupid and has been answered a few times before... but I need your help! I'm writing a small application where the user can analyze some text based on a set of changing conditions , and right now I'm stuck on a point where I'd like to automatically gen

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

2006-08-27 Thread alf
Fredrik Lundh wrote: > "alf" <[EMAIL PROTECTED]> wrote: > > >>It turned out it is quite simple - I just install the python from >>python.org and all the libs needed. Then I take python2n.dll from >>c:\win*\system32 and move directly to PYTHONDIR. Then I can just tar/zip >>the PYTHON dir and distr

Re: Python-list Digest, Vol 35, Issue 410

2006-08-27 Thread namam0205
Thank you Fredrik for answering.Actually the  "form.py"  was copied from an example inside one of the URL for non-programmer provided by python.org documentation site. I'm not familiar with the method to convert an MD5 token to it original state inside form.py. So, if I try to authenticate using re

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-27 Thread Patrick Maupin
Jacob Hallen wrote: > Patrick Maupin <[EMAIL PROTECTED]> wrote: > >Also, as I noted, I _do_ use them on occasion, so if there really _are_ > >potential pitfalls there, I would like to understand exactly what they > >are, so my ears perk up whenever I notice a __slots__ discussion, but > >so far I

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread fuzzylollipop
[EMAIL PROTECTED] wrote: Looks like you mixing comparisons. > Ruby: > + More mature system. More stable? More features? uh, no, Python predates Ruby by a good bit Rails might be "older" than Turbogears but it still JUST went 1.0 officially. It can't be called "mature' by any defintition. > + M

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread Paul Rubin
"EP" <[EMAIL PROTECTED]> writes: > Given that I am looking for matches of all files against all other > files (of similar length) is there a better bet than using re.search? > The initial application concerns files in the 1,000's, and I could use > a good solution for a number of files in the 100,0

Re: Middle matching - any Python library functions (besides re)?

2006-08-27 Thread bearophileHUGS
If you want to avoid an O(n^2) algorithm, you may need to find a signature for each file. Then you use such signatures to compute hashes, and unique them with a dict (dict values may be the file names). Later you can weed out the few wrong collisions produced by the possibly approximated signature.

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

2006-08-27 Thread [EMAIL PROTECTED]
PetDragon wrote: > Sounds like you need to use html parser, check it out in the > documentation > > > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > def simplecsdtoorc(filename): > >file = open(filename,"r") > >alllines = file.read_until("") > >pattern1 = re.co

Re: Conway's Life Implementation

2006-08-27 Thread Andrew Trevorrow
"Putty" <[EMAIL PROTECTED]> wrote: > Hi. I was going to write an implementation of John Conway's Life game > using Python and Tk, but I soon found that Tk just didn't cut the > mustard for memory usage, management, and the like for such a project, > so I've found my best GUI bet for my project is

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

2006-08-27 Thread Tom Cole
Well you cross-posted this enough, including a Java group, and didn't even ask about us... What a pity. In Java, classes can implement the Comparable interface. This interface contains only one method, a compareTo(Object o) method, and it is defined to return a value < 0 if the Object is considere

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-27 Thread Jacob Hallen
In article <[EMAIL PROTECTED]>, Patrick Maupin <[EMAIL PROTECTED]> wrote: >I didn't actually sense any dander on your part, so it was probably a >bit unfortunate that I chose to respond to that particular message. I >do (rightly or wrongly) sense some dander on Aahz's part, and this was >the secon

Middle matching - any Python library functions (besides re)?

2006-08-27 Thread EP
Hi, I'm a bit green in this area and wonder to what extent there may be some existing Python tools (or if I have to scratch my head real hard for an appropriate algorithm... ) I'd hate to build an inferior solution to that someone has painstakingly built before me. I have some files which may ha

naive misuse?

2006-08-27 Thread johan2sson
The documentation for PyThreadState_SetAsyncExc says "To prevent naive misuse, you must write your own C extension to call this". Anyone care to list a few examples of such naive misuse? Johan -- http://mail.python.org/mailman/listinfo/python-list

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread Jonathan Ellis
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > P.S. If I wanted to provide an image by streaming the > > file data directly over the connection, rather than by > > referring to an image file, how would I do that? I'd > > like to build code that would allow images to be assembled > > into a sin

A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-27 Thread [EMAIL PROTECTED]
Last year, i've posted a tutorial and commentary about Python and Perl's sort function. (http://xahlee.org/perl-python/sort_list.html) In that article, i discussed a technique known among juvenile Perlers as the Schwartzian Transform, which also manifests in Python as its “key” optional parameter.

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

2006-08-27 Thread PetDragon
Sounds like you need to use html parser, check it out in the documentation <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > def simplecsdtoorc(filename): >file = open(filename,"r") >alllines = file.read_until("") >pattern1 = re.compile("orcfilename = filename[-

Re: Persistent Session in CGI

2006-08-27 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > Hi, > > I have started a new small web project, and was wondering if there are > any good guides on how to do Persistent Sessions and Authentication > using python and CGI. I don't really want too use Zope, because It's > probably overkill for my tiny project. You could

import function from user defined modules

2006-08-27 Thread groves
Can anybody give me an example of how to import a function of module X in module y. And please if yu can use classes(Object oriented approach) would be great. The problem is that I have created a text on canvas, and now I want that whenever a user right clicks on it, the option COMMAND should invo

import function from user defined modules

2006-08-27 Thread groves
Can anybody give me an example of how to import a function of module X in module y. And please if yu can use classes(Object oriented approach) would be great. The problem is that I have created a text on canvas, and now I want that whenever a user right clicks on it, the option COMMAND should invo

Re: Persistent Session in CGI

2006-08-27 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I have started a new small web project, and was wondering if there are > any good guides on how to do Persistent Sessions and Authentication > using python and CGI. I don't really want too use Zope, because It's > probably overkill for my tiny project. The simplest thin

Re: random writing access to a file in Python

2006-08-27 Thread Paul Rubin
Claudio Grondi <[EMAIL PROTECTED]> writes: > >>The Windows XP SP 2 '/> sort' (sorting of four Gigs of 20 byte records > >>took 12 CPU and 18 usual hours) > Ok, I see - the misunderstanding is, that there were 4.294.967.296 > records each 20 bytes long, what makes the actual file 85.899.345.920

Re: IDLE on Mac OS X

2006-08-27 Thread Kevin Walzer
Furbybrain wrote: > I'm running 10.3.9 and I've just installed Python 2.4. IDLE won't start- > it bounces in the dock once or twice then goes away. > I'm new to Python, and I'm trying to learn. Thanks. You need to install Tcl/Tk--it doesn't come with 10.3 by default. Get a Panther-compatible versio

Re: Persistent Session in CGI

2006-08-27 Thread Andre Meyer
Karrigell is a very easy-to-use pure-Python web framework. It has examples of session management.http://karrigell.sourceforge.net/regardsAndre On 27 Aug 2006 14:48:05 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:Hi,I have started a new small web project, and was wondering if there are any go

Persistent Session in CGI

2006-08-27 Thread keegan . csmith
Hi, I have started a new small web project, and was wondering if there are any good guides on how to do Persistent Sessions and Authentication using python and CGI. I don't really want too use Zope, because It's probably overkill for my tiny project. -- http://mail.python.org/mailman/listinfo/py

newbe question about removing items from one file to another file

2006-08-27 Thread [EMAIL PROTECTED]
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("") pattern1 = re.compile(">orcfilename, line I am pretty sure my code isn't close to what I want. I need to be able to skip html like commands from to and to key on another word in adition to to end

Re: IDLE on Mac OS X

2006-08-27 Thread Bill Hale
In article <[EMAIL PROTECTED]>, Furbybrain <[EMAIL PROTECTED]> wrote: > I'm running 10.3.9 and I've just installed Python 2.4. IDLE won't start- > it bounces in the dock once or twice then goes away. > I'm new to Python, and I'm trying to learn. Thanks. You might want to open the console window

Re: Conway's Life Implementation

2006-08-27 Thread [EMAIL PROTECTED]
Putty wrote: > Do you think it would be reasonable to use wxGrid to make the game > area? > > [EMAIL PROTECTED] wrote: > > Putty wrote: > > > Hi. I was going to write an implementation of John Conway's Life game > > > using Python and Tk, but I soon found that Tk just didn't cut the > > > mustard

Re: Pros/Cons of Turbogears/Rails?

2006-08-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > + Built-in Rubydoc system would make documenting the > system easier. (IMHO, developers almost always > underestimate the need for good documentation that > is written along withe the system.) Is there a > Python doc system that has received Guido's blessing > yet? afai

Re: Conway's Life Implementation

2006-08-27 Thread Putty
Do you think it would be reasonable to use wxGrid to make the game area? [EMAIL PROTECTED] wrote: > Putty wrote: > > Hi. I was going to write an implementation of John Conway's Life game > > using Python and Tk, but I soon found that Tk just didn't cut the > > mustard for memory usage, management

Re: multi-thread tutor

2006-08-27 Thread UrsusMaximus
fegge wrote: > would u like to recommand some to me/.? see http://www.awaretek.com/tutorials.html#thread -- http://mail.python.org/mailman/listinfo/python-list

Re: random writing access to a file in Python

2006-08-27 Thread Claudio Grondi
Paul Rubin wrote: > Claudio Grondi <[EMAIL PROTECTED]> writes: > >>The Windows XP SP 2 '/> sort' (sorting of four Gigs of 20 byte records >>took 12 CPU and 18 usual hours) has, from what I could observe on the >>task manager, done the job in only two runs of 'copying' : > > > That is terrible; o

IDLE on Mac OS X

2006-08-27 Thread Furbybrain
I'm running 10.3.9 and I've just installed Python 2.4. IDLE won't start- it bounces in the dock once or twice then goes away. I'm new to Python, and I'm trying to learn. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Conway's Life Implementation

2006-08-27 Thread [EMAIL PROTECTED]
Putty wrote: > Hi. I was going to write an implementation of John Conway's Life game > using Python and Tk, but I soon found that Tk just didn't cut the > mustard for memory usage, management, and the like for such a project, > so I've found my best GUI bet for my project is wxPython and not > py

Re: callable to disappear?

2006-08-27 Thread Bruno Desthuilliers
Georg Brandl a écrit : > Antoon Pardon wrote: > >> I have been reading http://www.python.org/dev/peps/pep-3100/ >> en there is written: >> >> To be removed: >> ... >> >> callable(): just call the object and catch the exception >> ... > > > >> Is there a chance this will be

Pros/Cons of Turbogears/Rails?

2006-08-27 Thread kenneth . m . mcdonald
First, I don't intend this to be a flame war, please. Python and Ruby are the only two languages I'd willingly work in (at least amongst common languages), and TurboGears and Rails seem roughly equivalent. I'm much more knowledgable about Python, but that's a minor issue--I've been intending to le

Re: Job Jar

2006-08-27 Thread Bruno Desthuilliers
D a écrit : > Hello, I apologize in advance for the vague description, but as of now > I only have an idea of what I'd like to do, and need some guidance as > to if it is feasible, and where to begin. Basically, I'd like to > create a web-based "job jar", that users in my office can access in > or

Conway's Life Implementation

2006-08-27 Thread Putty
Hi. I was going to write an implementation of John Conway's Life game using Python and Tk, but I soon found that Tk just didn't cut the mustard for memory usage, management, and the like for such a project, so I've found my best GUI bet for my project is wxPython and not pygame. Anybody have any

Re: Help in using introspection to simplify repetitive code

2006-08-27 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > As you mention, wether the methods take arguments or not is something > to have into account. > And they do take arguments, and a variable number of them, so AFAIK > hooking with __getattr__ or __getattribute__ will not work, as you can > only get the method name with

multi-thread tutor

2006-08-27 Thread fegge
would u like to recommand some to me/.? -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble understanding inheritance...

2006-08-27 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : (snip) > class BaseClass(): > def foo(self): > return "foo" > > class Foo(BaseClass): > def foo(self): > return self.__class__.foo() # call the parent class method Err... May I suggest that you re-read the Fine Manual ? -- http://mail.python.org/

Re: Learning Python - Have Question.

2006-08-27 Thread AlbaClause
Tal Einat wrote: > iapain wrote: >> First thing you have to remember while using python is "everything is >> an object". os.join.path concatenates one or more path for example >> os.path.join("c:", "myfolder") represent a path relative to current dir >> on c: drive. >> > > Actually, os.path.join

Re: Very weird behavior that's driving me crazy

2006-08-27 Thread Bruno Desthuilliers
Pupeno a écrit : (snip) > > and then I have another module called SensorSingleton that emulates the > hard-to-code-on-python singleton (snip) What do you mean "hard to code on python singleton" ? -- http://mail.python.org/mailman/listinfo/python-list

Re: avoiding file corruption

2006-08-27 Thread Duncan Booth
Dennis Lee Bieber wrote: > On Sun, 27 Aug 2006 14:41:05 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> MS Windows seems to do something similar, and it pisses me off >> no end. Trying to open a file and read it while somebody else >> has it open

Re: Learning Python

2006-08-27 Thread [EMAIL PROTECTED]
Tal Einat wrote: > Duncan Booth wrote: > > JAG CHAN wrote: > > > > > Whenever I try to open IDLE, my zone firewall tells me pythonw.exe is > > > trying to access the trusted zone. > > > Whenever I try to open new IDLE window I get the following message: > > > "IDLE's subprocess didn't make connect

Re: random writing access to a file in Python

2006-08-27 Thread Paul Rubin
Claudio Grondi <[EMAIL PROTECTED]> writes: > The Windows XP SP 2 '/> sort' (sorting of four Gigs of 20 byte records > took 12 CPU and 18 usual hours) has, from what I could observe on the > task manager, done the job in only two runs of 'copying' : That is terrible; on a reasonably fast machine th

[ANN] StandOut 3.0.0 Released

2006-08-27 Thread Fuzzyman
There is a new release of `StandOut `_, the flexible output object. This version is a complete rewrite, with a *full* set of `unit tests `_. *standout* is a mod

Re: Defining constant strings

2006-08-27 Thread danielx
I would really like to highlight something Tal has already said: Python strings are immutable. That means if you construct a string object, you don't have to worry about someone else going in and changing that object. What might happen, however, is that someone might reassign a variable you have wh

Re: Defining constant strings

2006-08-27 Thread Peter Otten
Hans wrote: > I want to define a couple of constant strings, like in C: > #define mystring "This is my string" > or using a const char construction. > > Is this really not possible in Python? No, this is not really not possible in Python: $ ls preprocess.pyp $ cat preprocess.pyp #define MYSTRIN

Re: Weekly Python Patch/Bug Summary

2006-08-27 Thread Georg Brandl
Fredrik Lundh wrote: > Kurt B. Kaiser wrote: > >> Patch / Bug Summary >> ___ >> >> Patches : 407 open ( +3) / 3393 closed (+17) / 3800 total (+20) >> Bugs: 888 open (+28) / 6145 closed (+14) / 7033 total (+42) >> RFE : 232 open ( +3) / 236 closed ( +1) / 468 tot

Re: Defining constant strings

2006-08-27 Thread Tal Einat
Hans wrote: > Hi, > > I want to define a couple of constant strings, like in C: > #define mystring "This is my string" > or using a const char construction. > > Is this really not possible in Python? > > Hans One last note: If you truly insist on having constant variables, you could write a class

Re: Defining constant strings

2006-08-27 Thread Tal Einat
Hans wrote: > Hi, > > I want to define a couple of constant strings, like in C: > #define mystring "This is my string" > or using a const char construction. > > Is this really not possible in Python? > > Hans It is really not possible. The Pythonic way (as far as I have come to know it) is to st

Re: avoiding file corruption

2006-08-27 Thread Grant Edwards
On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> wrote: > How often do you need to open a file multiple times for writing? Not very often, but I don't think it should be illegal. That's probably a result of being a 25 year user of Unix where it's assumed that the user knows what he's doing. > A

Firewire comms using Python?

2006-08-27 Thread Fraggle69
Hi, 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 Cheers Fraggle -- http://mail.python.org/mailman/listinfo/python-list

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

2006-08-27 Thread Diez B. Roggisch
Fredrik Lundh schrieb: > Diez B. Roggisch wrote: > > > No doubt that changing the flag asynchronously is a gain by delegating > > the timing code to the OS. Yet the while loop still has a condition - > > you could as well set a flag in the signal handler an do it like this: > > if the OP is ob

Defining constant strings

2006-08-27 Thread Hans
Hi,   I want to define a couple of constant strings, like in C: #define mystring "This is my string" or using a const char construction.   Is this really not possible in Python?   Hans -- http://mail.python.org/mailman/listinfo/python-list

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Grant Edwards wrote: > Amir Michail wrote: > >> Trying to open a file for writing that is already open for writing >> should result in an exception. > > MS Windows seems to do something similar, and it pisses me off > no end. Trying to open a file and read it while somebody else > has it open f

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

2006-08-27 Thread Fredrik Lundh
Diez B. Roggisch wrote: > No doubt that changing the flag asynchronously is a gain by delegating > the timing code to the OS. Yet the while loop still has a condition - > you could as well set a flag in the signal handler an do it like this: if the OP is obsessed with performance, why are you

Re: creating multiply arguments for a method.

2006-08-27 Thread John Roth
noro wrote: > Hi all, > > I use a method that accept multiply arguments ("plot(*args)"). > so plot([1,2,3,4]) is accepted and plot([1,2,3,4],[5,6,7,8]) is also > accepted. > > the problem is that i know the number of arguments only at runtime. > Let say that during runtime i need to pass 4 argumen

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Paddy wrote: > I've never done this in anger so feel free to mock (a little :-). > > I'd have a fixed field at the beginning of the field that can hold the > hostname process number, and access time of a writing process, togeher > with a sentinal value that means "no process has access to the file

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Grant Edwards wrote: > On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> wrote: > > > Trying to open a file for writing that is already open for writing > > should result in an exception. > > MS Windows seems to do something similar, and it pisses me off > no end. Trying to open a file and read it

Re: avoiding file corruption

2006-08-27 Thread Tim Scheidemantle
Amir Michail wrote: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. Look at fcntl module, I use it in a class to control access from within my processes. I don't think this functionality should be inherent to python though. Keep in mind

Re: avoiding file corruption

2006-08-27 Thread Grant Edwards
On 2006-08-27, Amir Michail <[EMAIL PROTECTED]> wrote: > Trying to open a file for writing that is already open for writing > should result in an exception. MS Windows seems to do something similar, and it pisses me off no end. Trying to open a file and read it while somebody else has it open f

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

2006-08-27 Thread Diez B. Roggisch
Fredrik Lundh schrieb: > Diez B. Roggisch wrote: > >> A while loop has a condition. period. The only thing to change that is >> to introduce a uncoditioned loop, and use self-modifying code to make >> it a while-loop after that timer interrupt of yours. > > or use a timer interrupt to interrupt

Re: avoiding file corruption

2006-08-27 Thread Bryan Olson
Amir Michail wrote: > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corruption errors. The right solution is file locking.

Re: Weekly Python Patch/Bug Summary

2006-08-27 Thread Fredrik Lundh
Kurt B. Kaiser wrote: > Patch / Bug Summary > ___ > > Patches : 407 open ( +3) / 3393 closed (+17) / 3800 total (+20) > Bugs: 888 open (+28) / 6145 closed (+14) / 7033 total (+42) > RFE : 232 open ( +3) / 236 closed ( +1) / 468 total ( +4) could this script per

Re: avoiding file corruption

2006-08-27 Thread Diez B. Roggisch
Amir Michail schrieb: > Diez B. Roggisch wrote: >> Amir Michail schrieb: >>> Paolo Pantaleo wrote: 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. >

Weekly Python Patch/Bug Summary

2006-08-27 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 407 open ( +3) / 3393 closed (+17) / 3800 total (+20) Bugs: 888 open (+28) / 6145 closed (+14) / 7033 total (+42) RFE : 232 open ( +3) / 236 closed ( +1) / 468 total ( +4) New / Reopened Patches __ most miss

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

2006-08-27 Thread Claudio Grondi
Fredrik Lundh wrote: > Diez B. Roggisch wrote: > >> A while loop has a condition. period. The only thing to change that is >> to introduce a uncoditioned loop, and use self-modifying code to make >> it a while-loop after that timer interrupt of yours. > > > or use a timer interrupt to interrup

Re: creating multiply arguments for a method.

2006-08-27 Thread Fredrik Lundh
noro wrote: > Let say that during runtime i need to pass 4 arguments, each is a list, > creating a set of lists and passing it to the method wont word since > the interpartor thinks it is only 1 argument the contain a reference to > a "list of lists", instede of number of arguments, each is a list

creating multiply arguments for a method.

2006-08-27 Thread noro
Hi all, I use a method that accept multiply arguments ("plot(*args)"). so plot([1,2,3,4]) is accepted and plot([1,2,3,4],[5,6,7,8]) is also accepted. the problem is that i know the number of arguments only at runtime. Let say that during runtime i need to pass 4 arguments, each is a list, creatin

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

2006-08-27 Thread Claudio Grondi
Diez B. Roggisch wrote: >> The idea is to speed up a loop by using a timer interrupt interfering >> with the loop, so that only after the timer interrupt would occur, the >> loop will start to check its break condition in each iteration. >> No checking of any kind in the loop should happen up to

Re: avoiding file corruption

2006-08-27 Thread Amir Michail
Diez B. Roggisch wrote: > Amir Michail schrieb: > > Paolo Pantaleo wrote: > >> 27 Aug 2006 00:44:33 -0700, Amir Michail <[EMAIL PROTECTED]>: > >>> Hi, > >>> > >>> Trying to open a file for writing that is already open for writing > >>> should result in an exception. > >>> > >>> It's all too easy t

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

2006-08-27 Thread Fredrik Lundh
Diez B. Roggisch wrote: > A while loop has a condition. period. The only thing to change that is > to introduce a uncoditioned loop, and use self-modifying code to make it > a while-loop after that timer interrupt of yours. or use a timer interrupt to interrupt the loop: import signal, time d

Re: MapReduce, Distributed Computing, and Ruby

2006-08-27 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] .rufy.com/2006/08/mapreduce-for-ruby-ridiculously-easy.html > > Consider bugging this guy to release the code. > http://agentmine.com/blog/2005/11/30/mapreduce-in-python WARNING This site downloaded IExplore trojan VBS/Psyme. VirusScan

Re: avoiding file corruption

2006-08-27 Thread Paddy
Amir Michail wrote: > Hi, > > Trying to open a file for writing that is already open for writing > should result in an exception. > > It's all too easy to accidentally open a shelve for writing twice and > this can lead to hard to track down database corruption errors. > > Amir I've never done th

Re: unpaking sequences of unknown length

2006-08-27 Thread Gerard Flanagan
Anthra Norell wrote: > Hi, > >I keep working around a little problem with unpacking in cases in which I > don't know how many elements I get. Consider this: > > def tabulate_lists (*arbitray_number_of_lists): > table = zip (arbitray_number_of_lists) > for record

  1   2   >