Re: re.findall() hangs in python

2007-03-31 Thread Gabriel Genellina
En Sun, 01 Apr 2007 03:58:51 -0300, Peter Otten <[EMAIL PROTECTED]> escribió: > [EMAIL PROTECTED] wrote: > >> I have the following regular expression. >> It works when 'data' contains the pattern and I see 'match2' get print >> out. >> But when 'data' does not contain pattern, it just hangs at >

Re: shelf membership

2007-03-31 Thread Gabriel Genellina
En Sat, 31 Mar 2007 21:22:20 -0300, John Machin <[EMAIL PROTECTED]> escribió: > On Apr 1, 8:02 am, Aaron Brady <[EMAIL PROTECTED]> wrote: >> can you shelve objects with membership? >> >> this gives you: >> >> TypeError: object does not support item assignment >> dict 0 True >> Exception exceptio

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Kay Schluehr
On Mar 31, 11:26 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Mar 31, 8:38 am, Bjoern Schliessmann > > > [EMAIL PROTECTED]> wrote: > > Mark Dufour wrote: > > > Shed Skin allows for translation of pure (unmodified), implicitly > > > statically typed Python programs into optimized C++, and

Re: saving Python process state for later debugging

2007-03-31 Thread yossi . kreinin
On Apr 1, 2:07 am, "aspineux" <[EMAIL PROTECTED]> wrote: > > Pylon has something like > that.http://pylonshq.com/docs/0.9.4.1/interactive_debugger.html > > Turbogears has the same with option tg.fancy_exception > I could get it wrong, but these things seem to be about debugging crashed processes

Re: re.findall() hangs in python

2007-03-31 Thread 7stud
On Mar 31, 9:12 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following regular expression. > It works when 'data' contains the pattern and I see 'match2' get print > out. > But when 'data' does not contain pattern, it just hangs at > 're.findall' > > pattern = re.compile(

Re: re.findall() hangs in python

2007-03-31 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I have the following regular expression. > It works when 'data' contains the pattern and I see 'match2' get print > out. > But when 'data' does not contain pattern, it just hangs at > 're.findall' > > pattern = re.compile("(.*) re.S) > > print "before find all"

Re: Unicode list

2007-03-31 Thread Martin v. Löwis
> Like this, the program prints some characters as strange escape > sequences, which is due to the input file being encoded in utf-8: When I > convert "re.findall..." to a string and wrap an "unicode()" around it, > the matches get printed correctly. Is it possible to make "matches" > unicode w

Re: CRC CCITT UPDATE in Python

2007-03-31 Thread Martin v. Löwis
> Please, is there here some good soul that understand this > functions hi8 and lo8 (from GCC AVR) and can help me to port it to > Python? > > uint16_t > crc_ccitt_update (uint16_t crc, uint8_t data) > { >data ˆ= lo8 (crc); >data ˆ= data << 4; >return uint16_t)data << 8) | h

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread John Nagle
Mark Dufour wrote: > Hi all, > > I have recently released version 0.0.20 and 0.0.21 of Shed Skin, an > optimizing Python-to-C++ compiler. Shed Skin allows for translation of > pure (unmodified), implicitly statically typed Python programs into > optimized C++, and hence, highly optimized machine l

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sat, 2007-03-31 at 20:47 -0700, Paul Rubin wrote: > Michael Torrie <[EMAIL PROTECTED]> writes: > > The no-service contract version of the GPL is not the same as the > > standard GPLv2. > > I don't see how that can be--we're talking about a GCC-based compiler, > right? I found the real reason w

Converting _node* to a Code object?

2007-03-31 Thread Brendon Costa
Hi All, I have an application with an embedded python interpreter and i need to get the embedded interpreter to "import" strangely named files as python modules. Anyhow the simple part of the question is: How do i convert a _node* object returned from: PyParser_SimpleParseStringFlagsFilename()

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sat, 2007-03-31 at 20:47 -0700, Paul Rubin wrote: > Michael Torrie <[EMAIL PROTECTED]> writes: > > The no-service contract version of the GPL is not the same as the > > standard GPLv2. > > I don't see how that can be--we're talking about a GCC-based compiler, > right? Well, that's beside the p

Generic logic/conditional class or library for classification of data

2007-03-31 Thread Basilisk96
This topic is difficult to describe in one subject sentence... Has anyone come across the application of the simple statement "if (object1's attributes meet some conditions) then (set object2's attributes to certain outcomes)", where "object1" and "object2" are generic objects, and the "conditions

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Paul Rubin
Michael Torrie <[EMAIL PROTECTED]> writes: > The no-service contract version of the GPL is not the same as the > standard GPLv2. I don't see how that can be--we're talking about a GCC-based compiler, right? -- http://mail.python.org/mailman/listinfo/python-list

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Michael Torrie
On Sun, 2007-04-01 at 02:49 +, Dennis Lee Bieber wrote: > Take that up with ACT... GNAT 3.15p was explicitly unencumbered, but > the current version of GNAT, in the GPL (no-service contract) form has > gone the other direction, claiming that executables must be released > GPL. The no-ser

re.findall() hangs in python

2007-03-31 Thread [EMAIL PROTECTED]
Hi, I have the following regular expression. It works when 'data' contains the pattern and I see 'match2' get print out. But when 'data' does not contain pattern, it just hangs at 're.findall' pattern = re.compile("(.*)http://mail.python.org/mailman/listinfo/python-list

Pygame Q (linux) beginner

2007-03-31 Thread enquiring mind
Running 2.4.1 Python (learning) Running SUSE Linux 10 Am learning from a new books that mostly deals with windows python and Pygames called "Game Programming" by Randy Harris (2007) His books references Python 2.4.2 and Pygame 1.7.1 with these comments: "If you are using a Linux machine, you p

CRC CCITT UPDATE in Python

2007-03-31 Thread pythoneiro
Please, Please, is there here some good soul that understand this functions hi8 and lo8 (from GCC AVR) and can help me to port it to Python? uint16_t crc_ccitt_update (uint16_t crc, uint8_t data) { data ˆ= lo8 (crc); data ˆ= data << 4; return uint16_t)data << 8) | hi8 (crc)) ˆ

Re: I18n issue with optik

2007-03-31 Thread Steven Bethard
Thorsten Kampe wrote: > I've written a script which uses Optik/Optparse to display the > options (which works fine). The text for the help message is localised > (with german umlauts) and when I execute the script with the localised > environment variable set, I get this traceback[1]. The intere

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Luis M. González
On Mar 31, 10:31 pm, Bjoern Schliessmann wrote: > Luis M. González wrote: > > I think he should be taken very seriously. > > Agreed. > > Okay, it seems focusing a discussion on one single point is > difficult for many people. Next time I'll be mind-bogglingly clear > that even the last one underst

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Bjoern Schliessmann
Luis M. González wrote: > I think he should be taken very seriously. Agreed. Okay, it seems focusing a discussion on one single point is difficult for many people. Next time I'll be mind-bogglingly clear that even the last one understands after reading it one time ... Regards, Björn Fup2 p

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Paul Rubin
"Paul McGuire" <[EMAIL PROTECTED]> writes: > Why would that be? GPL'ed code libraries can be a turn-off for those > who want to release commercial products using them, but a GPL'ed > utility such as a compiler bears no relationship or encumbrance on the > compiled object code it generates. For so

Re: Unicode list

2007-03-31 Thread Paul Boddie
Rehceb Rotkiv wrote: > Hello, > > I have this little grep-like program: > > ++snip++ > #!/usr/bin/python > > import sys > import re > > pattern = sys.argv[1] > inputfile = file(sys.argv[2], 'r') > > for line in inputfile: > matches = re.findall(pattern, line) > if matches: >

Unicode list

2007-03-31 Thread Rehceb Rotkiv
Hello, I have this little grep-like program: ++snip++ #!/usr/bin/python import sys import re pattern = sys.argv[1] inputfile = file(sys.argv[2], 'r') for line in inputfile: matches = re.findall(pattern, line) if matches: print matches ++snip++ L

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Paul McGuire
On Mar 31, 6:45 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > Regardless of its merrits, it's GPL'ed which I assume is an immediate turn-off > for many in the community. > Why would that be? GPL'ed code libraries can be a turn-off for those who want to release commercial products using them

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Paul Boddie
Alexander Schmolck wrote: > > Regardless of its merrits, it's GPL'ed which I assume is an immediate turn-off > for many in the community. In the way that tools such as gcc are GPL-licensed, or do you have something else in mind? Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: shelf membership

2007-03-31 Thread John Machin
On Apr 1, 8:02 am, Aaron Brady <[EMAIL PROTECTED]> wrote: > can you shelve objects with membership? > > this gives you: > > TypeError: object does not support item assignment > dict 0 True > Exception exceptions.TypeError: 'object does not support item assignment' > in ignored > > > ignored is a b

Re: help with dates

2007-03-31 Thread John Machin
On Apr 1, 7:51 am, "Pierre Quentel" <[EMAIL PROTECTED]> wrote: > > Four groups of firefighters (group1, group2, group3, group4). Each > > group works a 24 hr shift. So group1 works April 1, group2 works April > > 2, group3 works April 3, group4 works April 4, group 1 works April 5, > > etc. It just

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Alexander Schmolck
"Luis M. González" <[EMAIL PROTECTED]> writes: > On Mar 31, 8:38 am, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: > > Mark Dufour wrote: > > > Shed Skin allows for translation of pure (unmodified), implicitly > > > statically typed Python programs into optimized C++, and hence, > > > >

Re: saving Python process state for later debugging

2007-03-31 Thread aspineux
On 31 mar, 16:48, [EMAIL PROTECTED] wrote: > Hi! > > Is there a way to save the state of a Python process for later > inspection with a debugger? One way to do this is to dump core, but is > the result usable for debugging with pdb (it can be debugged by gdb, > which can inspect PyObjects in a CPyt

Using Simple MAPI with MS Outlook 2007

2007-03-31 Thread tomer . ha
Hi there, I'd like to send emails from a Python program using Simple MAPI. I've tried this code: http://mail.python.org/pipermail/python-list/2004-December/298066.html and it works well with Outlook Express 6 and Thunderbird 1.5, but it doens't work at all with Microsoft Outlook 2007. I keep gett

shelf membership

2007-03-31 Thread Aaron Brady
can you shelve objects with membership? this gives you: TypeError: object does not support item assignment dict 0 True Exception exceptions.TypeError: 'object does not support item assignment' in ignored > ignored is a bit mysterious. tx in advance. from shelve import * class MyShelf(Dbfilen

I18n issue with optik

2007-03-31 Thread Thorsten Kampe
Hi, I've written a script which uses Optik/Optparse to display the options (which works fine). The text for the help message is localised (with german umlauts) and when I execute the script with the localised environment variable set, I get this traceback[1]. The interesting thing is that the

Re: help with dates

2007-03-31 Thread Pierre Quentel
> Four groups of firefighters (group1, group2, group3, group4). Each > group works a 24 hr shift. So group1 works April 1, group2 works April > 2, group3 works April 3, group4 works April 4, group 1 works April 5, > etc. It just keeps rolling like this forever into next year, etc. > > I need to com

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Luis M. González
On Mar 31, 8:38 am, Bjoern Schliessmann wrote: > Mark Dufour wrote: > > Shed Skin allows for translation of pure (unmodified), implicitly > > statically typed Python programs into optimized C++, and hence, > >^> highly > optimized ma

help with dates

2007-03-31 Thread rustybear
[sorry about the earlier post. accidently hit enter] I'm working on a website for some firefighters that want to be able to sign-up for overtime and I need some help figuring out a date related problem. Here's the scenario: Four groups of firefighters (group1, group2, group3, group4). Each group

help with dates

2007-03-31 Thread rustybear
I'm working on a website for some firefighters that want to be able to sign-up for overtime and I need some help figuring out a date related problem. Here's the scenario: Four groups of firefighters (group1, group2, group3, group4). Each group works a 24 hr shift. So group1 works April 1, group2

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Why are you taking potshots at Mark? What suggests that I'm "taking potshots" at Mark? > He's maybe onto something and he's asking for help. If he can > generate efficient C++ code from implicitly statically type Python > it stands to reason that he can take advantag

Re: PyPy for dummies

2007-03-31 Thread Georg Brandl
Cameron Laird schrieb: > In article <[EMAIL PROTECTED]>, > Paddy <[EMAIL PROTECTED]> wrote: > . > . > . >>It is also European funding for an open source project with sprints. >>I'm sure some eurocrat will be dissecting the project to

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Duncan Booth
Peter Otten <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > > from operator import itemgetter > data.sort(key=itemgetter(0)) > data.sort(key=itemgetter(1)) > data.sort(key=itemgetter(4)) > data.sort(key=itemgetter(3)) > > Or, in Python 2.5: > data.sort(key=itemgetter

Re: Game programming for kids: looking for open source 2D game development kit

2007-03-31 Thread pabloreda
I 'm doing the same in forth... www.reda4.org -- http://mail.python.org/mailman/listinfo/python-list

Extending embedded python of multiple interpreters

2007-03-31 Thread vishnu
Hello All, I have embedded python 2.5 in to my C application. As we need the python scripts to run in multi threaded environment I have used Py_NewInterpreter() and Py_EndInterpreter each time I execute a run script function. The code is as follows: RunScript(char *pScriptName,char *pFuncName,...)

Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Bart Willems
> > Even better: pick one entry of your choice from > > http://images.google.com/images?q=%22don%27t+feed+the+troll%22 > > > Michele OMG and here I am thinking that Ken Rockwell's site is full of crap. This one's worse... Does the guy have a job? Or a life? -- http://mail.python.org/mailman/

Re: Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)

2007-03-31 Thread gregorywieber
Thank you, everyone! On Mar 31, 6:43 am, Laurent Pointal <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi All, > > > I'm just beginning my exploration of Python and I have a rather > > general question. If two particular programs have Python scripting > > capabilities, does that mean t

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Rehceb Rotkiv
Thank you all for your helpful solutions! Regards, Rehceb -- http://mail.python.org/mailman/listinfo/python-list

Re: When will 2.5.1 be released?

2007-03-31 Thread Martin v. Löwis
>> And while we're waiting for 2.5.1, can somebody post a clear (as >> opposed to the one that comes with Tix ;)) explanation of how to >> manually install Tix into python 2.5? It should be possible... > > LLoyd > -Not possible - this is a known bug and won't be fixed until 2.5.1 This is not tru

Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte

2007-03-31 Thread Paul Boddie
Oleg Parashchenko wrote: > On Mar 29, 4:53 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > > On 29 Mar, 06:26, "Oleg Parashchenko" <[EMAIL PROTECTED]> wrote: > > > > > > I'm working on an unicode-aware application. I like to use "print" to > > > debug programs, but in this case it was nightmare. T

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Peter Otten
Duncan Booth wrote: from operator import itemgetter data.sort(key=itemgetter(0)) data.sort(key=itemgetter(1)) data.sort(key=itemgetter(4)) data.sort(key=itemgetter(3)) Or, in Python 2.5: >>> data.sort(key=itemgetter(3, 4, 1, 0)) Peter -- http://mail.python.org/mailman/

Re: os.system questions

2007-03-31 Thread Aahz
In article <[EMAIL PROTECTED]>, Eric Price <[EMAIL PROTECTED]> wrote: > >I have a couple bugs to work out in the below script; namely, I don't >know how to capture the result of an os.system command, nor am I >convinced that the call to os.system actually results in the execution >of the command. H

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread attn . steven . kuo
On Mar 31, 6:42 am, Rehceb Rotkiv <[EMAIL PROTECTED]> wrote: (snipped) > As each line consists of 5 words, I would break up the data into an array > of five-field-arrays (Would you use lists or tuples or a combination in > Python?). The word "BUT" would be in the middle, with two fields/words > l

Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Lew
Michele Dondi wrote: > Even better: pick one entry of your choice from > > http://images.google.com/images?q=%22don%27t+feed+the+troll%22 I pick -- Lew -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Lew
Arved Sandstrom wrote: > "Timofei Shatrov" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Fri, 30 Mar 2007 06:48:05 GMT, "Mike Schilling" >> <[EMAIL PROTECTED]> >> tried to confuse everyone with this message: >> >>> Xah Lee wrote: >>> So, a simple code like this in norma

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Duncan Booth
Rehceb Rotkiv <[EMAIL PROTECTED]> wrote: > Wait, I made a mistake. The correct result would be > > reaction is BUT by the > pattern , BUT it is > rapid , BUT it is > sea , BUT it is > sodium , BUT it is > this manner BUT the dissolved > > because "by the" comes before and "the dissolved" after "

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Steven Bethard
Rehceb Rotkiv wrote: >> If you want a good answer you have to give me/us more details, and an >> example too. > > OK, here is some example data: > > reaction is BUT by the > sodium , BUT it is > sea , BUT it is > this manner BUT the dissolved > pattern , BUT it is > rapid , BUT it is > > As each

Re: Is any way to split zip archive to sections?

2007-03-31 Thread Tim Williams
On 30/03/07, Durumdara <[EMAIL PROTECTED]> wrote: > Hi! > > I want to create some backup archives with python (I want to write a backup > application in Python). > Some package managers (7z, arj, winzip) can create splitted archives (1 > mega, 650, 700 mega, etc). > > Because I want to ftp these re

Re: os.system questions

2007-03-31 Thread David Brochu
From: "Eric Price" <[EMAIL PROTECTED]> Date: March 31, 2007 9:38:53 AM EDT To: [EMAIL PROTECTED], [EMAIL PROTECTED] Cc: python-list@python.org Subject: Re: os.system questions Oops! The problem isn't in the os.system call. It's in the fact that I don't call the function. That is, I writ

Re: wxPython help

2007-03-31 Thread hg
Blh ([EMAIL PROTECTED]) wrote: > i have installed wxpython v2.6 for python 2.4 > my python installation is at d:\python24 > > the statement "import wx" works perfectly > but when i use "import images", it says that there is no module, but > i know for a fact that there is. > > can anyone help? >

Re: os.system questions

2007-03-31 Thread Eric Price
Thank you :) Eric >From: "Parthan SR" <[EMAIL PROTECTED]> >To: "Eric Price" <[EMAIL PROTECTED]> >Subject: Re: os.system questions >Date: Sat, 31 Mar 2007 19:52:01 +0530 > >On 3/31/07, Eric Price <[EMAIL PROTECTED]> wrote: >> >>Oops! The problem isn't in the os.system call. It's in the fact that I

Re: Mouse click in python

2007-03-31 Thread hlubenow
Synt4x wrote: > I'm creating a webcam user interface (to control google earth through > my webcam) and I still can't find a good example to how to control the > mouse to "click and drag" (not just click and release). Pygame: http://www.pygame.org/ http://www.pygame.org/docs/ref/mouse.html provi

wxPython help

2007-03-31 Thread [EMAIL PROTECTED]
i have installed wxpython v2.6 for python 2.4 my python installation is at d:\python24 the statement "import wx" works perfectly but when i use "import images", it says that there is no module, but i know for a fact that there is. can anyone help? -- - --- -- -

saving Python process state for later debugging

2007-03-31 Thread yossi . kreinin
Hi! Is there a way to save the state of a Python process for later inspection with a debugger? One way to do this is to dump core, but is the result usable for debugging with pdb (it can be debugged by gdb, which can inspect PyObjects in a CPython core, for example, but it's not much fun)? If the

Re: Remote XML Parsing

2007-03-31 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > On Mar 30, 5:56 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] a écrit : >> >> > How can I parse a remote XML file with Python? >> > And what will I be able to do with this XML file in Python? >> >> > Sorry if this is a noob-ish question. >> >> You c

Re: Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)

2007-03-31 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > Hi All, > > I'm just beginning my exploration of Python and I have a rather > general question. If two particular programs have Python scripting > capabilities, does that mean those two programs can communicate in > real time through Python? > > I'm running some audio

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread skip
Björn> Mark Dufour wrote: >> Shed Skin allows for translation of pure (unmodified), implicitly >> statically typed Python programs into optimized C++, and hence, >> highly optimized machine language. Bjoern> Bjoern> Wow, I bet all C++ compiler manufactur

Opening Photoshop EPS with PIL?

2007-03-31 Thread [EMAIL PROTECTED]
Hey Everyone, I am trying to get PIL to open some EPS files I have (Photoshop EPS, whatever the difference is). I'm trying to use PIL to do this, but when I run it, the following happens: >>> from PIL import Image, ImageOps >>> Image.open('/flora.eps') Traceback (most recent call last): File ""

Re: Indentation for code readability

2007-03-31 Thread jkn
If I wanted to mark out stack depth stuff like this in python, I'd do it with some form of stylised comment, like this: # LEVEL 0 pushMatrix(): # LEVEL 1 drawstuff() pushMatrix() # LEVEL 2 drawSomeOtherStuff() popMatrix() # LEVEL 1 popMat

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Rehceb Rotkiv
Wait, I made a mistake. The correct result would be reaction is BUT by the pattern , BUT it is rapid , BUT it is sea , BUT it is sodium , BUT it is this manner BUT the dissolved because "by the" comes before and "the dissolved" after "it is". Sorry for the confusion. -- http://mail.python.org/m

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Rehceb Rotkiv
> If you want a good answer you have to give me/us more details, and an > example too. OK, here is some example data: reaction is BUT by the sodium , BUT it is sea , BUT it is this manner BUT the dissolved pattern , BUT it is rapid , BUT it is As each line consists of 5 words, I would break up t

Re: os.system questions

2007-03-31 Thread Eric Price
Oops! The problem isn't in the os.system call. It's in the fact that I don't call the function. That is, I write a script called "test.py" with a function in it called "freshReboot". Now, how do I call that function from test.py? That is, how do I write a cron event such that "freshReboot" actu

Re: os.system questions

2007-03-31 Thread Eric Price
Great! That seems to work fine: #!/usr/local/bin/python import re, os def freshReboot(): up = os.popen('uptime').readlines() up = up[0] if re.search('day|hour', up): pass else: tup = re.split('min', up) first = tup[0]

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread bearophileHUGS
Rehceb Rotkiv: > can I sort a multidimensional array in Python by multiple sort keys? A > litte code sample would be nice! If you want a good answer you have to give me/us more details, and an example too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Need help with python and pyxml on AIX

2007-03-31 Thread loial
I have been asked to install a python application on AIX 5.3 that runs OK on Windows I have installed Python 4.2.2 from python.org and pyXML form sourceforge. However when I run the application I get the following error : class xml.sax._exceptions.SAXReaderNotAvailable Do I need to set some Pyth

Re: Sorting a multidimensional array by multiple keys

2007-03-31 Thread Thomas Krüger
Rehceb Rotkiv schrieb: > can I sort a multidimensional array in Python by multiple sort keys? A > litte code sample would be nice! You can pass a function as argument to the sort method of a list. The function should take two arguments and return -1, 0 or 1 as comparison result. Just like the cmp

Re: os.system questions

2007-03-31 Thread Amit Khemka
On 3/31/07, Eric Price <[EMAIL PROTECTED]> wrote: > Hi; > I have a couple bugs to work out in the below script; namely, I don't know > how to capture the result of an os.system command, nor am I convinced that > the call to os.system actually results in the execution of the command. Here > is the s

Re: os.system questions

2007-03-31 Thread Thomas Krüger
Eric Price schrieb: > up = os.system("uptime") > How do I assign the output of "uptime" to the variable "up"? | >>> print os.system.__doc__ | system(command) -> exit_status | | Execute the command (a string) in a subshell. os.system returns the exitcode of the given command. To get the output try

Sorting a multidimensional array by multiple keys

2007-03-31 Thread Rehceb Rotkiv
Hello everyone, can I sort a multidimensional array in Python by multiple sort keys? A litte code sample would be nice! Thx, Rehceb -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Michele Dondi
On Fri, 30 Mar 2007 09:28:36 +0100, bugbear <[EMAIL PROTECTED]> wrote: >Er. How about > >public class test { > public static void main(String[] args) { > String a = "a string"; > String b = "another one"; > StringBuffer c = a + b; > System.out.println(c); > } >} Even better:

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Bjoern Schliessmann
Mark Dufour wrote: > Shed Skin allows for translation of pure (unmodified), implicitly > statically typed Python programs into optimized C++, and hence, ^ > highly optimized machine language. Wow, I bet all C++ com

os.system questions

2007-03-31 Thread Eric Price
Hi; I have a couple bugs to work out in the below script; namely, I don't know how to capture the result of an os.system command, nor am I convinced that the call to os.system actually results in the execution of the command. Here is the script: #!/usr/local/bin/python import re, os def fres

Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte

2007-03-31 Thread Jarek Zgoda
Oleg Parashchenko napisał(a): >>> I spent two hours fixing it, and I hope it's done. The solution is one >>> of the ugliest hack I ever written, but it solves the pain. The full >>> story and the code is in my blog: >>> http://uucode.com/blog/2007/03/23/shut-up-you-dummy-7-bit-python/ >> Calling s

Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Mark Dufour
Hi all, I have recently released version 0.0.20 and 0.0.21 of Shed Skin, an optimizing Python-to-C++ compiler. Shed Skin allows for translation of pure (unmodified), implicitly statically typed Python programs into optimized C++, and hence, highly optimized machine language. Besides many bug fixes

Re: with timeout(...):

2007-03-31 Thread Nick Craig-Wood
John Nagle <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > Nick Craig-Wood wrote: > > > > > >>Did anyone write a contextmanager implementing a timeout for > >>python2.5? > >> > >>And have it work reliably and in a cross platform way! > > > > Cross platform isn't the issue here - reliab

Re: with timeout(...):

2007-03-31 Thread Nick Craig-Wood
Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Nick Craig-Wood" <[EMAIL PROTECTED]> wrote: > > > I'd like there to be something which works well enough for day to day > > use. Ie doesn't ever wreck the internals of python. It could have > > some caveats like "may not timeout during C functio

Send Anti-Flickering off to logitech cam

2007-03-31 Thread eriq
Hi, I am currently working with a Logitech Quickcam STX via USB. Using the VideoCapture module to make pictures. Because the camera is outside I will have to turn off a special Option on the camera called "Anti- Flickering". Is there anyway that I can send a hardware seq to the cam to do this. Or

wx textctrl font style

2007-03-31 Thread Pom
Hello I have a tuple of strings which I must show in a textctrl, each item in the tuple representing one line of text. The first three lines of text should each have another style (fontsize and color) i'm using this code to achieve this: tmppos = self.txtInfo.GetInsertionPoint() # get the c

Re: Hpw make lists that are easy to sort.

2007-03-31 Thread Anton Vredegoor
Paul Rubin wrote: > Oh, I see what you mean. I don't see an obvious faster way to do it > and I don't have the feeling that one necessarily exists. As someone > mentioned, you could do an n-way merge, which at least avoids using > quadratic memory. Here's a version using Frederik Lundh's trick