Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Edward Dolan
No, you're not missing a thing. I am ;) Something was happening with the triple-quoted strings when I pasted them. Here is hopefully, the correct code. http://codepad.org/OIazr9lA The output is shown on that page as well. Sorry for the line noise folks. One of these days I'm going to learn gnus. -

Re: multiprocessing deadlock

2009-10-23 Thread Brian Quinlan
On 24 Oct 2009, at 14:10, Gabriel Genellina wrote: En Thu, 22 Oct 2009 23:18:32 -0300, Brian Quinlan escribió: I don't like a few things in the code: def _do(i): print('Run:', i) q = multiprocessing.Queue() for j in range(30): q.put(i*30+j) processes = _make_some_p

Re: Copying a ZipExtFile

2009-10-23 Thread Gabriel Genellina
En Fri, 23 Oct 2009 14:15:33 -0300, Moore, Mathew L escribió: with io.BytesIO() as memio: shutil.copyfileobj(f, memio) zip = zipfile.ZipFile(file=memio) # Can't use zip.extract(), because I want to ignore paths # within archive. src = zip.open('unkn

Re: AttributeError: 'SSLSocket' object has no attribute 'producer_fifo'

2009-10-23 Thread Gabriel Genellina
En Fri, 23 Oct 2009 03:27:40 -0300, VYAS ASHISH M-NTB837 escribió: Tried using asyncore.dispatcher_with_send in place of asynchat.async_chat and after a few request-responses, I get this: Exception in thread Thread-2: Traceback (most recent call last): File "C:\Python31\lib\threading.py", l

Re: PAMIE and beautifulsoup problem

2009-10-23 Thread Gabriel Genellina
En Fri, 23 Oct 2009 03:03:56 -0300, elca escribió: follow script is which i was found in google. but it not work for me. im using PAMIE3 version.even if i changed to pamie 2b version ,i couldn't make it working. You'll have to provide more details. *What* happened? You got an exception? Ple

Re: PySerial

2009-10-23 Thread Gabriel Genellina
En Fri, 23 Oct 2009 20:56:21 -0300, Ronn Ross escribió: I have tried setting the baud rate with no success. Also I'm using port #2 because I"m using a usb to serial cable. Note that Serial(2) is known as COM3 in Windows, is it ok? -- Gabriel Genellina -- http://mail.python.org/mailman/l

Re: Is there a command that returns the number of substrings in a string?

2009-10-23 Thread Erik Max Francis
Peng Yu wrote: For example, the long string is 'abcabc' and the given string is 'abc', then 'abc' appears 2 times in 'abcabc'. Currently, I am calling 'find()' multiple times to figure out how many times a given string appears in a long string. I'm wondering if there is a function in python which

Re: Is there a command that returns the number of substrings in a string?

2009-10-23 Thread Stephen Hansen
On Fri, Oct 23, 2009 at 7:31 PM, Peng Yu wrote: > For example, the long string is 'abcabc' and the given string is > 'abc', then 'abc' appears 2 times in 'abcabc'. Currently, I am calling > 'find()' multiple times to figure out how many times a given string > appears in a long string. I'm wonderi

Re: multiprocessing deadlock

2009-10-23 Thread Gabriel Genellina
En Thu, 22 Oct 2009 23:18:32 -0300, Brian Quinlan escribió: I don't like a few things in the code: def _do(i): print('Run:', i) q = multiprocessing.Queue() for j in range(30): q.put(i*30+j) processes = _make_some_processes(q) while not q.empty(): p

Is there a command that returns the number of substrings in a string?

2009-10-23 Thread Peng Yu
For example, the long string is 'abcabc' and the given string is 'abc', then 'abc' appears 2 times in 'abcabc'. Currently, I am calling 'find()' multiple times to figure out how many times a given string appears in a long string. I'm wondering if there is a function in python which can directly ret

Re: python pyodbc - connect error

2009-10-23 Thread Gabriel Genellina
En Thu, 22 Oct 2009 22:33:52 -0300, Threader Slash escribió: Hi again.. I have done the same test using pyodbc, but to MySQL ODBC driver. It works fine for MySQL. The problem still remains to Lotus Notes. Any other hints please? http://www.connectionstrings.com -- Gabriel Genellina --

Re: How to modify local variables from internal functions?

2009-10-23 Thread MRAB
kj wrote: I like Python a lot, and in fact I'm doing most of my scripting in Python these days, but one thing that I absolutely *DETEST* about Python is that it does allow an internal function to modify variables in the enclosing local scope. This willful hobbling of internal functions

Re: How to write a daemon program to monitor symbolic links?

2009-10-23 Thread Lawrence D'Oliveiro
In message , Peng Yu wrote: > As far as I know, linux doesn't support a system level way to figure > out all the symbolic links point to a give file. Do you know of a system that does? > I'm thinking of writing a daemon program which will build a database > on all the symbolic links that point

Re: How to write a daemon program to monitor symbolic links?

2009-10-23 Thread Aahz
In article , Peng Yu wrote: > >I'm thinking of writing a daemon program which will build a database >on all the symbolic links that point to any files. Later on, whenever >I change or remove any file or symbolic link, I'll will notify the >daemon process the changes. By keeping this daemon proces

Re: How to modify local variables from internal functions?

2009-10-23 Thread Stephen Hansen
On Fri, Oct 23, 2009 at 5:19 PM, kj wrote: > I like Python a lot, and in fact I'm doing most of my scripting in > Python these days, but one thing that I absolutely *DETEST* > about Python is that it does allow an internal function to modify > variables in the enclosing local scope. This

Re: How to modify local variables from internal functions?

2009-10-23 Thread Chris Rebert
On Fri, Oct 23, 2009 at 5:19 PM, kj wrote: > I like Python a lot, and in fact I'm doing most of my scripting in > Python these days, but one thing that I absolutely *DETEST* > about Python is that it does allow an internal function to modify > variables in the enclosing local scope.  This

How to modify local variables from internal functions?

2009-10-23 Thread kj
I like Python a lot, and in fact I'm doing most of my scripting in Python these days, but one thing that I absolutely *DETEST* about Python is that it does allow an internal function to modify variables in the enclosing local scope. This willful hobbling of internal functions seems to m

Re: PySerial

2009-10-23 Thread Ronn Ross
I have tried setting the baud rate with no success. Also I'm using port #2 because I"m using a usb to serial cable. On Fri, Oct 23, 2009 at 7:51 PM, Chris Rebert wrote: > On Thu, Oct 22, 2009 at 4:43 PM, Ronn Ross wrote: > > I'm using pySerial to connect to a serial port (rs232) on a windows xp

Re: PySerial

2009-10-23 Thread Chris Rebert
On Thu, Oct 22, 2009 at 4:43 PM, Ronn Ross wrote: > I'm using pySerial to connect to a serial port (rs232) on a windows xp > machine. I'm using python interactive interpretor to interact with the > device. I type the following: > import serial > ser = serial.Serial(2) > ser.write("command") > > Bu

Re: PySerial

2009-10-23 Thread Ronn Ross
I'm using pySerial to connect to a serial port (rs232) on a windows xp machine. I'm using python interactive interpretor to interact with the device. I type the following: import serial ser = serial.Serial(2) ser.write("command") But this does nothing to the control. I have been able to connect vi

Re: Python help: Sending a "play" command to quicktime, or playing a movie in python

2009-10-23 Thread Chris Varnon
>> On Fri, Oct 23, 2009 at 5:17 PM, Chris Rebert wrote: >>> On Fri, Oct 23, 2009 at 3:07 PM, Varnon Varnon wrote: I'm sure this is a simple problem, or at least I hope it is, but I'm not an experience programer and the solution eludes me. My realm of study is the behavioral sc

Re: Python help: Sending a "play" command to quicktime, or playing a movie in python

2009-10-23 Thread Chris Rebert
> On Fri, Oct 23, 2009 at 5:17 PM, Chris Rebert wrote: >> On Fri, Oct 23, 2009 at 3:07 PM, Varnon Varnon wrote: >>> I'm sure this is a simple problem, or at least I hope it is, but I'm >>> not an experience programer and the solution eludes me. >>> >>> My realm of study is the behavioral sciences

Re: Python help: Sending a "play" command to quicktime, or playing a movie in python

2009-10-23 Thread Chris Varnon
Thanks, That works wonderfuly. Once I set quicktimes preferences to "play on open" it opens and plays the movie exactly like I want. But now I need a line of code to bring python to the front again so it can read my input. Any more suggestions? On Fri, Oct 23, 2009 at 5:17 PM, Chris Rebert wrote:

Re: Python help: Sending a "play" command to quicktime, or playing a movie in python

2009-10-23 Thread Terry Reedy
Chris Rebert wrote: On Fri, Oct 23, 2009 at 3:07 PM, Varnon Varnon wrote: I'm sure this is a simple problem, or at least I hope it is, but I'm not an experience programer and the solution eludes me. My realm of study is the behavioral sciences. I want to write a program to help me record data

Re: multiprocessing deadlock

2009-10-23 Thread Brian Quinlan
On 24 Oct 2009, at 06:01, paulC wrote: Hey Paul, I guess I was unclear in my explanation - the deadlock only happens when I *don't* call join. Cheers, Brian Whoops, my bad. Have you tried replacing prints with writing a another output Queue? I'm wondering if sys.stdout has a problem. Re

Re: Python help: Sending a "play" command to quicktime, or playing a movie in python

2009-10-23 Thread Chris Rebert
On Fri, Oct 23, 2009 at 3:07 PM, Varnon Varnon wrote: > I'm sure this is a simple problem, or at least I hope it is, but I'm > not an experience programer and the solution eludes me. > > My realm of study is the behavioral sciences. I want to write a > program to help me record data from movie fil

Python help: Sending a "play" command to quicktime, or playing a movie in python

2009-10-23 Thread Varnon Varnon
I'm sure this is a simple problem, or at least I hope it is, but I'm not an experience programer and the solution eludes me. My realm of study is the behavioral sciences. I want to write a program to help me record data from movie files. Currently I have a program that can record the time of a key

Re: Dll in python

2009-10-23 Thread Rami Chowdhury
On Fri, 23 Oct 2009 14:08:58 -0700, Aahz wrote: In article , snonca wrote: [...] Was I the only person who read the Subject: line and thought, "How do you roll D11, anyway?" Surely it's just like a slightly unbalanced D12? -- Rami Chowdhury "Never attribute to malice that which can b

Re: A new way to configure Python logging

2009-10-23 Thread Wolodja Wentland
On Thu, Oct 22, 2009 at 09:25 +, Vinay Sajip wrote: > I need your feedback to make this feature as useful and as easy to use as > possible. I'm particularly interested in your comments about the dictionary > layout and how incremental logging configuration should work, but all feedback > will

Re: Dll in python

2009-10-23 Thread Aahz
In article , snonca wrote: > > [...] Was I the only person who read the Subject: line and thought, "How do you roll D11, anyway?" -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "In the end, outside of spy agencies, people are far too trusting and willing to he

Re: Dll in python

2009-10-23 Thread Martien Verbruggen
On Fri, 23 Oct 2009 13:09:10 -0700 (PDT), snonca wrote: > hello > > I would like to know how to create dll in python to implement a > project. NET Are you maybe looking for this: http://pythonnet.sourceforge.net/ Martien -- | Martien Verbruggen |

Re: Dll in python

2009-10-23 Thread Diez B. Roggisch
snonca schrieb: hello I would like to know how to create dll in python to implement a project. NET There is a Tutorial Take a look at iron-python. Diez -- http://mail.python.org/mailman/listinfo/python-list

Dll in python

2009-10-23 Thread snonca
hello I would like to know how to create dll in python to implement a project. NET There is a Tutorial Thanks Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: How to write a daemon program to monitor symbolic links?

2009-10-23 Thread Falcolas
On Oct 23, 1:38 pm, Falcolas wrote: > On Oct 23, 1:25 pm, Peng Yu wrote: > > > > > As far as I know, linux doesn't support a system level way to figure > > out all the symbolic links point to a give file. I could do a system > > wide search to look for any symbolic link that point to the file tha

Re: How to write a daemon program to monitor symbolic links?

2009-10-23 Thread Grant Edwards
On 2009-10-23, Peng Yu wrote: > [...] > > I'm thinking of writing a daemon program [...] > > But I have never make a daemon program like this in python. Could > somebody point me what packages I need in order to make a daemon > process like this? http://www.google.com/search?q=python+daemon --

Re: How to write a daemon program to monitor symbolic links?

2009-10-23 Thread Falcolas
On Oct 23, 1:25 pm, Peng Yu wrote: > As far as I know, linux doesn't support a system level way to figure > out all the symbolic links point to a give file. I could do a system > wide search to look for any symbolic link that point to the file that > I am interested in. But this will be too slow w

How to write a daemon program to monitor symbolic links?

2009-10-23 Thread Peng Yu
As far as I know, linux doesn't support a system level way to figure out all the symbolic links point to a give file. I could do a system wide search to look for any symbolic link that point to the file that I am interested in. But this will be too slow when there are many files in the systems. I'

Re: multiprocessing deadlock

2009-10-23 Thread paulC
> > Hey Paul, > > I guess I was unclear in my explanation - the deadlock only happens   > when I *don't* call join. > > Cheers, > Brian Whoops, my bad. Have you tried replacing prints with writing a another output Queue? I'm wondering if sys.stdout has a problem. Regards, Paul C. -- http://mail

Re: Cpython optimization

2009-10-23 Thread Jason Sewall
On Fri, Oct 23, 2009 at 2:31 PM, Olof Bjarnason wrote: >> > >> > This would be way to speed up things in an image processing algorithm: >> > 1. divide the image into four subimages 2. let each core process each >> > part independently 3. fix&merge (along split lines for example) into a >> > result

Re: Cpython optimization

2009-10-23 Thread Olof Bjarnason
> > > > > This would be way to speed up things in an image processing algorithm: > > 1. divide the image into four subimages 2. let each core process each > > part independently 3. fix&merge (along split lines for example) into a > > resulting, complete image > > Well, don't assume you're the first

Re: A new way to configure Python logging

2009-10-23 Thread Vinay Sajip
> For my part, I'm configuring the loggers in the application entry point > file, in python code. I'm not sure I am that concerned. However being a > great fan of this module, I kindly support you for any improvements you > may add to this module and appreciate all the work you've already done

Copying a ZipExtFile

2009-10-23 Thread Moore, Mathew L
Hello all, A newbie here. I was wondering why the following fails on Python 2.6.2 (r262:71605) on win32. Am I doing something inappropriate? Interestingly, it works in 3.1, but would like to also get it working in 2.6. Thanks in advance, --Matt import io import shutil import tempfile import

Re: Cpython optimization

2009-10-23 Thread Antoine Pitrou
Le Fri, 23 Oct 2009 15:53:02 +0200, Olof Bjarnason a écrit : > > This would be way to speed up things in an image processing algorithm: > 1. divide the image into four subimages 2. let each core process each > part independently 3. fix&merge (along split lines for example) into a > resulting, comp

Re: A new way to configure Python logging

2009-10-23 Thread Jean-Michel Pichavant
Vinay Sajip wrote: If you use the logging package but don't like using the ConfigParser-based configuration files which it currently supports, keep reading. I'm proposing to provide a new way to configure logging, using a Python dictionary to hold configuration information. It means that you can

Re: unicode and dbf files

2009-10-23 Thread Ethan Furman
John Machin wrote: On Oct 23, 3:03 pm, Ethan Furman wrote: John Machin wrote: On Oct 23, 7:28 am, Ethan Furman wrote: Greetings, all! I would like to add unicode support to my dbf project. The dbf header has a one-byte field to hold the encoding of the file. For example, \x03 is cod

Re: breaking out to the debugger (other than x=1/0 !)

2009-10-23 Thread bdb112
That's perfect - and removing the "breakpoint" is not an issue for me as it is normally conditional on a debug level, which I can change from pydb if debuglvl>3: import pydb pydb.set_trace() 'in XXX: c to continue' The text line is a useful prompt (The example here is for pydb which

Re: Read any function in runtime

2009-10-23 Thread Matt McCredie
joao abrantes gmail.com> writes: > > Hey. I want to make a program like this:print "Complete the function f(x)="then the user would enter x+2 or 1/x or any other function that only uses the variable x. Then my python program would calculate f(x) in some points for example in f(2),f(4).. etc . Ho

Read any function in runtime

2009-10-23 Thread joao abrantes
Hey. I want to make a program like this: print "Complete the function f(x)=" then the user would enter x+2 or 1/x or any other function that only uses the variable x. Then my python program would calculate f(x) in some points for example in f(2),f(4).. etc . How can I do this? -- http://mail.pyt

Re: breaking out to the debugger (other than x=1/0 !)

2009-10-23 Thread Diez B. Roggisch
bdb112 wrote: > After a while programming in python, I still don't know how to break > out to the debugger other than inserting an instruction to cause an > exception. > x=1/0 > > In IDL one woudl write > > stop,'reason for stopping...' > at which point you can inspect locals (as in pdb) and con

breaking out to the debugger (other than x=1/0 !)

2009-10-23 Thread bdb112
After a while programming in python, I still don't know how to break out to the debugger other than inserting an instruction to cause an exception. x=1/0 In IDL one woudl write stop,'reason for stopping...' at which point you can inspect locals (as in pdb) and continue (but you can't with pdb if

breaking out to the debugger (other than x=1/0 !)

2009-10-23 Thread bdb112
After a while programming in python, I still don't know how to break out to the debugger other than inserting an instruction to cause an exception. x=1/0 In IDL one woudl write stop,'reason for stopping...' at which point you can inspect locals (as in pdb) and continue (but you can't with pdb if

Re: Help with code = Extract numerical value to variable

2009-10-23 Thread rurpy
On 10/23/2009 05:16 AM, Dave Angel wrote: > Steve wrote: >> Sorry I'm not being clear >> >> Input** >> sold: 16 >> sold: 20 >> sold: 2 >> sold: 0 >> sold: >> 7 >> 0 >> >> sold >> null >> >> Output >> 16 >> 20 >> 2 >> 0 >> 0 >> 7 >> 0 >> 0 >> 0 >> 0 > > Since you're looking for onl

Re: Validating positional arguments in optparse

2009-10-23 Thread Robert Kern
On 2009-10-23 05:54 AM, Filip Gruszczyński wrote: That being said, I still stick with optparse. I prefer the dogmatic interface that makes all my exe use the exact same (POSIX) convention. I really don't care about writing /file instead of --file I would like to keep POSIX convention too, but j

Re: search python wifi module

2009-10-23 Thread Jorgen Grahn
On Fri, 2009-10-23, Clint Mourlevat wrote: > hello, > > i search a wifi module python on windows, i have already scapy ! What is a wifi module? Your OS is supposed to hide networking implementation details (Ethernet, PPP, Wi-fi, 3G ...) and provide specific management interfaces when needed. What

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Jeremy
On Oct 23, 3:48 am, Edward Dolan wrote: > On Oct 22, 3:26 pm, Jeremy wrote: > > > My question is, how can I use regular expressions to find two OR three > > or even an arbitrary number of floats without repeating %s?  Is this > > possible? > > > Thanks, > > Jeremy > > Any time you have tabular da

Re: Cpython optimization

2009-10-23 Thread Olof Bjarnason
2009/10/23 Antoine Pitrou > Le Fri, 23 Oct 2009 09:45:06 +0200, Olof Bjarnason a écrit : > > > > So I think my first question is still interesting: What is the point of > > multiple cores, if memory is the bottleneck? > > Why do you think it is, actually? Some workloads are CPU-bound, some > othe

Re: multiprocessing deadlock

2009-10-23 Thread Brian Quinlan
On 24 Oct 2009, at 00:02, paulC wrote: On Oct 23, 3:18 am, Brian Quinlan wrote: My test reduction: import multiprocessing import queue def _process_worker(q): while True: try: something = q.get(block=True, timeout=0.1) except queue.Empty: retu

Re: How to schedule system calls with Python

2009-10-23 Thread Jorgen Grahn
On Thu, 2009-10-22, Al Fansome wrote: > > > Jorgen Grahn wrote: >> On Fri, 2009-10-16, Jeremy wrote: >>> On Oct 15, 6:32 pm, MRAB wrote: TerryP wrote: > On Oct 15, 7:42 pm, Jeremy wrote: >> I need to write a Python script that will call some command line >> programs (using os.sys

Re: multiprocessing deadlock

2009-10-23 Thread paulC
On Oct 23, 3:18 am, Brian Quinlan wrote: > My test reduction: > > import multiprocessing > import queue > > def _process_worker(q): >      while True: >          try: >              something = q.get(block=True, timeout=0.1) >          except queue.Empty: >              return >          else: >  

search python wifi module

2009-10-23 Thread Clint Mourlevat
hello, i search a wifi module python on windows, i have already scapy ! thanks @+ -- http://mail.python.org/mailman/listinfo/python-list

Re: Cpython optimization

2009-10-23 Thread Antoine Pitrou
Le Fri, 23 Oct 2009 09:45:06 +0200, Olof Bjarnason a écrit : > > So I think my first question is still interesting: What is the point of > multiple cores, if memory is the bottleneck? Why do you think it is, actually? Some workloads are CPU-bound, some others are memory- or I/O-bound. You will

Re: Bug? concatenate a number to a backreference: re.sub(r'(zzz:)xxx', r'\1'+str(4444), somevar)

2009-10-23 Thread abdulet
On 23 oct, 13:54, Peter Otten <__pete...@web.de> wrote: > abdulet wrote: > > Well its this normal? i want to concatenate a number to a > > backreference in a regular expression. Im working in a multprocess > > script so the first what i think is in an error in the multiprocess > > logic but what a

Re: Bug? concatenate a number to a backreference: re.sub(r'(zzz:)xxx', r'\1'+str(4444), somevar)

2009-10-23 Thread Peter Otten
abdulet wrote: > Well its this normal? i want to concatenate a number to a > backreference in a regular expression. Im working in a multprocess > script so the first what i think is in an error in the multiprocess > logic but what a sorprise!!! when arrived to this conclussion after > some time de

Re: Cpython optimization

2009-10-23 Thread Olof Bjarnason
2009/10/23 Stefan Behnel > > Olof Bjarnason wrote: > > [snip] > >> A short question after having read through most of this thread, on the > >> same subject (time-optimizing CPython): > >> > >> http://mail.python.org/pipermail/python-list/2007-September/098964.html > >> > >> We are experiencing mu

Re: problem with pythonw.exe

2009-10-23 Thread Dave Angel
Martin Shaw wrote: Hi, I have a tkinter application running on my windows xp work machine and I am attempting to stop the console from appearing when the application runs. I've researched around and the way to do this appears to be to use pythonw.exe instead of python.exe. However when I try to

Bug? concatenate a number to a backreference: re.sub(r'(zzz:)xxx', r'\1'+str(4444), somevar)

2009-10-23 Thread abdulet
Well its this normal? i want to concatenate a number to a backreference in a regular expression. Im working in a multprocess script so the first what i think is in an error in the multiprocess logic but what a sorprise!!! when arrived to this conclussion after some time debugging i see that: impor

Help with code = Extract numerical value to variable

2009-10-23 Thread Dave Angel
Steve wrote: Sorry I'm not being clear Input** sold: 16 sold: 20 sold: 2 sold: 0 sold: 7 0 sold null Output 16 20 2 0 0 7 0 0 0 0 Since you're looking for only digits, simply make a string containing all characters that aren't digits. Now, loop through the file and use

Re: Help with code = Extract numerical value to variable

2009-10-23 Thread Sion Arrowsmith
Steve wrote: >If there is a number in the line I want the number otherwise I want a >0 >I don't think I can use strip because the lines have no standards What do you think strip() does? Read http://docs.python.org/library/stdtypes.html#str.lstrip *carefully* (help(''.lstrip) is slightly ambiguou

Re: Validating positional arguments in optparse

2009-10-23 Thread Filip Gruszczyński
> That being said, I still stick with optparse. I prefer the dogmatic > interface that makes all my exe use the exact same (POSIX) convention. I > really don't care about writing /file instead of --file I would like to keep POSIX convention too, but just wanted OptionParser to do the dirty work of

Re: Validating positional arguments in optparse

2009-10-23 Thread Jean-Michel Pichavant
Filip Gruszczyński wrote: optparse module is quite smart, when it comes to validating options, like assuring, that certain option must be an integer. However, I can't find any information about validating, that positional arguments were provided and I can't find methods, that would allow defining

Validating positional arguments in optparse

2009-10-23 Thread Filip Gruszczyński
optparse module is quite smart, when it comes to validating options, like assuring, that certain option must be an integer. However, I can't find any information about validating, that positional arguments were provided and I can't find methods, that would allow defining positional argument in Opti

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Edward Dolan
I can see why this line could wrap > 1.E-08 1.58024E-06 0.0048 1.E-08 1.58024E-06 > 0.0048 But this one? > 1.E-07 2.98403E-05 > 0.0018 anyway, here is the code -> http://codepad.org/Z7eWBusl -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help with regular expression finding multiple floats

2009-10-23 Thread Edward Dolan
On Oct 22, 3:26 pm, Jeremy wrote: > My question is, how can I use regular expressions to find two OR three > or even an arbitrary number of floats without repeating %s?  Is this > possible? > > Thanks, > Jeremy Any time you have tabular data such as your example, split() is generally the first ch

Re: pyodbc - problem passing None as parameter

2009-10-23 Thread Tim Golden
Frank Millman wrote: Thanks, Tim, for the detailed explanation. I appreciate your taking the time. It was difficult for me to use the code that you posted, because under my present setup I define my SQL statements externally, and the WHERE clause has to conform to one or more rows of six colu

Re: Cpython optimization

2009-10-23 Thread Stefan Behnel
> Olof Bjarnason wrote: > [snip] >> A short question after having read through most of this thread, on the >> same subject (time-optimizing CPython): >> >> http://mail.python.org/pipermail/python-list/2007-September/098964.html >> >> We are experiencing multi-core processor kernels more and more th

Re: pyodbc - problem passing None as parameter

2009-10-23 Thread Frank Millman
Tim Goldenwrote: > Frank Millman wrote: >> >> I want the final WHERE clause to show 'WHERE todate IS NULL'. > > Of course, I understand that. What I mean is that if a piece > of SQL say: > > WHERE table.column IS ? > > then the only possible (meaningful) value ? can have is > NULL (or None, in pyt

Re: problem with pythonw.exe

2009-10-23 Thread Christian Heimes
Martin Shaw wrote: > I have a tkinter application running on my windows xp work machine and I am > attempting to stop the console from appearing when the application runs. > I've researched around and the way to do this appears to be to use > pythonw.exe instead of python.exe. However when I try to

Re: Help with my program

2009-10-23 Thread Alan Gauld
"tanner barnes" wrote I have a program with 2 classes and in one 4 variables are created (their name, height, weight, and grade). What im trying to make happen is to get the variables from the first class and use them in the second class. In general thats not a good idea. Each class should

Re: Help with my program

2009-10-23 Thread Lie Ryan
tanner barnes wrote: Ok so im in need of some help! I have a program with 2 classes and in one 4 variables are created (their name, height, weight, and grade). What im trying to make happen is to get the variables from the first class and use them in the second class.

problem with pythonw.exe

2009-10-23 Thread Martin Shaw
Hi, I have a tkinter application running on my windows xp work machine and I am attempting to stop the console from appearing when the application runs. I've researched around and the way to do this appears to be to use pythonw.exe instead of python.exe. However when I try to run pythonw.exe from

Re: pyodbc - problem passing None as parameter

2009-10-23 Thread Tim Golden
Frank Millman wrote: Tim Golden wrote: Frank Millman wrote: cur.execute('select * from ctrl.dirusers where todate is ?', None) Traceback (most recent call last): File "", line 1, in pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax

Re: Cpython optimization

2009-10-23 Thread Olof Bjarnason
2009/10/23 Olof Bjarnason > > > 2009/10/22 MRAB > > Olof Bjarnason wrote: >> [snip] >> >> A short question after having read through most of this thread, on the >>> same subject (time-optimizing CPython): >>> >>> http://mail.python.org/pipermail/python-list/2007-September/098964.html >>> >>> We

Re: Cpython optimization

2009-10-23 Thread Olof Bjarnason
2009/10/22 MRAB > Olof Bjarnason wrote: > [snip] > > A short question after having read through most of this thread, on the >> same subject (time-optimizing CPython): >> >> http://mail.python.org/pipermail/python-list/2007-September/098964.html >> >> We are experiencing multi-core processor kern

Re: unicode and dbf files

2009-10-23 Thread John Machin
On Oct 23, 3:03 pm, Ethan Furman wrote: > John Machin wrote: > > On Oct 23, 7:28 am, Ethan Furman wrote: > > >>Greetings, all! > > >>I would like to add unicode support to my dbf project.  The dbf header > >>has a one-byte field to hold the encoding of the file.  For example, > >>\x03 is code-pag

Re: [OT] Supporting "homework" (was: Re: Checking a Number for Palindromic Behavior)

2009-10-23 Thread Mel
Dieter Maurer wrote: > Steven D'Aprano writes on 20 Oct > 2009 05:35:18 GMT: >> As far as I'm concerned, asking for help on homework without being honest >> up-front about it and making an effort first, is cheating by breaking the >> social contract. Anyone who rewards cheaters by giving them the

Help with code = Extract numerical value to variable

2009-10-23 Thread Steve
I have some data that I'm performing some analysis on. How do I grab the numerical value if it's present and ignore otherwise. So in the following example I would have assign the following values to my var 16 20 2 7 0 In Field6 Sample String data is sold: 16 sold: 20 sold: 2 sold: 0 sold: 7 0 s

Re: a splitting headache

2009-10-23 Thread Mensanator
On Oct 22, 2:23 pm, Falcolas wrote: > On Oct 22, 11:56 am, Mensanator wrote: > [massive snip] > > > Yes, AFTER you read the docs. > > Not to feed the troll, I prefer the term "gadfly". > but obligatory reference to XKCD: > > http://xkcd.com/293/ -- http://mail.python.org/mailman/listinfo/pyth

Re: a splitting headache

2009-10-23 Thread Mensanator
On Oct 22, 1:22 pm, Paul Rudin wrote: > Mensanator writes: > > No one ever considers making life easy for the user. > > That's a bizarre assertion. I have a bad habit of doing that. -- http://mail.python.org/mailman/listinfo/python-list

Re: a splitting headache

2009-10-23 Thread Paul Rudin
Mensanator writes: > No one ever considers making life easy for the user. That's a bizarre assertion. -- http://mail.python.org/mailman/listinfo/python-list

Re: Cpython optimization

2009-10-23 Thread MRAB
Olof Bjarnason wrote: [snip] A short question after having read through most of this thread, on the same subject (time-optimizing CPython): http://mail.python.org/pipermail/python-list/2007-September/098964.html We are experiencing multi-core processor kernels more and more these days. But th

PyGUI menubar

2009-10-23 Thread dr k
I want to completely eliminate the menu bar from my PyGUI 2.0.5 application. the obvious thing, app.menus = [] doesn't work. i want not only the menus but the menu bar to disappear. help? [ a quick look at the code makes me suspect that it cannot be done presently but maybe there is a sneaky

Re: Cpython optimization

2009-10-23 Thread Terry Reedy
Qrees wrote: Hello As my Master's dissertation I chose Cpython optimization. That's why i'd like to ask what are your suggestions what can be optimized. Well, I know that quite a lot. I've downloaded the source code (I plan to work on Cpython 2.6 and I've downloaded 2.6.3 release). By looking at

Re: Python 2.6 Deprecation Warnings with __new__ — Can someone expla in why?

2009-10-23 Thread Terry Reedy
Consider this: def blackhole(*args, **kwds): pass The fact that it accept args that it ignores could be considered misleading or even a bug. Now modify it to do something useful, like return a new, naked, immutable object that is the same for every call except for identity, and which still t