Re: Project organization and import

2007-03-05 Thread Martin Unsal
On Mar 5, 3:11 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Your own experience *with Python* ? No, my experience with Visual Basic. ;) Of course my experience with Python! Sorry, I can continue writing snarky replies to your snarky comments but that won't get us anywhere productive. Ins

Re: worker thread catching exceptions and putting them in queue

2007-03-05 Thread Paul Sijben
Stargaming & Diez, thanks very much! Stargaming wrote: > Paul Sijben schrieb: >> All, >> >> in a worker thread setup that communicates via queues is it possible to >> catch exceptions raised by the worker executed, put them in an object >> and send them over the queue to another thread where the

Re: Graphviz Python Binding for Python 2.5 on Windows?

2007-03-05 Thread Nick Vatamaniuc
On Mar 5, 5:16 pm, "Alex Li" <[EMAIL PROTECTED]> wrote: > Hello, > > I would like to use Python 2.5 on Windows with Graphviz to generate > graphs. I used yapgvb but it only requires Python 2.4 (won't work > with Python 2.5). Other packages like pydot seems to be unmaintained > or requires custom

Re: Project organization and import

2007-03-05 Thread Martin Unsal
On Mar 5, 11:06 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > I never advocated big files with many functional units - just files > that are "just big enough". Then we're in total agreement. I'm not sure why you thought my opinions were the result of baggage from other languages when you don't s

Re: How to Read Bytes from a file

2007-03-05 Thread Hendrik van Rooyen
"Bart Ogryczak" <[EMAIL PROTECTED]> wrote: > On Mar 5, 10:51 am, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > > > "Bart Ogryczak" <[EMAIL PROTECTED]> (BO) wrote: > > >BO> Any system with 8-bit bytes, which would mean any system made after > > >BO> 1965. I'm not aware of any Python implement

Re: How to Read Bytes from a file

2007-03-05 Thread Hendrik van Rooyen
"Piet van Oostrum" <[EMAIL PROTECTED]> wrote: > > "Bart Ogryczak" <[EMAIL PROTECTED]> (BO) wrote: > > >BO> Any system with 8-bit bytes, which would mean any system made after > >BO> 1965. I'm not aware of any Python implementation for UNIVAC, so I > >BO> wouldn't worry ;-) > > 1965? I worked

Re: package_data question

2007-03-05 Thread bytecolor
On Mar 5, 3:52 pm, "Goldfish" <[EMAIL PROTECTED]> wrote: > On Mar 5, 1:56 am, "bytecolor" <[EMAIL PROTECTED]> wrote: > I have a package along with a samples section. I have both a setup.py > script along with a MANIFEST.in file to make sure everything gets in. > You can see both of the files > at

Re: This web site creates a *popup window* => how fetch contents in a script?

2007-03-05 Thread Gabriel Genellina
En Tue, 06 Mar 2007 03:18:23 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > The following web page puts a report in a *popup window* by clicking > the "Generate Report" button > > http://moneycentral.msn.com/investor/research/printrep.asp?Symbol=BBBY > > How can I grab this pop win

This web site creates a *popup window* => how fetch contents in a script?

2007-03-05 Thread [EMAIL PROTECTED]
The following web page puts a report in a *popup window* by clicking the "Generate Report" button http://moneycentral.msn.com/investor/research/printrep.asp?Symbol=BBBY How can I grab this pop window page in a python script? (It doesn't seem to have a URL!?!) chris -- http://mail.python.or

Re: Project organization and import

2007-03-05 Thread Alex Martelli
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >>I don't reload... When my investigative tests gets bigger I write a script > >>and run it with the interpreter. It is easy since my text editor can call > >>Python on a buffer (I use Emacs). > > > > That's interesting, is this workflow pretty

Re: Graphviz Python Binding for Python 2.5 on Windows?

2007-03-05 Thread Alex Li
Thanks Michel, I will give it a try. Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Islam, the Religion of Ease

2007-03-05 Thread ce
On Mar 6, 12:27 pm, [EMAIL PROTECTED] wrote: > Excuse me!! > Would you stop for a moment?! > O...man...Haven't you thought-one day- about yourself ? > Who has made it? > Have you seen a design which hasn't a designer ?! > Have you seen a wonderful,delicate work without a worker ?! > It's you and th

Re: Python Source Code Beautifier

2007-03-05 Thread Gabriel Genellina
En Mon, 05 Mar 2007 07:07:57 -0300, Alan Franzoni <[EMAIL PROTECTED]> escribió: > Il Sat, 03 Mar 2007 17:34:35 +1300, greg ha scritto: > >> This was all discussed at *very* great length many >> years ago, and the addition of in-place operators >> to the language was held up for a long time until

Islam, the Religion of Ease

2007-03-05 Thread lovelydiab
Excuse me!! Would you stop for a moment?! O...man...Haven't you thought-one day- about yourself ? Who has made it? Have you seen a design which hasn't a designer ?! Have you seen a wonderful,delicate work without a worker ?! It's you and the whole universe!.. Who has made them all ?!! You know who

Re: CherryPy + Database questions

2007-03-05 Thread [EMAIL PROTECTED]
On Mar 5, 8:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Brian Blais wrote: > > Hello, > > > I have more of a conceptual question about the way databases work, in a > > web > > framework, but I will be implementing things with CherryPy and SQLAlchemy. > > If you make a web form that adds

Re: how can I find out the value of an environment variable?

2007-03-05 Thread MonkeeSage
On Mar 5, 8:22 pm, "ken" <[EMAIL PROTECTED]> wrote: > how can I find out the value of an environment variable in my pythong > script? > > Thank you. RTFM... os.getenv http://docs.python.org/lib/os-procinfo.html Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is every number in a list in a range?

2007-03-05 Thread MonkeeSage
On Mar 5, 9:19 pm, Paul Rubin wrote: > OK, I didn't read the question that way. I thought the person just > wanted a yes or no answer to whether the list contained any elements > outside the desired range. If the purpose is to select the elements > in the range, then us

Re: Descriptor/Decorator challenge

2007-03-05 Thread George Sakkis
On Mar 5, 2:31 am, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > I had an idea but no time to think it through. > Perhaps the under-under name mangling trick > can be replaced (in Py3.0) with a suitably designed decorator. > Your challenge is to write the decorator. > Any trick in the book (met

Re: Is every number in a list in a range?

2007-03-05 Thread Paul Rubin
"MonkeeSage" <[EMAIL PROTECTED]> writes: > If you want to preserve the items after 46, then you can't just bail > when you see 46. You need to keep looking at the following values and > comparing them against the boundry conditions. If the the input is > sequential, then this isn't a problem, as al

Re: ANN: PyDSTool now compatible with numpy 1.0.1, scipy 0.5.2 and 64-bit CPUs.

2007-03-05 Thread Rob Clewley
This kind of comment comes up often, so I think it's worth spelling out a response that will persist on the web and can appear in our FAQ. I have a different and admittedly limited view of hybrid systems as part of dynamical systems theory. In principle, I would love to have time to write an inter

Re: pop method question

2007-03-05 Thread Gabriel Genellina
En Sat, 03 Mar 2007 19:55:16 -0300, Steven D'Aprano <[EMAIL PROTECTED]> escribió: > I personally don't see that pop has any advantage, especially since the > most useful example > > while some_dict: > do_something_with(some_dict.pop()) > > doesn't work. Instead you have to write this: For s

Re: Is every number in a list in a range?

2007-03-05 Thread MonkeeSage
On Mar 5, 9:03 pm, Paul Rubin wrote: > Maybe I didn't undrestand the question. Say maxnum is 30 in your > example above. Then as soon as 46 is seen, you can stop checking, I > thought. Yes, as long as 29 doesn't follow 46. inlist = [1, 5, 23, 46, 29, 21] If you want

Re: Is every number in a list in a range?

2007-03-05 Thread Paul Rubin
"MonkeeSage" <[EMAIL PROTECTED]> writes: > > This genexp is better than a loop because it bails out immediately > > if it finds an out-of-range x. > > That's true: assuming that input is sequential. But if it's farily > random (e.g., [10, 20, 12, 46, 202, 5, 102]), then you need a loop/ > list com

Re: Is every number in a list in a range?

2007-03-05 Thread MonkeeSage
On Mar 5, 7:24 pm, Paul Rubin wrote: > This genexp is better than a loop because it bails out immediately > if it finds an out-of-range x. That's true: assuming that input is sequential. But if it's farily random (e.g., [10, 20, 12, 46, 202, 5, 102]), then you need a loo

Re: classes and functions

2007-03-05 Thread Gabriel Genellina
En Sat, 03 Mar 2007 17:04:33 -0300, Arnaud Delobelle <[EMAIL PROTECTED]> escribió: > On Mar 2, 11:01 pm, Nicholas Parsons <[EMAIL PROTECTED]> > wrote: >> That is the beauty of using Python. You have a choice of using >> classes and traditional OOP techniques or sticking to top level >> function

Re: Python GUI + OpenGL

2007-03-05 Thread David Boddie
On Monday 05 March 2007 18:22, Chris Mellon wrote: > On 3/5/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> Beside that, I do love the Qt library and would always use it in >> preference to wx, but this is a general thing and by no means tied to the >> OpenGL-programming. After all, that actual

how can I find out the value of an environment variable?

2007-03-05 Thread ken
how can I find out the value of an environment variable in my pythong script? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Read Bytes from a file

2007-03-05 Thread Gabriel Genellina
En Fri, 02 Mar 2007 08:22:36 -0300, Bart Ogryczak <[EMAIL PROTECTED]> escribió: > On Mar 1, 7:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: >> Thanks Bart. That's perfect. The other suggestion was to precompute >> count1 for all possible bytes, I guess that's 0-256, right? > > 0-255

Re: Webserver balance load

2007-03-05 Thread Jeff McNeil
If you're willing to spend some serious dollars, there are also hardware products out there that do this type of stuff. We run a few F5 6800 E systems. I've come to love their iRules feature - a TCL-based event driven scripting system for network traffic. RAM cache, SSL offload, and so on. They'l

Re: PyQt4: Clickable links in QLabel?

2007-03-05 Thread David Boddie
On Thursday 01 March 2007 09:00, Tina I wrote: > A short and sweet question: Is it possible to put a clickable link in a > QLabel that will open in the systems default browser? Yes. > I tried to put in some HTML but it did (of course?) simply display the > code instead of a link. I also tried to

Re: Webserver balance load

2007-03-05 Thread Michael
Johny wrote: > Can anyone suggest a way how to balance load on Apache server where I > have Python scripts running? > For example I have 3 webservers( Apache servers) and I would like to > sent user's request to one of the three server depending on a load on > the server. To be honest, you're bes

Re: Getting stdout from ctypes module

2007-03-05 Thread Gabriel Genellina
En Fri, 02 Mar 2007 07:54:55 -0300, Massi <[EMAIL PROTECTED]> escribió: > Hi everyone, I have a program which is written in C and interfaced > with python via > Ctypes. The functions I call print stuff out to the console, using > the usual function printf. I would like to know if it is possible t

Re: Is every number in a list in a range?

2007-03-05 Thread Paul Rubin
"Steven W. Orr" <[EMAIL PROTECTED]> writes: > I have a list ll of intergers. I want to see if each number in ll is > within the range of 0..maxnum > > I can write it but I was wondering if there's a better way to do it? if all(0 <= x <= maxnum for x in ll): ... This genexp is better than a loop

Re: Is every number in a list in a range?

2007-03-05 Thread Matimus
On Mar 5, 1:34 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > On Mar 5, 11:03 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > > > I have a list ll of intergers. I want to see if each number in ll is > > within the range of 0..maxnum > > > I can write it but I was wondering if there's a better way to d

Re: Interface Implementation in Python

2007-03-05 Thread MonkeeSage
On Mar 5, 6:25 pm, [EMAIL PROTECTED] wrote: > Hi, > > I would like to know the interface concept in Python.How the > Interface is defined and implemented in Python?. > > How to access the interface fromn Client? > > Thanks > PSB Not sure exactly what you mean, but in python (like most dynamic lan

Re: Dialog with a process via subprocess.Popen blocks forever

2007-03-05 Thread Gabriel Genellina
En Fri, 02 Mar 2007 14:38:59 -0300, Donn Cave <[EMAIL PROTECTED]> escribió: > In article <[EMAIL PROTECTED]>, > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > >> On http://docs.python.org/lib/popen2-flow-control.html there are some >> notes on possible flow control problems you may encounter.

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Adam Atlas
Okay, here's the prototype... It's meant to be run as a command line program (pass it a directory or a zip file as an argument). By default it will save the new file to the argument's base name plus '.pyc'. You can override this with -o. Obviously it'

Interface Implementation in Python

2007-03-05 Thread p_shakil
Hi, I would like to know the interface concept in Python.How the Interface is defined and implemented in Python?. How to access the interface fromn Client? Thanks PSB -- http://mail.python.org/mailman/listinfo/python-list

persistent fifo queue class

2007-03-05 Thread David Bear
I'm looking to see if there are any examples or prewritting fifo queue classes. I know this is a broad topic. I'm looking to implement a simple application where a web server enqueue and pickle using a local socket on to a 'queue server' -- and then I will have another application dequeue the pickl

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread MonkeeSage
Stef, What Adam is talking about has nothing to do with windows or *nix. He's talking about packing one or more .py files into a single archive, which can be imported just like the regular .py files. This means you can distribute a whole bunch of module files/dirs as a single .pyc file. It just ma

Re: Graphviz Python Binding for Python 2.5 on Windows?

2007-03-05 Thread M�ta-MCI
Hi! You can also use/call GraphViz by COM. It's run OK with P2.3 - 2.4 & 2.5 @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Paul Boddie
Stef Mientki wrote: > > As a normal Windows user, >I'm used to run an install file, > and hit just 1 button. > As a normal Windows programmer, >I'm used to create a simple Inno-setup file, > and my users can behave as a simplistic and happy Windows user. > > But I guess the needed

Re: ANN: PyDSTool now compatible with numpy 1.0.1, scipy 0.5.2 and 64-bit CPUs.

2007-03-05 Thread [EMAIL PROTECTED]
On Mar 2, 12:07 pm, "Rob Clewley" <[EMAIL PROTECTED]> wrote: > Mike, > > Yes, that is a pretty fair description of our support for symbolics > using Python's own inheritance. Our ModelSpec classes provide only an > elementary form of inheritance, polymorphism and type checking. We > hope to expand

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Bruno Desthuilliers
Stef Mientki a écrit : > Adam Atlas wrote: > >> Ah... heh, sorry, I misread your message as "a much more convenient >> way" rather than "much more than a convenient way". Anyway, I >> understand that, and I do indeed find setuptools useful and use it on >> a regular basis. >> >> But my other point

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Bruno Desthuilliers
Adam Atlas a écrit : > Ah... heh, sorry, I misread your message as "a much more convenient > way" rather than "much more than a convenient way". !-) (snip) > But my other points still stand. Indeed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is every number in a list in a range?

2007-03-05 Thread Bruno Desthuilliers
MonkeeSage a écrit : > On Mar 5, 1:03 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > >>I have a list ll of intergers. I want to see if each number in ll is >>within the range of 0..maxnum > > > How about: > > maxnum = 100 > inlist = range(90, 120) > for i in [i for i in inlist if i >= 0 and i

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread MonkeeSage
Adam, Sounds like a nice idea to me. Pretty ingenious use of the zip/ bytecode headers and all too. Post a message when you release it please. Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: Project organization and import

2007-03-05 Thread Bruno Desthuilliers
Martin Unsal a écrit : > On Mar 5, 9:15 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: (snip) > There are myriad other benefits of breaking up large files into > functional units. Integration history, refactoring, reuse, as I > mentioned. Better clarity of design. Easier communication and > coordina

Re: Is every number in a list in a range?

2007-03-05 Thread MonkeeSage
On Mar 5, 1:03 pm, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I have a list ll of intergers. I want to see if each number in ll is > within the range of 0..maxnum How about: maxnum = 100 inlist = range(90, 120) for i in [i for i in inlist if i >= 0 and i <= maxnum]: # do something with i, i

Re: Is every number in a list in a range?

2007-03-05 Thread bearophileHUGS
Steven W. Orr: > I have a list ll of intergers. I want to see if each number in ll is > within the range of 0..maxnum One possible nice solution (Python V.2.5): data = [1, 20, 22, 11, 400, 7] maxnum = 100 print all(0 <= x <= maxnum for x in data) maxnum = 1000 print all(0 <= x <= maxnum for x in

Graphviz Python Binding for Python 2.5 on Windows?

2007-03-05 Thread Alex Li
Hello, I would like to use Python 2.5 on Windows with Graphviz to generate graphs. I used yapgvb but it only requires Python 2.4 (won't work with Python 2.5). Other packages like pydot seems to be unmaintained or requires custom building to be used on Windows (pygraphviz), which I tried to avoid

Re: Make instance global -- possbile?

2007-03-05 Thread Arnaud Delobelle
On Mar 5, 10:00 pm, [EMAIL PROTECTED] wrote: > Rather new to OOP in Python... > > I'm writing an app where several objects need to access and change the > state of ONE instance. > > I could of course instantiate the instance and then pass it along the > objects, but that's cumbersome, especially as

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Stef Mientki
Adam Atlas wrote: > Ah... heh, sorry, I misread your message as "a much more convenient > way" rather than "much more than a convenient way". Anyway, I > understand that, and I do indeed find setuptools useful and use it on > a regular basis. > > But my other points still stand. This would be a mo

Re: Project organization and import

2007-03-05 Thread Bruno Desthuilliers
Martin Unsal a écrit : (snip) > When refactoring, it's much better to move small files around than to > move chunks of code between large files. Indeed. But having hundreds or thousands of files each with at most a dozen lines of effective code is certainly not an ideal. Remember that Python let

Make instance global -- possbile?

2007-03-05 Thread erokar
Rather new to OOP in Python... I'm writing an app where several objects need to access and change the state of ONE instance. I could of course instantiate the instance and then pass it along the objects, but that's cumbersome, especially as it would need to be "passed through" classes that don't

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Adam Atlas
Ah... heh, sorry, I misread your message as "a much more convenient way" rather than "much more than a convenient way". Anyway, I understand that, and I do indeed find setuptools useful and use it on a regular basis. But my other points still stand. This would be a moot point if setuptools were pa

Re: Project organization and import

2007-03-05 Thread Bruno Desthuilliers
Martin Unsal a écrit : > On Mar 5, 12:45 am, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > >>Remember that you can put code in >>the __init__.py of a package, and that this code can import sub- >>packages/modules namespaces, making the package internal organisation >>transparent to user code

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Adam Atlas
This could be easily made into a distutils extension (which was my intention all along, though that's not implemented yet). That's not the point. This is not intended as a "way to package source code". It's analogous to bdist, not sdist. The convenience gain is for the users, not (primarily) the de

Re: Is every number in a list in a range?

2007-03-05 Thread Matimus
On Mar 5, 11:03 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > I have a list ll of intergers. I want to see if each number in ll is > within the range of 0..maxnum > > I can write it but I was wondering if there's a better way to do it? > > TIA > > -- > Time flies like the wind. Fruit flies like

Re: Squisher -- a lightweight, self-contained alternative to eggs?

2007-03-05 Thread Bruno Desthuilliers
Adam Atlas a écrit : (snip) > If you make a ZIP archive of > this and run it through Squisher, you'll get a single .pyc file which > can be imported by any Python installation anywhere just like any > other module, without requiring users to install any supporting > mechanisms (like setuptools), s

Re: Newbie question

2007-03-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Mar 5, 9:03 am, Stargaming <[EMAIL PROTECTED]> wrote: > >>Tommy Grav schrieb: > > >>For this case, there are list comprehensions (or map, but you shouldn't >>use it any longer): > > > > I didn't see anything in the docs about this. Is map going away or is > i

Re: Newbie question

2007-03-05 Thread Bruno Desthuilliers
Tommy Grav a écrit : > Hi list, > >this is somewhat of a newbie question that has irritated me for a > while. > I have a file test.txt: > > 0.3434 0.5322 0.3345 > 1.3435 2.3345 5.3433 > > and this script > lines = open("test.txt","r").readlines() > for line in lines: >(xin,yin,zin) =

Is every number in a list in a range?

2007-03-05 Thread Steven W. Orr
I have a list ll of intergers. I want to see if each number in ll is within the range of 0..maxnum I can write it but I was wondering if there's a better way to do it? TIA -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0. happened but none stranger than this. Do

ABC with Linux

2007-03-05 Thread Avi Anu
Im tryin to make ABC (a bitorrent client) work under linux. I installed everything, that is ABC, wxpython, glib and gtk, and now I get a python error, saying it can't find wxpython. Am I supposed to set an environmental variable too? A little learning is a dangerous thing, but we must take that

Re: New to Python

2007-03-05 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I am trying to get a program to add up input from the user to get to > the number 100 using a loop. However, I am having some issues. Here > is what I have so far. I know I am just trying to hard, but I am > stuck. Where ? May I suggest this reading ? http://www

Any way to determine test success from inside tearDown()?

2007-03-05 Thread Christopher Corbell
This question pertains to PyUnit, esp. unittest.TestCase subclasses. Does anyone know of a way from within the TestCase tearDown() method to determine whether the current test succeeded or not? What I'm after is a specialized clean-up approach for error/failure cases. This is somewhat related to

Re: Webserver balance load

2007-03-05 Thread Bruno Desthuilliers
Jean-Paul Calderone a écrit : > On 5 Mar 2007 11:47:15 -0800, Johny <[EMAIL PROTECTED]> wrote: > >> Can anyone suggest a way how to balance load on Apache server where I >> have Python scripts running? >> For example I have 3 webservers( Apache servers) and I would like to >> sent user's request t

Re: Building a dictionary from a tuple of variable length

2007-03-05 Thread Pierre Quentel
Hi, > Therefore, how do I build the tuple of Falses to reflect the length of my t > tuple? Yet another solution : d = dict(zip(t,[False]*len(t))) Pierre -- http://mail.python.org/mailman/listinfo/python-list

Re: package_data question

2007-03-05 Thread Goldfish
On Mar 5, 1:56 am, "bytecolor" <[EMAIL PROTECTED]> wrote: > I have a simple package. I'm trying to add an examples subdirectory > with distutils. I'm using Python 2.4 on Linux. My file layout and > setup.py can be found here: > > http://www.deadbeefbabe.org/paste/3870 > > I've tried using data_file

Re: Using string as file

2007-03-05 Thread Arnaud Delobelle
On Mar 5, 8:13 pm, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > I have a function from a library thast expects a file object as argument. > How can I manage to give the function a string resp. have the text it would > have written to file object as a string? > > Thanks, > > Florian See h

Using string as file

2007-03-05 Thread Florian Lindner
Hello, I have a function from a library thast expects a file object as argument. How can I manage to give the function a string resp. have the text it would have written to file object as a string? Thanks, Florian -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create pid.lock via python?

2007-03-05 Thread MrJean1
May this works for your case . /Jean Brouwers On Mar 5, 3:12 am, Marco <[EMAIL PROTECTED]> wrote: > Hello, > > I write a program control a device via RS232, I hope to add some code > to let the program canNOT be used by other peo

Re: Webserver balance load

2007-03-05 Thread Jean-Paul Calderone
On 5 Mar 2007 11:47:15 -0800, Johny <[EMAIL PROTECTED]> wrote: >Can anyone suggest a way how to balance load on Apache server where I >have Python scripts running? >For example I have 3 webservers( Apache servers) and I would like to >sent user's request to one of the three server depending on a lo

Webserver balance load

2007-03-05 Thread Johny
Can anyone suggest a way how to balance load on Apache server where I have Python scripts running? For example I have 3 webservers( Apache servers) and I would like to sent user's request to one of the three server depending on a load on the server. Thank you . L. -- http://mail.python.org/mailma

Re: Python 2.5, problems reading large ( > 4Gbyes) files on win2k

2007-03-05 Thread Bill Tydeman
On 3/4/07, Paul Duffy <[EMAIL PROTECTED]> wrote: Bill Tydeman wrote: > Just curious, but since the file size limitation on NTFS is 4 GB, have > you confirmed that it isn't some other part of the interaction that is > causing the problem? What FS is hosting the files? I don't think that is corr

Re: New to Python

2007-03-05 Thread [EMAIL PROTECTED]
On Mar 5, 1:14 pm, "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote: > On Mar 5, 6:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > I am trying to get a program to add up input from the user to get to > > the number 100 using a loop. However, I am having some issues. Here > > is wh

Re: New to Python

2007-03-05 Thread Arnaud Delobelle
On Mar 5, 6:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I am trying to get a program to add up input from the user to get to > the number 100 using a loop. However, I am having some issues. Here > is what I have so far. I know I am just trying to hard, but I am > stuck. Thank you fo

Re: Project organization and import

2007-03-05 Thread Chris Mellon
On 5 Mar 2007 10:31:33 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > On Mar 5, 9:15 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > That's actually the exact benefit of unit testing, but I don't feel > > that you've actually made a case that this workflow is error prone. > > You often have mul

Re: Descriptor/Decorator challenge

2007-03-05 Thread Arnaud Delobelle
On 5 Mar, 14:38, "Arnaud Delobelle" <[EMAIL PROTECTED]> wrote: > On 5 Mar, 07:31, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > > > I had an idea but no time to think it through. > > Perhaps the under-under name mangling trick > > can be replaced (in Py3.0) with a suitably designed decorator. >

Re: New to Python

2007-03-05 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > I am trying to get a program to add up input from the user to get > to the number 100 using a loop. However, I am having some issues. Please, if you have a problem post the exact error symptoms. > Here is what I have so far. I know I am just trying to hard, but > I

Re: New to Python

2007-03-05 Thread Stargaming
[EMAIL PROTECTED] schrieb: > I am trying to get a program to add up input from the user to get to > the number 100 using a loop. However, I am having some issues. Here > is what I have so far. I know I am just trying to hard, but I am > stuck. Thank you for any help. > > print "We need to coun

Re: FloatCanvas in a wxpython application.... layout problems

2007-03-05 Thread Chris
On Feb 21, 1:40 pm, "nelson -" <[EMAIL PROTECTED]> wrote: > Hi all, > i'm developing an application that uses Floatcanvas to diplay a > cartesian plane. how can i embed it into a "complex" layout? Your best bet is either the floatcanvas list: http://mail.mithis.com/cgi-bin/mailman/listinfo/float

New to Python

2007-03-05 Thread [EMAIL PROTECTED]
I am trying to get a program to add up input from the user to get to the number 100 using a loop. However, I am having some issues. Here is what I have so far. I know I am just trying to hard, but I am stuck. Thank you for any help. print "We need to count to 100" high_number = 100 total = 0

Re: Project organization and import

2007-03-05 Thread Martin Unsal
On Mar 5, 9:15 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > That's actually the exact benefit of unit testing, but I don't feel > that you've actually made a case that this workflow is error prone. > You often have multiple developers working on the same parts of the > same module? Protecting y

Re: Help Deciphering Code

2007-03-05 Thread Terry Reedy
"Bryan Leber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I am learning python and I am having to make some changes on an existing python script. What happens is that one scripts creates an xml document that looks like this: >> "IPM2.1/Identity/IdentityWebApp/Source/com/fisc/pri

Re: Howto pass exceptions between threads

2007-03-05 Thread John Nagle
Alexander Eisenhuth wrote: > Hallo Alltogether, > > I've searched in this mailing list, but it seems to me that there is no > general approach to pass exceptions from one thread to another. Very few languages have that. Actually, it could be made to work for Python, but it would have to

Re: Mod python - mysql lock

2007-03-05 Thread John Nagle
If you use MySQL 5, you get atomic transactions. The old "LOCK" thing is becoming obsolete. Suggest getting a newer MySQL and a newer MySQL book. John Nagle Jan Danielsson wrote: > Roopesh wrote: > >>In my mod_python project I am using mysql as the database.

Re: Newbie question

2007-03-05 Thread [EMAIL PROTECTED]
On Mar 5, 9:03 am, Stargaming <[EMAIL PROTECTED]> wrote: > Tommy Grav schrieb: > > For this case, there are list comprehensions (or map, but you shouldn't > use it any longer): I didn't see anything in the docs about this. Is map going away or is it considered un-Pythonic now? Josh -- http:/

Re: list-like behaviour of etree.Element

2007-03-05 Thread [EMAIL PROTECTED]
On Mar 5, 1:00 am, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > Raymond Hettinger wrote: > > On Mar 4, 12:48 pm, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote: > >> The etree.Element (or ElementTree.Element) supports a number of > >> list-like methods: append, insert, remove. Any special reason why it

Re: Newbie question

2007-03-05 Thread Larry Bates
Tommy Grav wrote: > Hi list, > >this is somewhat of a newbie question that has irritated me for a while. > I have a file test.txt: > > 0.3434 0.5322 0.3345 > 1.3435 2.3345 5.3433 > > and this script > lines = open("test.txt","r").readlines() > for line in lines: >(xin,yin,zin) = line.s

Re: Python object to xml biding

2007-03-05 Thread Stefan Behnel
raf wrote: > I'm looking for a python to XSD/xml biding library to easy handling > this very large protocol spec I need to tackle. I've searched google > quite extensibly and I haven't found anything that properly fits the > bill... I'm mostly interested at the xml -> python and python->xml > marsh

Re: Python stock market analysis tools?

2007-03-05 Thread Mudcat
On Mar 5, 7:55 am, "Beliavsky" <[EMAIL PROTECTED]> wrote: > Yes, and a discussion of investment approaches would be off-topic. > Unfortunately, newsgroups such as misc.invest.stocks are dominated by > spam -- the moderated newsgroup misc.invest.financial-plan is better. > > Some research says that

Re: Python stock market analysis tools?

2007-03-05 Thread Mudcat
> What kind of tool do you want? Getting quotes is the easy part: > > import urllib > symbols = 'ibm jpm msft nok'.split() > quotes = urllib.urlopen( 'http://finance.yahoo.com/d/quotes.csv?s='+ > '+'.join(symbols) + '&f=l1&e=.csv').read().split() > print dict(zip(symbols, quotes)) > > Th

Re: How use XML parsing tools on this one specific URL?

2007-03-05 Thread Stefan Behnel
[EMAIL PROTECTED] schrieb: > I understand that the web is full of ill-formed XHTML web pages but > this is Microsoft: > > http://moneycentral.msn.com/companyreport?Symbol=BBBY > > I can't validate it and xml.minidom.dom.parseString won't work on it. Interestingly, no-one mentioned lxml so far:

Re: Python GUI + OpenGL

2007-03-05 Thread Chris Mellon
On 3/5/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Dag wrote: > > > On Fri, 02 Mar 2007 18:30:34 +0100, Diez B. Roggisch <[EMAIL PROTECTED]> > > wrote: > >> Achim Domma wrote: > >> > >>> Hi, > >>> > >>> I'm developing a GUI app in Python/C++ to visualize numerical results. > >>> Currently I'm

Re: Project organization and import

2007-03-05 Thread Chris Mellon
On 5 Mar 2007 08:32:34 -0800, Martin Unsal <[EMAIL PROTECTED]> wrote: > Jorge, thanks for your response. I replied earlier but I think my > response got lost. I'm trying again. > > On Mar 4, 5:20 pm, Jorge Godoy <[EMAIL PROTECTED]> wrote: > > Why? RCS systems can merge changes. A RCS system is no

Re: Newbie question

2007-03-05 Thread Stargaming
Tommy Grav schrieb: > Hi list, > >this is somewhat of a newbie question that has irritated me for a > while. > I have a file test.txt: > > 0.3434 0.5322 0.3345 > 1.3435 2.3345 5.3433 > > and this script > lines = open("test.txt","r").readlines() > for line in lines: >(xin,yin,zin) =

Re: worker thread catching exceptions and putting them in queue

2007-03-05 Thread Stargaming
Paul Sijben schrieb: > All, > > in a worker thread setup that communicates via queues is it possible to > catch exceptions raised by the worker executed, put them in an object > and send them over the queue to another thread where the exception is > raised in that scope? > > considering that an e

Newbie question

2007-03-05 Thread Tommy Grav
Hi list, this is somewhat of a newbie question that has irritated me for a while. I have a file test.txt: 0.3434 0.5322 0.3345 1.3435 2.3345 5.3433 and this script lines = open("test.txt","r").readlines() for line in lines: (xin,yin,zin) = line.split() x = float(xin) y = floa

Re: worker thread catching exceptions and putting them in queue

2007-03-05 Thread Diez B. Roggisch
Paul Sijben wrote: > All, > > in a worker thread setup that communicates via queues is it possible to > catch exceptions raised by the worker executed, put them in an object > and send them over the queue to another thread where the exception is > raised in that scope? > > considering that an ex

  1   2   >