split a string with quoted parts into list

2005-03-10 Thread oliver
hi there i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with ['(\\HasNo

{VIRUS?} Returned mail: see transcript for details

2005-03-10 Thread Post Office
Warning: This message has had one or more attachments removed. Warning: Please read the "VirusWarning.txt" attachment(s) for more information. Dear user python-list@python.org, We have detected that your email account has been used to send a huge amount of spam during the recent week. We suspect

Re: capturing text from a GUI window

2005-03-10 Thread Josef Meile
Hi Earl, Anyone know how to capture text from GUI output? I need to process information returned via a GUI window. Earl Assuming Windows, then these guys have an interesting tool: http://www.skesoft.com/textcatch.htm It's not free, but you can try it before you buy it. You will need COM to cont

Re: looking for case insesitive dictionary

2005-03-10 Thread Fuzzyman
http://www.voidspace.org.uk/python/modules.shtml#caseless Case Insensitive Dictionary, List and Sort Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: split a string with quoted parts into list

2005-03-10 Thread Daniel Dittmar
oliver wrote: i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with ['(\\Ha

Re: Python docs [was: function with a state]

2005-03-10 Thread Patrick Useldinger
You don't understand the "global" statement in Python, but you do understand Software industry in general? Smart... -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread Patrick Useldinger
I wrote something similar, have a look at http://www.homepages.lu/pu/fdups.html. -- http://mail.python.org/mailman/listinfo/python-list

Re: split a string with quoted parts into list

2005-03-10 Thread Diez B. Roggisch
> is there another way to convert a string with quoted sub entries into a > list of strings? try the csv-module. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: thread end and make main program end also?

2005-03-10 Thread Diez B. Roggisch
> is it the default behavior of thread return? Thank a lot No. First of all: your code is clearly _not_ exposing the described behaviour - you talk about exception handling, but there is none done. And you don't say anything about what your doing in your "cont'" parts. If code run in a thre

Re: split a string with quoted parts into list

2005-03-10 Thread Max M
oliver wrote: hi there i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with

Re: An Odd Little Script

2005-03-10 Thread Nick Craig-Wood
Terry Hancock <[EMAIL PROTECTED]> wrote: > The only problem I see is the "in place" requirement, which seems silly > unless by "quite large" you mean multiple gigabytes. Surely Perl > actually makes a copy in the process even though you never see > it? If using "perl -i" then then it does mak

Globals between modules ?

2005-03-10 Thread PGMoscatt
Does Python allow a 'global' variable that can be used between different modules used within an app ? Pete -- http://mail.python.org/mailman/listinfo/python-list

Managing updates of client application using AutoUpdate+

2005-03-10 Thread noam_a_jacobs
Hi, I have a technical question for those smart cookies with update management experience. We use a product called EasyUpdate, from www.AutoUpdatePlus.com, to manage the updates of our app after it has been delivered to the client. From our perspective, it is great. However, we are now keen to pur

Re: Web framework

2005-03-10 Thread Gianluca Sartori
Hi Christian, thanks for your replay. I gave a quick look at cherryPy too, but I had the impression it wasn't enought to be used in a real world contest. What about performances? Can I safely consider it to develop an Intranet/Extranet? My main concern is with scalability. What will happend if my u

Re: Second argument to super().

2005-03-10 Thread John Roth
"Tobiah" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] What is the purpose of the second argument to super()? I've always found the docs to be fairly confusing. They didn't give me enough context to tell what was going on. I also find the terminology confusing: "type" seems to mean

Re: Web framework

2005-03-10 Thread Tim Jarman
Gianluca Sartori wrote: > Hi Christian, thanks for your replay. I gave a quick look at cherryPy > too, but I had the impression it wasn't enought to be used in a real > world contest. What about performances? Can I safely consider it to > develop an Intranet/Extranet? My main concern is with scala

Re: python cvs interface?

2005-03-10 Thread [EMAIL PROTECTED]
>From what it sounds like in your program, you're making an os.system() function call and waiting for the results, correct? Have you tried using the plethora of parallel system tools so that you don't have to wait for a command to finish? Using a function that will launch your command in a new th

Python 2.4, distutils, and pure python packages

2005-03-10 Thread Fuzzyman
Python 2.4 is built with Microsoft Visiual C++ 7. This means that it uses msvcr7.dll, which *isn't* a standard part of the windows operating system. This means that if you build a windows installer using distutils - it *requires* msvcr7.dll in order to run. This is true even if your package is a pu

Re: Web framework

2005-03-10 Thread Carlos Ribeiro
On 10 Mar 2005 03:30:28 -0800, Gianluca Sartori <[EMAIL PROTECTED]> wrote: > Hi Christian, thanks for your replay. I gave a quick look at cherryPy > too, but I had the impression it wasn't enought to be used in a real > world contest. What about performances? Can I safely consider it to > develop a

Re: split a string with quoted parts into list

2005-03-10 Thread Scott David Daniels
oliver wrote: i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a list. assume the string is in the variable f, then i tried f.split() but i end up with ['(\\Ha

Re: Globals between modules ?

2005-03-10 Thread Roy Smith
In article <[EMAIL PROTECTED]>, PGMoscatt <[EMAIL PROTECTED]> wrote: > Does Python allow a 'global' variable that can be used between different > modules used within an app ? > > Pete You could explicitly import __main__ and use that as a global namespace (see example below). Or (perhaps a be

newbie : prune os.walk

2005-03-10 Thread Rory Campbell-Lange
Hi. How can I list root and only one level down? I've tried setting dirs = [] if root != start root, but it doesn't work. I clearly don't understand how the function works. I'd be grateful for some pointers. Thanks Rory /tmp/test |-- 1 |-- 2 |-- 3 |-- 4 |-- one | |-- 1

Re: newbie : prune os.walk

2005-03-10 Thread Diez B. Roggisch
Untestet: def foo(base, depth=2): for root, dirs, files in os.walk(base, True): if len(root.split(os.sep)) < depth: yield root, dirs, files for root, dirs, files in foo("/tmp"): print root, dirs, files -- Regards, Diez B. Roggisch -- http://mail.python.org/ma

Re: Web framework

2005-03-10 Thread Chris
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Gianluca Sartori wrote: > > Hi guys, > > > > What web framework do you suggest to develop with? > > I really like CherryPy. It has a very intuitive design. A "directory" > is an object and the "files" in it are methods. URL variables

Re: Globals between modules ?

2005-03-10 Thread PGMoscatt
Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > PGMoscatt <[EMAIL PROTECTED]> wrote: > >> Does Python allow a 'global' variable that can be used between different >> modules used within an app ? >> >> Pete > > You could explicitly import __main__ and use that as a global namespace > (see

Re: Web framework

2005-03-10 Thread Lutz Horn
Chris <[EMAIL PROTECTED]> wrote: > Does CherryPy require a python installation on the client side? No, it only sends HTML-pages and other media to the client's browser. -- http://mail.python.org/mailman/listinfo/python-list

mysqldb issue

2005-03-10 Thread fedor
Hi all, I have a problem with mysql connections. After about 28000-29000 connections, I get a "Can't connect to MySQL server on '127.0.0.1'" error. I have made a small program which generates the error """ import MySQLdb for i in range(3): if not i % 100: print i

Re: newbie : prune os.walk

2005-03-10 Thread Peter Hansen
Rory Campbell-Lange wrote: Hi. How can I list root and only one level down? I've tried setting dirs = [] if root != start root, but it doesn't work. It sounds like you are trying to take advantage of the feature described in the docs where "the caller can modify the dirnames list in-place (perhaps

Re: Python 2.4, distutils, and pure python packages

2005-03-10 Thread Thomas Heller
[CC to python-dev] "Fuzzyman" <[EMAIL PROTECTED]> writes: > Python 2.4 is built with Microsoft Visiual C++ 7. This means that it > uses msvcr7.dll, which *isn't* a standard part of the windows operating > system. Nitpicking - it's MSVC 7.1, aka MS Visual Studio .NET 2003, and it's msvcr71.dll. >

Re: shuffle the lines of a large file

2005-03-10 Thread Stefan Behnel
Simon Brunning wrote: On Tue, 8 Mar 2005 14:13:01 +, Simon Brunning wrote: selected_lines = list(None for line_no in xrange(lines)) Just a short note on this line. If lines is really large, its much faster to use from itertools import repeat selected_lines = list(repeat(None, len(lines)))

Re: pyasm 0.2 - dynamic x86 assembler for python

2005-03-10 Thread Stefan Behnel
Hi! What about an interface like this: -- @pyasm def hello_world(*some_args): """ !CHARS hello_str 'Hello world!\n\0' !PROC hello_world PYTHON !ARG self !ARG args PUSH hello_str CALL PySys_WriteStdout ADD ESP, 0x4

modifiable config files in compiled code?

2005-03-10 Thread [EMAIL PROTECTED]
Hi All, I've been trying to come up with an elegant solution to this problem, but can't seem to think of anything better than my solution below. I have a Python program that needs to be converted into an executable. The problem is that I have a "config" template file that I've been using to modif

Re: shuffle the lines of a large file

2005-03-10 Thread Simon Brunning
On Thu, 10 Mar 2005 14:37:25 +0100, Stefan Behnel <[EMAIL PROTECTED]> > There. Factor 10. That's what I call optimization... The simplest approach is even faster: C:\>python -m timeit -s "from itertools import repeat" "[None for i in range(1)]" 100 loops, best of 3: 2.53 msec per loop C:\>p

Re: modifiable config files in compiled code?

2005-03-10 Thread Tom Willis
10 Mar 2005 06:02:22 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi All, > > I've been trying to come up with an elegant solution to this problem, > but can't seem to think of anything better than my solution below. > > I have a Python program that needs to be converted into an executa

Re: How to script DOS app that doesn't use stdout

2005-03-10 Thread Harlin Seritt
"Phantom of the Keyboard" ... now that's a name! -- http://mail.python.org/mailman/listinfo/python-list

SAX: Help on processing qualified attribute values

2005-03-10 Thread Markus Doering
Hey, I am trying to process XML schema documents using namespace aware SAX handlers. Currently I am using the default python 2.3 parser: parser = xml.sax.make_parser() parser.setFeature(xml.sax.handler.feature_namespaces, 1) At some point I need to parse xml attributes which contain namespace pr

RELEASED Python 2.4.1, release candidate 1

2005-03-10 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.4.1 (release candidate 1). Python 2.4.1 is a bug-fix release. See the release notes at the website (also available as Misc/NEWS in the source distribution) for details of the bugs squis

Re: Second argument to super().

2005-03-10 Thread Steve Holden
John Roth wrote: "Tobiah" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] What is the purpose of the second argument to super()? I've always found the docs to be fairly confusing. They didn't give me enough context to tell what was going on. I also find the terminology confusing: "t

Re: python open source charting solutions ?

2005-03-10 Thread Frithiof Andreas Jensen
"ionel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > i need some pointers. > so far i've tryed matplotlib ... What For, exactly? For time series, RRD-Tools (Round-Robin Database) works very well. -- http://mail.python.org/mailman/listinfo/python-list

Re: modifiable config files in compiled code?

2005-03-10 Thread Larry Bates
Note: my comments assume Windows distribution. Why do you think you can't you have a config file after you convert your program to an executable? I do it all the time and so do many other programs. The .INI config file is just a separate file that provides a good way to pass client supplied info

[ANN] ConfigObj Update and New PythonUtils Package

2005-03-10 Thread Fuzzyman
ConfigObj has had another update - now version 3.3.0 Several of the Voidspace PythonUtils modules have been packaged together as the 'Voidspace Pythonutils Package'. This makes it easier to release packages that depend on ConfigObj and the other modules. This update includes several important new

[ANN] Pythonutils updates - approx, approxClientproxy, caseless etc

2005-03-10 Thread Fuzzyman
Various of the Voidspace Pythonutils modules have been updated. http://www.voidspace.org.uk/python/index.shtml approx.py has been updated (Python CGI Proxy script) approxClientproxy.py version 2.0 is available listquote, caseless, linky, and downman have all been updated. *MAJOR UPDATE* approx

Re: i18n: looking for expertise

2005-03-10 Thread klappnase
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Michael: > > on my box, (winXP SP2), sys.getfilesystemencoding() returns 'mbcs'. Oh, from the reading docs I had thought XP would use unicode: * On Windows 9x, the encoding is ``mbcs''. * On Mac OS X, the en

How do I set up a timer as a subprocess?

2005-03-10 Thread Dfenestr8
Hi. Trying to set up a timer function for my irc bot, which uses the python irclib.py. If I use time.sleep(20), it tends to freeze up the bot completely for 20 secs. That's not what I want though! I want the program to wait 20 secs, then perform another function, but in the meantime be able to ac

Re: How do I set up a timer as a subprocess?

2005-03-10 Thread Daniel Schüle
Hi > Trying to set up a timer function for my irc bot, which uses the python > irclib.py. > > If I use time.sleep(20), it tends to freeze up the bot completely for 20 > secs. That's not what I want though! I want the program to wait 20 secs, > then perform another function, but in the meantime be

Re: How do I set up a timer as a subprocess?

2005-03-10 Thread Shitiz Bansal
import threading def hello(): print "hello, world" t = threading.Timer(30.0, hello) t.start() # after 30 seconds, "hello, world" will be printed --- Dfenestr8 <[EMAIL PROTECTED]> wrote: > Hi. > > Trying to set up a timer function for my irc bot, > which uses the python > irclib.py. > > If

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread TZOTZIOY
On Wed, 9 Mar 2005 16:13:20 -0600, rumours say that Terry Hancock <[EMAIL PROTECTED]> might have written: >For anyone interested in responding to the above, a starting >place might be this maintenance script I wrote for my own use. I don't >think it exactly matches the spec, but it addresses the

newbie: dictionary - howto get key value

2005-03-10 Thread G. Völkl
Hello, I use a dictionary: phone = {'mike':10,'sue':8,'john':3} phone['mike'] --> 10 I want to know who has number 3? 3 --> 'john' How to get it in the python way ? Thanks Gerhard -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread P
I've written a python GUI wrapper around some shell scripts: http://www.pixelbeat.org/fslint/ the shell script logic is essentially: exclude hard linked files only include files where there are more than 1 with the same size print files with matching md5sum Pádraig. -- http://mail.python.org/mailma

[Pmw] reusing a graph after deleting a curve

2005-03-10 Thread giacomo boffi
my question: is it possible to erase a graph, and reuse it? like in # x -> compute -> y g=Pmw.Blt.Graph(); g.pack() g.line_create(name,x,y) # other computing -> a better y # do something to g, erasing the previous plot #[the above is the part that i cannot understand...] g.line_create(name,x

Re: BaseHTTPServer.BaseHTTPRequestHandler and HTTP chunking

2005-03-10 Thread Venkat B
> No. Hardly any HTTP 1.1 features are supported. Hi all, I'd like to know more about the limitations. Somewhere, is there a list of the actual subset of HTTP 1.1 features supported. There's not much related info at the python.org site. There appears to be just a limited note on 1.1 in http://ww

RE: newbie: dictionary - howto get key value

2005-03-10 Thread Michael . Coll-Barth
how about? test = 3 #find person with this number for x in xrange(len(phone.keys())): print x if phone[phone.keys()[x]] == test: print phone.keys()[x] break Being a newbie myself, I'd love a little critique on the above. Be kind as I don't know what else needs to be done

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread TZOTZIOY
On Thu, 10 Mar 2005 10:54:05 +0100, rumours say that Patrick Useldinger <[EMAIL PROTECTED]> might have written: >I wrote something similar, have a look at >http://www.homepages.lu/pu/fdups.html. That's fast and good. A minor nit-pick: `fdups.py -r .` does nothing (at least on Linux). Have you

Re: newbie: dictionary - howto get key value

2005-03-10 Thread Diez B. Roggisch
phone = {'mike':10,'sue':8,'john':3} print [key for key, value in phone.items() if value == 3] -> ['john'] -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

How can I Read/Write multiple sequential Binary/Text data files

2005-03-10 Thread Albert Tu
Dear there, We have an x-ray CT system. The acquisition computer acquires x-ray projections and outputs multiple data files in binary format (2-byte unsigned integer) such as projection0.raw, projection1.raw, projection2.raw ... up to projection500.raw. Each file is 2*1024*768-byte big. I would l

Re: mysqldb issue

2005-03-10 Thread Steve Holden
fedor wrote: Hi all, I have a problem with mysql connections. After about 28000-29000 connections, I get a "Can't connect to MySQL server on '127.0.0.1'" error. I have made a small program which generates the error """ import MySQLdb for i in range(3): if not i % 100:

Re: newbie: dictionary - howto get key value

2005-03-10 Thread bruno modulix
G. Völkl wrote: Hello, I use a dictionary: phone = {'mike':10,'sue':8,'john':3} phone['mike'] --> 10 I want to know who has number 3? 3 --> 'john' Note that you can have many keys with the same value: phone = {'mike':10,'sue':8,'john':3, 'jack': 3, 'helen' : 10} How to get it in the python way

Re: modifiable config files in compiled code?

2005-03-10 Thread Steve Holden
Larry Bates wrote: Note: my comments assume Windows distribution. Why do you think you can't you have a config file after you convert your program to an executable? I do it all the time and so do many I suspect the OP's config file is a Python module. regards Steve -- http://mail.python.org/mailm

Re: newbie: dictionary - howto get key value

2005-03-10 Thread Jeremy Jones
G. Völkl wrote: Hello, I use a dictionary: phone = {'mike':10,'sue':8,'john':3} phone['mike'] --> 10 I want to know who has number 3? 3 --> 'john' How to get it in the python way ? Thanks Gerhard How 'bout a list comprehension: In [1]:phone = {'mike':10,'sue':8,'john':3, 'billy':3} In [

Re: Code evaluation at function definition execution time (was Re: Compile time evaluation (aka eliminating default argument hacks))

2005-03-10 Thread Bengt Richter
# presets.py -- a decorator to preset function local variables without a default-argument hack or closure # also does currying, with adjustment of argument count, eliminating named arguments from right. # 20050310 09:22:15 -- alpha 0.01 release -- bokr # Released to the public domain WITH

Re: How can I Read/Write multiple sequential Binary/Text data files

2005-03-10 Thread TZOTZIOY
On 10 Mar 2005 09:41:05 -0800, rumours say that "Albert Tu" <[EMAIL PROTECTED]> might have written: >Dear there, > >We have an x-ray CT system. The acquisition computer acquires x-ray >projections and outputs multiple data files in binary format (2-byte >unsigned integer) such as projection0.raw,

Re: newbie: dictionary - howto get key value

2005-03-10 Thread bruno modulix
[EMAIL PROTECTED] wrote: (top-post corrected) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] n.org]On Behalf Of G. Völkl Sent: Thursday, March 10, 2005 12:19 PM To: python-list@python.org Subject: newbie: dictionary - howto get key value Hello, I use a dictionary: phon

Re: newbie: dictionary - howto get key value

2005-03-10 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > test = 3 #find person with this number > for x in xrange(len(phone.keys())): > print x >if phone[phone.keys()[x]] == test: > print phone.keys()[x] > break > >Being a newbie myself, I'd love a little critique on the

Re: PyAsm

2005-03-10 Thread Roger Binns
"Stefan Behnel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Meaning: Put the assembler into the doc-string of a function. That has several issues. One is that you can't do string operations with it. Say you wanted some %d, %s etc in the string. If you use a documentation gene

Re: modifiable config files in compiled code?

2005-03-10 Thread Tom Willis
On Thu, 10 Mar 2005 13:01:28 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: > Larry Bates wrote: > > Note: my comments assume Windows distribution. > > > > Why do you think you can't you have a config file after you convert > > your program to an executable? I do it all the time and so do many >

Re: python cvs interface?

2005-03-10 Thread Lonnie Princehouse
Unless your CVS repository is local, the overhead associated with calling CVS through system calls isn't going to be a bottleneck, and even then it shouldn't be too bad. Using one of the varieties of os.popen instead of os.system will make it easier to avoid disk I/O when communicating with the cv

Re: os.walk(entire filesystem)

2005-03-10 Thread Uwe Becher
rbt wrote: More of an OS question than a Python question, but it is Python related so here goes: When I do os.walk('/') on a Linux computer, the entire file system is walked. On windows, however, I can only walk one drive at a time (C:\, D:\, etc.). Is there a way to make os.walk() behave on Wi

Re: newbie : prune os.walk

2005-03-10 Thread Scott David Daniels
Rory Campbell-Lange wrote: Hi. How can I list root and only one level down? I've tried setting dirs = [] if root != start root, but it doesn't work. I clearly don't understand how the function works. I'd be grateful for some pointers. base = '/tmp/test' for root, dirs, files in os.walk(base

Re: python cvs interface?

2005-03-10 Thread corey
Well, the problem is that there are a lot of files to deal with, and I'm already running in parallel, but it still takes a while. Also, cvs uses some sort of locking scheme to stop parallel updates, so it's hard to parallelize effectively. -- http://mail.python.org/mailman/listinfo/python-list

FW: list reduction

2005-03-10 Thread Leeds, Mark
  I have a structure in python that I think is a list with elements .Cap and .Ticker where Cap is a float and Ticker is string.   So, I reference things like industrylist[i].cap and industrylist[i].ticker and this works fine.   What I want to do is reduce the list so that it only

Re: FW: list reduction

2005-03-10 Thread James Stroud
newlist = [y.cap for y in industrylist if y.cap < x] On Thursday 10 March 2005 12:00 pm, Leeds, Mark wrote: > I have a structure in python that I think is a list > > with elements .Cap and .Ticker > > where Cap is a float and Ticker is string. > > > > So, I reference things like > > industrylist[i

Re: PyAsm

2005-03-10 Thread olsongt
Hey Roger, I didn't realize that Stefan replied to the list and sent a private email reply. There seemed to be a lag in google groups today. I basically told him that I might be crazy enough to write an assembler in python, but I'm not crazy enough to start using those function decorators. I'm

instantiate new objects

2005-03-10 Thread Felix Steffenhagen
Hello @ all, i'm a newbie in python and have written a module for computations in a bayesian network. The module can be found at: http://www.informatik.uni-freiburg.de/~steffenh/bayes.py In this module i define four classes. - cdp (conditional probability [distribution]) consisting of cdp_entry

Re: How can I Read/Write multiple sequential Binary/Text data files

2005-03-10 Thread John Machin
On Thu, 10 Mar 2005 20:06:29 +0200, Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> wrote: >On 10 Mar 2005 09:41:05 -0800, rumours say that "Albert Tu" ><[EMAIL PROTECTED]> might have written: > >>Dear there, >> >>We have an x-ray CT system. The acquisition computer acquires x-ray >>projections a

Re: How can I Read/Write multiple sequential Binary/Text data files

2005-03-10 Thread Bengt Richter
On 10 Mar 2005 09:41:05 -0800, "Albert Tu" <[EMAIL PROTECTED]> wrote: >Dear there, > >We have an x-ray CT system. The acquisition computer acquires x-ray >projections and outputs multiple data files in binary format (2-byte >unsigned integer) such as projection0.raw, projection1.raw, >projection2.

Iterate using tuple as index

2005-03-10 Thread James Stroud
Hello, Its not obvious to me how to do this. I would like to iterate using a tuple as an index. Say I have two equivalently sized arrays, what I do now seems inelegant: for index, list1_item in enumerate(firstlist): do_something(list1_item, secondlist[index]) I would like something more like

Re: Iterate using tuple as index

2005-03-10 Thread Michael Spencer
James Stroud wrote: Hello, Its not obvious to me how to do this. I would like to iterate using a tuple as an index. Say I have two equivalently sized arrays, what I do now seems inelegant: for index, list1_item in enumerate(firstlist): do_something(list1_item, secondlist[index]) I would like s

Re: Iterate using tuple as index

2005-03-10 Thread Terry Reedy
"James Stroud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Its not obvious to me how to do this. I would like to iterate using a > tuple as > an index. Say I have two equivalently sized arrays, what I do now seems > inelegant: Sounds like you want zip(firstlist, secondlist).

Re: Iterate using tuple as index

2005-03-10 Thread F. Petitjean
Le Thu, 10 Mar 2005 13:12:31 -0800, James Stroud a écrit : > Hello, > > Its not obvious to me how to do this. I would like to iterate using a tuple > as > an index. Say I have two equivalently sized arrays, what I do now seems > inelegant: > > for index, list1_item in enumerate(firstlist): >

Re: Iterate using tuple as index

2005-03-10 Thread Tim Jarman
James Stroud wrote: > Hello, > > Its not obvious to me how to do this. I would like to iterate using a > tuple as an index. Say I have two equivalently sized arrays, what I do now > seems inelegant: > > for index, list1_item in enumerate(firstlist): > do_something(list1_item, secondlist[index]

Re: Iterate using tuple as index

2005-03-10 Thread James Stroud
Thank you everyone for pointing me to "zip". Very Handy! James -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterate using tuple as index

2005-03-10 Thread Bengt Richter
On Thu, 10 Mar 2005 13:12:31 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >Hello, > >Its not obvious to me how to do this. I would like to iterate using a tuple as >an index. Say I have two equivalently sized arrays, what I do now seems >inelegant: > >for index, list1_item in enumerate(firstli

Re: Recognizing the Arrival of a New File

2005-03-10 Thread John Lenton
On Tue, Mar 08, 2005 at 08:43:04AM -0600, Greg Lindstrom wrote: > I am writing an application where I need to recognize when a file > arrives in a given directory. Files may arrive at any time during the > course of the day. Do I set up a cron job to poll the directory every > few minutes? Wr

Re: char buffer

2005-03-10 Thread Jaime Wyant
You'll probably want to be more specific. First thing that comes to mind is how do you plan on passing the `buffer' to your `test app'. I can think of a couple of ways off hand -- socket, stdin or maybe as a command line argument. If you're doing one of those, then I don't think you'll need a bu

Re: char buffer

2005-03-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello all, > > I need to create 6 buffers in python and keep track of it. > I need to pass this buffer, say buffer 1 as an index to a test app. Has > any one tried to do this. Any help with buffer management appreciated. Use the module array. -- Regards, Diez B. Rog

Re: char buffer

2005-03-10 Thread doodle4
Each buffer need to hold 512 bytes of data. Thanks, -Joe -- http://mail.python.org/mailman/listinfo/python-list

Start new process by function ?

2005-03-10 Thread George Sakkis
Is it possible to start a new process by specifying a function call (in similar function to thread targets) instead of having to write the function in a separate script and call it through os.system or os.spawn* ? That is, something like def foo(): pass os.spawn(foo) Thanks in advance, George

Re: instantiate new objects

2005-03-10 Thread Michael Spencer
Felix Steffenhagen wrote: [snip] > In: http://www.informatik.uni-freiburg.de/~steffenh/bayes.py > [bayes.test gives different results each time it is called] Without looking in the slightest at what you are implementing or how, this implies that state is maintained between calls to test The quest

Re: Iterate using tuple as index

2005-03-10 Thread Roy Smith
James Stroud <[EMAIL PROTECTED]> wrote: >I would like something more like this: > >for list1_item, list2_item in (some_kind_of_expression): > do_something(list1_item, list2_item) I believe you want: for list1_item, list2_item in zip (list1, list2): blah -- http://mail.python.org/mailman/li

'Browse' button for *.txt file?

2005-03-10 Thread Fred
Hi I am searching for a module, that would allow me to call files by using a 'browse' button. Is there any uniform module for browsing files, or is there a special module for *.txt files? Thanks Fred -- http://mail.python.org/mailman/listinfo/python-list

Re: Start new process by function ?

2005-03-10 Thread Mathias Waack
George Sakkis wrote: > Is it possible to start a new process by specifying a function call > (in similar function to thread targets) instead of having to write > the function in a separate script and call it through os.system or > os.spawn* ? That is, something like > > def foo(): pass > os.spawn

Re: RELEASED Python 2.4.1, release candidate 1

2005-03-10 Thread Tim N. van der Leeuw
Hi, I have a problem with Python2.4 and win32com extensions, from Mark Hammond's win32all package... I posted a few days back about a crash when compiling files generated by win32com's 'makepy.py' utility. Now these generated files, which are fine in Python 2.3.5, give a syntax error on compile.

char buffer

2005-03-10 Thread doodle4
Hello all, I need to create 6 buffers in python and keep track of it. I need to pass this buffer, say buffer 1 as an index to a test app. Has any one tried to do this. Any help with buffer management appreciated. Thanks, -Joe -- http://mail.python.org/mailman/listinfo/python-list

Re: 'Browse' button for *.txt file?

2005-03-10 Thread Peter Hansen
Fred wrote: I am searching for a module, that would allow me to call files by using a 'browse' button. Is there any uniform module for browsing files, or is there a special module for *.txt files? I think you'll want to take some time to put your requirements into different words. Much of what you

Re: Code evaluation at function definition execution time (was Re: Compile time evaluation (aka eliminating default argument hacks))

2005-03-10 Thread Carl Banks
Nick Coghlan wrote: > Anyway, if others agree that the ability to execute a suite at def exeuction > time to preinitialise a function's locals without resorting to bytecode hacks is > worth having, finding a decent syntax is the next trick :) Workarounds: 1. Just use a freaking global, especially

Re: Code evaluation at function definition execution time (was Re: Compile time evaluation (aka eliminating default argument hacks))

2005-03-10 Thread Carl Banks
Carl Banks wrote: > I could, however, see myself > using the slightly more complicated descriptor such as this (for a > wholly different reason, though): > > . def call_with_open_file(filename): > . def descriptor(func): > . flo = open(filename) > . try: f(flo) > . fi

multiple buffers management

2005-03-10 Thread doodle4
Hello, I need to create 6 buffers in python and keep track of it. I need to pass this buffer, say buffer 1 as an index to a test app. Has any one tried to do this. Any help with buffer management appreciated. Each buffer needs to hold 512 bytes of data. Thanks, -Joe -- http://mail.python.org

Re: RELEASED Python 2.4.1, release candidate 1

2005-03-10 Thread Roger Upole
Does the workaround for the crash do anything for this problem ? Mark has changed the makepy code to break up long lines, and a new build of Pywin32 should be out before long. Roger "Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I have a

Re: instantiate new objects

2005-03-10 Thread Felix Steffenhagen
The default mutual parameters in the method bayes.generate_cpd(...) was the problem, thanks alot for the hint and for this code snippet to find such problems :-). Greetings, Felix Michael Spencer wrote: Without looking in the slightest at what you are implementing or how, this implies that state i

Re: [perl-python] a program to delete duplicate files

2005-03-10 Thread Patrick Useldinger
Christos TZOTZIOY Georgiou wrote: On POSIX filesystems, one has also to avoid comparing files having same (st_dev, st_inum), because you know that they are the same file. I then have a bug here - I consider all files with the same inode equal, but according to what you say I need to consider the

  1   2   >