Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread EP
> I thought there must be something special when you named a VAR with '_' > the first character. Maybe it's just a programming style and I had > thought too much... Perhaps you are thinking of the use of double leading underscore names within class declarations or system defined names with under

Re: Question about consistency in python language

2005-09-08 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Let's say I define a list of pairs as follows: > >>l = [('d', 3), ('a', 2), ('b', 1)] > > Can anyone explain why this does not work? > >>h = {}.update(l) > > and instead I have to go: > >>h = {} > >>h.update(l) > to initialize a dictionary with the given list of pairs? >

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-08 Thread Thomas Heller
Joakim Persson <[EMAIL PROTECTED]> writes: [...] > This means that I must come up with a way to interface Python with > this log tool. After some investigations, I have run inte problems -- > my inital approach was to use Python + win32com to communicate with > the COM interface. Unfortunately, it

Re: List of integers & L.I.S. (SPOILER)

2005-09-08 Thread n00m
Bravo, Bryan! It's incredibly fast! But your code got WA (wrong answer). See my latest submission: http://spoj.sphere.pl/status/SUPPER/ Maybe you slipped a kind of typo in it? Silly boundary cases? -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Johnny Lee
Erik Max Francis wrote: > > You're going to have to be more clear; I don't understand your question. > What's the difference between > > a = 1 > > and > > b = 1 > > besides the difference of name? > I thought there must be something special when you named a VAR with '_' the first ch

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Erik Max Francis
Johnny Lee wrote: > I mean besides the difference of name... You're going to have to be more clear; I don't understand your question. What's the difference between a = 1 and b = 1 besides the difference of name? -- Erik Max Francis && [EMAIL PROTECTED] && http://www.a

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Johnny Lee
Erik Max Francis wrote: > > No, of course not. One defines a class varaible named `_passxxx_', the > other defines one named `passsxxx'. > I mean besides the difference of name... -- http://mail.python.org/mailman/listinfo/python-list

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Christian Stapfer
"Lil" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I already double checked my C code. It runs perfectly fine in C without > any errors. So in my python program, I added a pdb.set_trace() > and step through the program and it did not dump. But when i took out > the tracing, the cor

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Erik Max Francis
Johnny Lee wrote: > As what you said, the following two code section is totally the same? > > (I) > class TestResult: > _passxxx_ = "pass" > > (II) > class TestResult: > passxxx = "pass" No, of course not. One defines a class varaible named `_passxxx_', the other defines one

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Johnny Lee
As what you said, the following two code section is totally the same? (I) class TestResult: _passxxx_ = "pass" (II) class TestResult: passxxx = "pass" -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Erik Max Francis
Johnny Lee wrote: >I'm new in python and I was wondering what's the difference between > the two code section below: > > (I) > class TestResult: > _pass_ = "pass" > _fail_ = "fail" > _exception_ = "exception" > > (II) > class TestResult: > pass = "pass" > fail =

What's the difference between VAR and _VAR_?

2005-09-08 Thread Johnny Lee
Hi, I'm new in python and I was wondering what's the difference between the two code section below: (I) class TestResult: _pass_ = "pass" _fail_ = "fail" _exception_ = "exception" (II) class TestResult: pass = "pass" fail = "fail" exception = "ex

Re: How to dynamicly define function and call the function?

2005-09-08 Thread Leif K-Brooks
FAN wrote: > class test: > def __init__(self): > exec("def dfunc(msg):\n\tprint msg\nprint 'exec def function'") > dfunc('Msg in init ...') # it work > > def show(self, msg): > dfunc(msg) # doesn't work ! >

Re: Question about consistency in python language

2005-09-08 Thread Erik Max Francis
Dave Benjamin wrote: > Mike Meyer wrote: >> Dave Benjamin <[EMAIL PROTECTED]> writes: >> >>>Python is actually quite consistent in this regard: methods that >>>modify an object in-place return None; >> >> Um, no. list.pop comes to mind as an immediate counterexample. It may >> be the only one...

Re: Question about consistency in python language

2005-09-08 Thread Dave Benjamin
Mike Meyer wrote: > Dave Benjamin <[EMAIL PROTECTED]> writes: > >>Python is actually quite consistent in this regard: methods that >>modify an object in-place return None; > > Um, no. list.pop comes to mind as an immediate counterexample. It may > be the only one... I'm sure there are counterexa

Re: redefining a function through assignment

2005-09-08 Thread Michael Spencer
Daniel Britt wrote: > Hello All, > I am new to Python so if there is an obvious answer to my question please > forgive me. Lets say I have the following code in mod1.py > > class test: > def func1(self): > print 'hello' > > > Now lets say I have another file called main.py: > > import mod1 >

How to dynamicly define function and call the function?

2005-09-08 Thread FAN
I want to define some function in python script dynamicly and call them later, but I get some problem. I have tried the following: ## # code ## class test: def __init__(self): exec("def dfunc(msg):\n\tprint msg\npr

Re: List of integers & L.I.S. (SPOILER)

2005-09-08 Thread Bryan Olson
n00m wrote: > Firstly I find ordering numbers when moving from left to the right; > then I find ord. numbers for backward direction AND for DECREASING > subsequences: Sounds good. > Btw, I did it in Pascal. Honestly, I don't believe it can > be done in Python (of course I mean only the impo

Re: Question about consistency in python language

2005-09-08 Thread Mike Meyer
Dave Benjamin <[EMAIL PROTECTED]> writes: > Python is actually quite consistent in this regard: methods that > modify an object in-place return None; Um, no. list.pop comes to mind as an immediate counterexample. It may be the only one... http://www.mired.org/home/mwm/ Indepe

Re: Question about consistency in python language

2005-09-08 Thread Dave Benjamin
[EMAIL PROTECTED] wrote: > Let's say I define a list of pairs as follows: > >>>l = [('d', 3), ('a', 2), ('b', 1)] > > > Can anyone explain why this does not work? > >>>h = {}.update(l) > > > and instead I have to go: > >>>h = {} >>>h.update(l) > > to initialize a dictionary with the given l

Re: Question about consistency in python language

2005-09-08 Thread Bengt Richter
On 8 Sep 2005 16:03:12 -0700, [EMAIL PROTECTED] wrote: >Let's say I define a list of pairs as follows: >>>l = [('d', 3), ('a', 2), ('b', 1)] > >Can anyone explain why this does not work? >>>h = {}.update(l) > >and instead I have to go: >>>h = {} >>>h.update(l) >to initialize a dictionary with the

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-08 Thread Peter Hansen
Guenter wrote: > I would be interested in how many frames this reaches on my computer. > Did you create like two arbitrary images under PLI and then display > them one after another? Then stop the time and count how many times you > were able to switch between the two? > > One feature I need to fi

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Lil wrote:' > >>I already double checked my C code. It runs perfectly fine in C without >> any errors. So in my python program, I added a pdb.set_trace() >> and step through the program and it did not dump. But when i took out >> the tracing, the core

redefining a function through assignment

2005-09-08 Thread Daniel Britt
Hello All, I am new to Python so if there is an obvious answer to my question please forgive me. Lets say I have the following code in mod1.py class test: def func1(self):   print 'hello' Now lets say I have another file called main.py: import mod1 inst = mod1.tes

Re: Question about consistency in python language

2005-09-08 Thread Sam Pointon
update updates the dictionary in place - it actually returns None, not the updated dict. However, you can construct a dictionary from a list of (key, value) pairs using dict(list). Example: >>>l = [('foo', 'bar'), ('baz', 'qig')] >>>d = dict(l) >>>print d {'foo': 'bar', 'baz': 'qig'} -- http://m

Re: Question about consistency in python language

2005-09-08 Thread James Stroud
This is the difference between mutable and immutable types. In this sense it is consistent. If you want to do the former in one shot: h = dict(l) Also, you shouldn't use "1", I mean "l", as a variable name. It gets confusing because "l", I mean "1", looks a lot like "1", I mean "l". James

Re: Python compiled?

2005-09-08 Thread Grant Edwards
On 2005-09-08, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On Tue, 06 Sep 2005 17:29:46 -, Grant Edwards <[EMAIL PROTECTED]> wrote: >> On 2005-09-06, Jorgen Grahn <[EMAIL PROTECTED]> wrote: >> >>> I also believe it's better to convince the end user to install >>> Python before installing the appl

ipython + gnu emacs on windows

2005-09-08 Thread madhusub
Has anyone managed to get ipython within gnu emacs (21.3.1) working on Windows XP? I've the following versions of required software Python 2.4.1 IPython 0.6.15 python-mode.el (defconst py-version "$Revision: 4.63 $" I have also installed other ancilliary packages (per http://ipython.scipy.org/doc

Re: Django and SQLObject. Why not working together?

2005-09-08 Thread Ian Bicking
Bruno Desthuilliers wrote: > Also, there's something like darwinism at play here. Yes, there are a > lot of concurrent ORM/Templating/Web Publishing/GUI/Whatnot projects > around, but I guess only the best of them will survive - eventually > 'absorbing' what's good in the others. No, they will all

Question about consistency in python language

2005-09-08 Thread lechequier
Let's say I define a list of pairs as follows: >>l = [('d', 3), ('a', 2), ('b', 1)] Can anyone explain why this does not work? >>h = {}.update(l) and instead I have to go: >>h = {} >>h.update(l) to initialize a dictionary with the given list of pairs? when an analagous operation on strings works

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-08 Thread Guenter
Fredrik Lundh schrieb: > getting the data into the "blittable" object fast enough may be more > of a problem, though. I don't know how good wxPython is in that > respect; Tkinter's PhotoImage is probably not fast enough for video, > but a more lightweight object like PIL's ImageWin.Dib works just

Re: reading the last line of a file

2005-09-08 Thread Michael Sparks
Xah Lee wrote: > isn't there a way to implement tail in python with the same class of > performance? > > how's tail implemented?: Those crazy open source developers have an implementation here: http://cvs.sourceforge.net/viewcvs.py/mkcdrec/mkcdrec/busybox-0.60.5/Attic/tail.c?rev=1.1&view=markup I

Re: Django and SQLObject. Why not working together?

2005-09-08 Thread Bruno Desthuilliers
Ksenia Marasanova a écrit : > 2005/9/8, Sokolov Yura <[EMAIL PROTECTED]>: > >>Django Model is wonderfull. But SQLObject more flexible (and powerfull, >>as i think, and has already more db interfaces). >>But Django Model is tied with Django, and using Django with another OO >>mapping is not comfort

Re: reading the last line of a file

2005-09-08 Thread Xah Lee
isn't there a way to implement tail in python with the same class of performance? how's tail implemented? Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ Fredrik Lundh wrote: > Fredrik Lundh wrote: > > > zcat|tail is a LOT faster. > > and here's the "right way" to use that: > > from subprocess

Re: py2exe 0.6.1 released

2005-09-08 Thread Chris Lambacher
I am also getting this. In my case I think it is related to win32com.shell since when building I get the following error: error: C:\work\...\build\bdist.win32\winexe\collect-2.4\win32com.shell\shell.pyd: No such file or directory ... is a place holder for a very long path. The problem is fixed

Re: dual processor

2005-09-08 Thread Jorgen Grahn
On 06 Sep 2005 14:08:03 -0700, Paul Rubin wrote: > Jorgen Grahn <[EMAIL PROTECTED]> writes: >> I feel the recent SMP hype (in general, and in Python) is a red herring. Why >> do I need that extra performance? What application would use it? > > How many mhz does the computer you're using right now

Re: Python compiled?

2005-09-08 Thread Jorgen Grahn
On Wed, 7 Sep 2005 08:40:28 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: > On Tuesday 06 September 2005 11:32 am, Jorgen Grahn wrote: >> I hope people are less hesitant to install "interpreted" applications today >> than they were ten years ago. >> >> I also believe it's better to convince the

Using Python with COM to communicate with proprietary Windows software

2005-09-08 Thread Joakim Persson
Hello all. I am involved in a project where we have a desire to improve our software testing tools, and I'm in charge of looking for solutions regarding the logging of our software (originating from embedded devices). Currently, we are using a heavyweight, proprietary log tool developed by another

Re: Python compiled?

2005-09-08 Thread Jorgen Grahn
On Tue, 06 Sep 2005 17:29:46 -, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2005-09-06, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > >> I also believe it's better to convince the end user to install Python before >> installing the application[1], rather than to try to sneak in an interpreter >>

Re: Python Jabber client?

2005-09-08 Thread Jarek Zgoda
Paul Rubin napisał(a): > Is there such a thing as a general purpose Python Jabber client? I'm > imagining one that uses tkinter. > > A little Googling finds a couple of Jabber protocol libraries written > in Python, a few half-finished projects, and a client> > If there's more than one, does an

Re: Python Jabber client?

2005-09-08 Thread Oliver Andrich
Hi Paul, take this one. http://xmpppy.sourceforge.net/ It is used inside gajim, my favorite jabber client. http://gajim.org/ It works like a charm. And I am also using xmpppy for some monitoring tools, that alert our admins. Best regards, Oliver -- Oliver Andrich <[EMAIL PROTECTED]> --- http://

Re: Python Jabber client?

2005-09-08 Thread Valentino Volonghi aka Dialtone
Paul Rubin wrote: > If there's more than one, does anyone have a favorite? twibber http://slarty.polito.it:8069/~sciasbat/wiki/moin.cgi/twibber Based on Twisted. Will probably be included in Twisted at some point in the future. Twisted already has a jabber protocol imp

Python Jabber client?

2005-09-08 Thread Paul Rubin
Is there such a thing as a general purpose Python Jabber client? I'm imagining one that uses tkinter. A little Googling finds a couple of Jabber protocol libraries written in Python, a few half-finished projects, and a client for the Sharp Zaurus, but I didn't spot any simple portable ones that a

Re: List of integers & L.I.S.

2005-09-08 Thread n00m
> 4 5 1 2 3 6 7 8 << the list itself > 1 2 1 2 3 4 5 6 << ordering numbers for forward direction > 2 1 6 5 4 3 2 1 << ordering numbers for backward direction > === > 3 3 7 7 7 7 7 7 << sums of the pairs of ord. numbers Oops! Sorry for miscounting in backward direction. Should be (anyway the

Re: __dict__ of object, Was: Regular Expression IGNORECASE differentfor findall and split?

2005-09-08 Thread Chris
Mike Meyer wrote: > Chris <[EMAIL PROTECTED]> writes: > >>Fredrik Lundh wrote: >> >>>Chris <[EMAIL PROTECTED]> wrote: >>> >>> but more of a basic question following, I was doing the following before: method = 'split' # came from somewhere else of course result = re.__dict__[method

Re: Django and SQLObject. Why not working together?

2005-09-08 Thread Ksenia Marasanova
2005/9/8, Sokolov Yura <[EMAIL PROTECTED]>: > Django Model is wonderfull. But SQLObject more flexible (and powerfull, > as i think, and has already more db interfaces). > But Django Model is tied with Django, and using Django with another OO > mapping is not comfortable. > Why do not working togeth

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Fredrik Lundh
Lil wrote:' >I already double checked my C code. It runs perfectly fine in C without > any errors. So in my python program, I added a pdb.set_trace() > and step through the program and it did not dump. But when i took out > the tracing, the core dump came back. "sigh" so triple-check it. if your

Re: Installation question

2005-09-08 Thread Nx
Thanks anyway I wished there was a sure step by step approach to get it to work but I can't think of any good solution and I do not want to reinstall a well optimized system if something goes astray. Nx -- http://mail.python.org/mailman/listinfo/python-list

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Lil
I already double checked my C code. It runs perfectly fine in C without any errors. So in my python program, I added a pdb.set_trace() and step through the program and it did not dump. But when i took out the tracing, the core dump came back. "sigh" -- http://mail.python.org/mailman/listinfo/pyth

Re: generator object, next method

2005-09-08 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] > Duncan Booth <[EMAIL PROTECTED]> writes: >> 1) Every time you access gen.next you create a new method-wrapper >> object. > > Why is that? I thought gen.next is a callable and gen.next() actually > advances t

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-08 Thread Michael Sparks
Guenter wrote: > I need to develop an application that displays video 640x480 16-bit per > pixel with 30 fps it is possible to achieve that frame rate and still > have some resources for other processing left? Yes. Co-incidentally we've been looking at video playback this week as well. We

Re: Printer List from CUPS

2005-09-08 Thread djw
Mike Tammerman wrote: > Hi, > > I want to get the printer list from CUPS. I found some ways using > > lpstat -p and > http://localhost:631/printers > > but, these ways require some parsing and I am not sure, if the parsing > works all the time. A pythonic way would be very helpful. > > Thanks,

Re: List of integers & L.I.S.

2005-09-08 Thread n00m
PS: I've still not read 2 new posts. -- http://mail.python.org/mailman/listinfo/python-list

Re: List of integers & L.I.S.

2005-09-08 Thread n00m
[EMAIL PROTECTED] wrote: > So, this has no real world use, aside from posting it on a website. I don't think you're quite right. We never know where we gain and where we lose. > So clearly it served a very useful purpose! ;) Thanks, Manuel! > your question is different than the question on this

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
> That's easy to follow, although their use of a Van Emde-Boas set as a > given hides the most challenging part (the "efficient data structure" > part). The "efficient data structure" is the easy part. Obviously, it is a dict of lists. ...or is it a list of dicts?... ...or is it a tuple of gene

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Fredrik Lundh
"Lil" <[EMAIL PROTECTED]> wrote: > It's in the C code mainly because the buffer is an input to the > driver. The driver takes a char* as input and I didn't want to pass a > char* from python -> swig -> C since swig has memory leaks passing > pointers. > Do you think this is a Python issue or

Re: improvements for the logging package

2005-09-08 Thread Trent Mick
[EMAIL PROTECTED] wrote] > Trent> I thought PEP 8 said camelCase (or whatever it is called) was > Trent> okay? > > Hmmm... In the section entitled "Naming Conventions" I see: > > Function Names > > Function names should be lowercase, possibly with words separated by > un

Re: List of integers & L.I.S.

2005-09-08 Thread Tim Peters
[EMAIL PROTECTED] > So, this has no real world use, aside from posting it on a website. > Thanks for wasting our time. You are making up an arbitrary problem and > asking for a solution, simply because you want to look at the > solutions, not because your problem needs to be solved. Clearly, this >

Re: job scheduling framework?

2005-09-08 Thread Fernando Perez
Larry Bates wrote: > Google turned up these links that might be of interest: > > http://www.foretec.com/python/workshops/1998-11/demosession/hoegl/ > http://www.webwareforpython.org/Webware/TaskKit/Docs/QuickStart.html > http://www.slac.stanford.edu/BFROOT/www/Computing/Distributed/Bookkeeping/SJ

Re: improvements for the logging package

2005-09-08 Thread skip
Trent> Unfortunately your getting caught by the default logging level Trent> being WARN, so that any log level below that is tossed. Ah, okay. I'll pick back through the docs and see what I missed, then maybe add a description of the minimal steps needed to get going. >> I suspect t

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Lil
Hi Larry, It's in the C code mainly because the buffer is an input to the driver. The driver takes a char* as input and I didn't want to pass a char* from python -> swig -> C since swig has memory leaks passing pointers. Do you think this is a Python issue or a Red Hat issue? I'm going to try

Django and SQLObject. Why not working together?

2005-09-08 Thread Sokolov Yura
Django Model is wonderfull. But SQLObject more flexible (and powerfull, as i think, and has already more db interfaces). But Django Model is tied with Django, and using Django with another OO mapping is not comfortable. Why do not working together? I can't understand. If you (Django and SQLObject

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Larry Bates
Question: Why not just use Python to read the file? f=open(filename, 'rb') fcontents=f.read() If you need to manipulate what is in fcontents you can use struct module and/or slicing. Larry Bates Lil wrote: > Hi Everyone! I've been trying to figure out this weird bug in my > program. I have a p

Re: Django Vs Rails

2005-09-08 Thread Marek Kubica
Hello! On 7 Sep 2005 20:56:28 -0700 flamesrock wrote: > On the other, Rails seems to have a brighter future, Why that? Django is not yet released and everybody is talking about it. Like it happened with RoR. > How difficult would it be to learn Ruby+Rails, assuming that someone is > already sk

Re: job scheduling framework?

2005-09-08 Thread Larry Bates
Google turned up these links that might be of interest: http://www.foretec.com/python/workshops/1998-11/demosession/hoegl/ http://www.webwareforpython.org/Webware/TaskKit/Docs/QuickStart.html http://www.slac.stanford.edu/BFROOT/www/Computing/Distributed/Bookkeeping/SJM/SJMMain.htm Larry Bates C

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
Working on this allowed me to avoid some _real_ (boring) work at my job. So clearly it served a very useful purpose! ;) Manuel -- http://mail.python.org/mailman/listinfo/python-list

Re: Cleaning strings with Regular Expressions

2005-09-08 Thread Gary Wilson Jr
sheffdog wrote: > Using regular expressions, the best I can do so far is using the re.sub > command but it still takes two lines. Can I do this in one line? Or > should I be approaching this differently? All I want to end up with is > the file name "ppbhat.tga". A regular expression to do what you

Re: launching adobe reader with arguments from os.system call

2005-09-08 Thread Greg Miller
Thank you for the information, when I launched the Reader on the actual hardware it launched quickly. I think I just have too much running on my application PC. I will consider starting an AcroReader app however. Greg -- http://mail.python.org/mailman/listinfo/python-list

Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Lil
Hi Everyone! I've been trying to figure out this weird bug in my program. I have a python program that calls a C function that reads in a binary file into a buffer. In the C program, buffer is allocated by calling malloc. The C program runs perfectly fine but when I use python to call the C functio

Re: Need help with C extension module

2005-09-08 Thread chris
Ok, I found further examples on the Internet and got something working (it seems), but I have a question about the memory management. The example I found did not include any of the PyMem_... functions. Here's roughly what I have working: cdef extern from "my.h": cdef struct inputs: char

Re: popen in thread on QNX

2005-09-08 Thread [EMAIL PROTECTED]
spawn() works on QNX, fork() does not. -- http://mail.python.org/mailman/listinfo/python-list

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
So, this has no real world use, aside from posting it on a website. Thanks for wasting our time. You are making up an arbitrary problem and asking for a solution, simply because you want to look at the solutions, not because your problem needs to be solved. Clearly, this is a waste of time. -- ht

Re: List of integers & L.I.S.

2005-09-08 Thread [EMAIL PROTECTED]
> ... and let me reveal the secret: > http://spoj.sphere.pl/problems /SUPPER/ your question is different than the question on this website. also, what do you consider to be the correct output for this permutation? (according to your original question) [4, 5, 1, 2, 3, 6, 7, 8] Manuel -- http:/

Re: question from beginner

2005-09-08 Thread dario
Thanks Dennis. In effect stringZVEI doesn't remain empty after the .read method, then the loop is executed 1 time. How could be a 'while' loop to wait a no empty string from the serial port? Dario. Dennis Lee Bieber ha scritto: > On 7 Sep 2005 07:14:37 -0700, "dario" <[EMAIL PROTECTED]> declaim

Re: pretty windows installer for py scripts

2005-09-08 Thread [EMAIL PROTECTED]
I second that. NSIS works better than MSI, Inno, or even InstallShield. I highly recommend it. Of course, a second choice is Inno, third is MSI, and last resort is InstallShield. Another option is to make an installer using "AutoIT" but that can get kind of tricky. -- http://mail.python.org/mailm

Re: killing thread after timeout

2005-09-08 Thread Bryan Olson
Paul Rubin wrote: > To get even more OS-specific, AF_UNIX sockets (at least on Linux) have > a feature called ancillary messages that allow passing file > descriptors between processes. It's currently not supported by the > Python socket lib, but one of these days... . But I don't think > Windows

Re: job scheduling framework?

2005-09-08 Thread Benji York
Chris Curvey wrote: > Has anyone seen a simple open source job-scheduling framework written > in Python? It sounds like BuildBot (http://buildbot.sf.net) might interest you. It's not exactly meant to be a job control system, but it does have some nice functionality. It might be interesting to e

RE: CGI File Uploads and Progress Bars

2005-09-08 Thread Robert Brewer
Doug Helm wrote: > I'm writing a CGI to handle very large file uploads. > I would like to include a progress bar. > ...I need to know not only the number of > bytes received, but also the total number of > incoming bytes. Here's the heart of the code: > > while afcommon.True: > lstrData

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-08 Thread Diez B. Roggisch
Guenter wrote: > Hi, > > I need to develop an application that displays video 640x480 16-bit per > pixel with 30 fps. > > I would prefer to do that with Python (wxPython) but don't have any > experience whether it is possible to achieve that frame rate and still > have some resources for other pr

Re: record sound to numarray/list

2005-09-08 Thread [EMAIL PROTECTED]
No there is not. Hey, you could write one though. -- http://mail.python.org/mailman/listinfo/python-list

job scheduling framework?

2005-09-08 Thread Chris Curvey
Has anyone seen a simple open source job-scheduling framework written in Python? I don't really want to reinvent the wheel. All I need is the ability to set up a series of atomic "jobs" as a "stream", then have the system execute the jobs in the stream one-at-a-time until all the jobs in the stre

Distutils extension proposal (was: Re: Distutils question)

2005-09-08 Thread Laszlo Zsolt Nagy
Peter Hansen wrote: >>How how can I install my .mo files from a distutil script into its >>default location? >> >>sys.prefix + os.sep + 'share' + os.sep + 'locale' >> >> > >I can't answer the first question, but the latter should be written this >way instead > >os.path.join(sys.prefix, '

Re: python profiling, hotspot and strange execution time

2005-09-08 Thread bdrosen96
I was unhappy with both hotshot and the standard python profiler, so I wrote my own, which may be what you are looking for. I've submitted it as a patch at: http://sourceforge.net/tracker/index.php?func=detail&aid=1212837&group_id=5470&atid=305470 It should add a minimum of overhead, give real nu

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-08 Thread Fredrik Lundh
Peter Hansen wrote: >> I need to develop an application that displays video 640x480 16-bit per >> pixel with 30 fps. >> >> I would prefer to do that with Python (wxPython) but don't have any >> experience whether it is possible to achieve that frame rate and still >> have some resources for other

ANN: ConfigObj 4.0.0 Beta 4

2005-09-08 Thread Fuzzyman
Hello Pythoneers, ConfigObj 4.0.0 has a beta 4 release. This fixes a couple of moderately serious bugs - so it's worth switching to. http://cheeseshop.python.org/pypi/ConfigObj http://www.voidspace.org.uk/python/configobj.html http://www.voidspace.org.uk/cgi-bin/voidspace/downman.py?file=configob

Re: popen in thread on QNX

2005-09-08 Thread Jacek Popławski
Laszlo Zsolt Nagy wrote: > - one of your worker threads wants to run a command > - it creates the argument list and puts it into a message queue > - woker thread starts to sleep > - main thread processes the message queue -> it will run popen, put back > the file descriptors into the message and w

Re: launching adobe reader with arguments from os.system call

2005-09-08 Thread Steve Holden
Greg Miller wrote: > Thank you Martin, here's what I discovered this morning to work, the > only problem is it is painfully slow to launch the application. > > os.system('start acroRd32.exe'+' /A'+' "page=15"'+' > "C:\\Gregtemp\\estelletest\\NexGlosser_User_Guide_W60G00_en.pdf"') > > I'm going to

Re: PEP-able? Expressional conditions

2005-09-08 Thread Antoon Pardon
Op 2005-09-08, Duncan Booth schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Which is why I don't understand the resistance against introducing >> such a beast. > > The idea has already been discussed to death. Read PEP 308 to see what was > proposed, discussed, and why the PEP was eventua

Re: Printer List from CUPS

2005-09-08 Thread Martin Franklin
Mike Tammerman wrote: > I am using Ubuntu. pycups seems to be not existed any more. > > Mike > Yeah as I said if you're using a redhat based distro... However you could try getting the redhat / fedora rpm that provides pycups and installing it? I would ask on the Ubuntu list, I know they are a

Re: Video display, frame rate 640x480 @ 30fps achievable?

2005-09-08 Thread Peter Hansen
Guenter wrote: > I need to develop an application that displays video 640x480 16-bit per > pixel with 30 fps. > > I would prefer to do that with Python (wxPython) but don't have any > experience whether it is possible to achieve that frame rate and still > have some resources for other processing

Re: killing thread after timeout

2005-09-08 Thread Jacek Popławski
Paul Rubin wrote: > Maybe the child process can just use sigalarm instead of a separate > thread, to implement the timeout. Already tried that, signals works only in main thread. > To get even more OS-specific, AF_UNIX sockets (at least on Linux) have > a feature called ancillary messages that al

Re: Printer List from CUPS

2005-09-08 Thread Mike Tammerman
I am using Ubuntu. pycups seems to be not existed any more. Mike -- http://mail.python.org/mailman/listinfo/python-list

Video display, frame rate 640x480 @ 30fps achievable?

2005-09-08 Thread Guenter
Hi, I need to develop an application that displays video 640x480 16-bit per pixel with 30 fps. I would prefer to do that with Python (wxPython) but don't have any experience whether it is possible to achieve that frame rate and still have some resources for other processing left? My development P

ANN: PyDev 0.9.8.1 released

2005-09-08 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.8.1 has been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.8.1 Major highlights: --- * Java 1.4 support reintroduced. * Styles a

Re: pretty windows installer for py scripts

2005-09-08 Thread Adriaan Renting
The elegant way to do installs on Windows would be by creating an MSI. Microsoft provides (IIRC) a simple tool to create those (Orca), that's free. Without the Installshield or Wise tools I think it would take quite some effort though, because you need to understand all the details of how msi ta

Re: Migrate PYD Files

2005-09-08 Thread Kay Schluehr
David Duerrenmatt wrote: > Is there a way to use old pyd files (Python 1.5.2) with a newer version > of Python without recompiling them? > > Because the source code is not available anymore, I'm wondering whether > it's possible or not to change few bytes with a hex editor (version > number?). I'd

Re: PEP-able? Expressional conditions

2005-09-08 Thread Duncan Booth
Antoon Pardon wrote: > Which is why I don't understand the resistance against introducing > such a beast. The idea has already been discussed to death. Read PEP 308 to see what was proposed, discussed, and why the PEP was eventually rejected: http://www.python.org/peps/pep-0308.html: > Status:

Re: Construct raw strings?

2005-09-08 Thread Benji York
Peter Hansen wrote: > Benji York wrote: > >> It's not join that's getting you, it's the non-raw string >> representation in path_to_scan. Use either 'd:\test_images' or >> 'd:\\test_images' instead. > > Benji, you're confusing things: you probably meant r'd:\test_images' > in the above Doh! I

Re: Creating custom event in WxPython

2005-09-08 Thread Chris Lambacher
You should be derriving from PyCommandEvent since only CommandEvents are set to propegate, which is probably what you want (see the wxwidgets Event handling overview). In order to use Bind you will need an instance of PyEventBinder. For the example below that would be something like: EVT_INVOKE

Re: Distutils question

2005-09-08 Thread Peter Hansen
Laszlo Zsolt Nagy wrote: > How how can I install my .mo files from a distutil script into its > default location? > > sys.prefix + os.sep + 'share' + os.sep + 'locale' I can't answer the first question, but the latter should be written this way instead os.path.join(sys.prefix, 'share', 'lo

  1   2   >