selective logger disable/enable

2007-01-18 Thread Gary Jefferson
Suppose I have 3 modules that belong to a project, 'A', 'A.a' and 'B', and each module has its own logger, created with: module1logger = logging.getLogger('project.A') and module2logger = logging.getLogger('project.A.a') and module3logger = logging.getLogger('project.B') And I want to select

Re: Why this script can work?

2007-01-18 Thread Robert Kern
Jm lists wrote: > Please help with this script: > > class ShortInputException(Exception): > '''A user-defined exception class.''' > def __init__(self,length,atleast): > Exception.__init__(self) > self.length=length > self.atleast=atle

Why this script can work?

2007-01-18 Thread Jm lists
Please help with this script: class ShortInputException(Exception): '''A user-defined exception class.''' def __init__(self,length,atleast): Exception.__init__(self) self.length=length self.atleast=atleast try: s=raw_input('E

Re: How to pass arguments to the function embedded in the timeit.Timer()

2007-01-18 Thread Gabriel Genellina
At Thursday 18/1/2007 21:31, Dongsheng Ruan wrote: Does anybody know how to pass multiple arguments to the function tested in timeit.timer() in python? I googled and found how to pass one argument: x=1 mytime = timeit.Timer( setup="from Createlst import createlst", stmt= "createlst(%

Re: Determining when a file is an Open Office Document

2007-01-18 Thread tubby
Ross Ridge wrote: > tubby wrote: >> Silly question, but here goes... what's a good way to determine when a >> file is an Open Office document? I could look at the file extension, but >> it seems there would be a better way. VI shows this info in the files: >> >> mimetypeapplication/vnd.oasis.opendo

Re: Iterator length

2007-01-18 Thread Gabriel Genellina
At Thursday 18/1/2007 20:26, [EMAIL PROTECTED] wrote: def leniter(iterator): """leniter(iterator): return the length of an iterator, consuming it.""" if hasattr(iterator, "__len__"): return len(iterator) nelements = 0 for _ in iterator: nelements += 1 retu

Re: Anyone has a nice "view_var" procedure ?

2007-01-18 Thread Gabriel Genellina
At Thursday 18/1/2007 19:24, Stef Mientki wrote: > str(key)[7:-2] => key.__name__ I didn't know that one It's here: http://docs.python.org/lib/specialattrs.html -- Gabriel Genellina Softlab SRL __ Pregun

Re: Making a simple script standalone

2007-01-18 Thread Ravi Teja
On Jan 18, 2:19 pm, Rikishi 42 <[EMAIL PROTECTED]> wrote: > On Thursday 18 January 2007 10:13, robert wrote: > > > stay with py23 for "a script" (and more) and make <700kB > > independent distros - UPX and 7zip involved: > > >http://groups.google.com/group/comp.lang.python/msg/edf469a1b3dc3802Tha

subclassing pyrex extension types in python

2007-01-18 Thread Nitin
Hi All I am trying to subclass an extension type in Python and add attributes to the new class but I keep getting errors. I read the "Extension Types" document on the Pyrex website but I couldn't get an answer from it. Here's the Spam extension type from Pyrex website: cdef class Spam: cdef i

Re: Match 2 words in a line of file

2007-01-18 Thread Rickard Lindberg
I see two potential problems with the non regex solutions. 1) Consider a line: "foo (bar)". When you split it you will only get two strings, as split by default only splits the string on white space characters. Thus "'bar' in words" will return false, even though bar is a word in that line. 2) If

Re: More M2Crypto issues

2007-01-18 Thread Gabriel Genellina
At Thursday 18/1/2007 04:41, John Nagle wrote: I've been running M2Crypto successfully using Python 2.4 on Windows 2000, and now I'm trying to get it to work on Python 2.3.4 on Linux. Attempting to initialize a context results in Traceback (most recent call last): File "/www/htdocs/si

Re: Match 2 words in a line of file

2007-01-18 Thread bearophileHUGS
MrJean1 wrote: > def lines_with_words(file, word1, word2): > """Print all lines in file that have both words in it.""" > for line in file: > words = line.split() > if word1 in words and word2 in words: > print line This sounds better, it's probably faster than t

Re: Match 2 words in a line of file

2007-01-18 Thread MrJean1
Without using re, this may work (untested ;-): def lines_with_words(file, word1, word2): """Print all lines in file that have both words in it.""" for line in file: words = line.split() if word1 in words and word2 in words: print line /Jean Brouwers Rickard

Re: Determining when a file is an Open Office Document

2007-01-18 Thread Ross Ridge
tubby wrote: > Silly question, but here goes... what's a good way to determine when a > file is an Open Office document? I could look at the file extension, but > it seems there would be a better way. VI shows this info in the files: > > mimetypeapplication/vnd.oasis.opendocument.textPK It's a ZIP

Re: Determining when a file is an Open Office Document

2007-01-18 Thread Ross Ridge
tubby wrote: > Silly question, but here goes... what's a good way to determine when a > file is an Open Office document? I could look at the file extension, but > it seems there would be a better way. VI shows this info in the files: > > mimetypeapplication/vnd.oasis.opendocument.textPK It's a ZIP

Re: Using lambda with a Pmw.ComboBox

2007-01-18 Thread Willie
I will post a sample tomorrow AM. James Stroud wrote: > Can you show us your code? Your question is ambiguous to me. Comboboxes > do not hold widgets but display text. -- http://mail.python.org/mailman/listinfo/python-list

Re: Determining when a file is an Open Office Document

2007-01-18 Thread Ben Finney
tubby <[EMAIL PROTECTED]> writes: > Silly question, but here goes... what's a good way to determine when > a file is an Open Office document? I could look at the file > extension, but it seems there would be a better way. Yes, the name of a file may be useful for communicating with humans about t

Re: Iterator length

2007-01-18 Thread Ben Finney
[EMAIL PROTECTED] writes: > But sometimes you don't need the elements of a given iterator, you > just need to know how many elements it has. AFAIK, the iterator protocol doesn't allow for that. Bear in mind, too, that there's no way to tell from outside that an iterater even has a finite length;

Determining when a file is an Open Office Document

2007-01-18 Thread tubby
Silly question, but here goes... what's a good way to determine when a file is an Open Office document? I could look at the file extension, but it seems there would be a better way. VI shows this info in the files: mimetypeapplication/vnd.oasis.opendocument.textPK mimetypeapplication/vnd.oasis.o

Re: Using lambda with a Pmw.ComboBox

2007-01-18 Thread James Stroud
Willie wrote: > Hi, > > I have an array of 2 ComboBoxes. I would like to use lambda to report > on which widget is being accessed. When I use arrays of other widgets I > just use lambda to return which item I am using as an argument. This > does not seem to work with ComboBox, the only thing retur

Re: Iterator length

2007-01-18 Thread bearophileHUGS
George Sakkis: > Is this a rhetorical question ? If not, try this: It wasn't a rhetorical question. > >>> x = (i for i in xrange(100) if i&1) > >>> if leniter(x): print x.next() What's your point? Maybe you mean that it consumes the given iterator? I am aware of that, it's written in the functi

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-18 Thread MRAB
David Bostwick wrote: > In article <[EMAIL PROTECTED]>, "Robert Hicks" <[EMAIL PROTECTED]> wrote: > >Please, none of the real facts points to anything else except what > >actually happened. Two planes hit two towers and they came down. > > > > You're talking to the wind. This is a conspiracy prec

Re: Iterator length

2007-01-18 Thread George Sakkis
[EMAIL PROTECTED] wrote: > Often I need to tell the len of an iterator, this is a stupid example: > > >>> l = (i for i in xrange(100) if i&1) > > len isn't able to tell it: > > >>> len(l) > Traceback (most recent call last): > File "", line 1, in > TypeError: object of type 'generator' has no l

Using lambda with a Pmw.ComboBox

2007-01-18 Thread Willie
Hi, I have an array of 2 ComboBoxes. I would like to use lambda to report on which widget is being accessed. When I use arrays of other widgets I just use lambda to return which item I am using as an argument. This does not seem to work with ComboBox, the only thing returned is the value changed.

Free Downloads, Wallpapers, Games, Eroticgames, Handy-Logos and much more

2007-01-18 Thread Major27104
-- http://mail.python.org/mailman/listinfo/python-list

How to pass arguments to the function embedded in the timeit.Timer()

2007-01-18 Thread Dongsheng Ruan
Hi Does anybody know how to pass multiple arguments to the function tested in timeit.timer() in python? I googled and found how to pass one argument: x=1 mytime = timeit.Timer( setup="from Createlst import createlst", stmt= "createlst(%s)"%(x) ) But how can I extend it to two or more

Re: Match 2 words in a line of file

2007-01-18 Thread Rickard Lindberg
[EMAIL PROTECTED] wrote: > Hi > > Am pretty new to python and hence this question.. > > I have file with an output of a process. I need to search this file one > line at a time and my pattern is that I am looking for the lines that > has the word 'event' and the word 'new'. > > Note that i need lin

Pass 'this' to a python script in an extended application

2007-01-18 Thread Stou Sandalski
Hi, I have an application consisting of a main C++ class (and other classes) stored inside a DLL. The application uses a small main executable that links against the main DLL, then initializes and runs the core class. The python bindings are inside a .pyd module that also links against the core

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-18 Thread schoenfeld . one
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > [...] > > > > Ask yourself, how can all these people, supposed physicists, engineers, > > software developers, people of supposed intelligence be incapable of > > understanding that fire cannot make buildings free

Re: A note on heapq module

2007-01-18 Thread Paul Rubin
Steven Bethard <[EMAIL PROTECTED]> writes: > Heap(sequence=None, inplace=False) > KeyedHeap(key, sequence=None) > Of course, this approach ends up with a bunch of code duplication again. Maybe there's a way to use a metaclass that can make either type of heap but they'd share most method

Match 2 words in a line of file

2007-01-18 Thread elrondrules
Hi Am pretty new to python and hence this question.. I have file with an output of a process. I need to search this file one line at a time and my pattern is that I am looking for the lines that has the word 'event' and the word 'new'. Note that i need lines that has both the words only and not

Re: what can be used in a signal handler

2007-01-18 Thread hg
Nick Maclaren wrote: > > In article <[EMAIL PROTECTED]>, > hg <[EMAIL PROTECTED]> writes: > |> > |> I posted an equivalent question earlier ... but am still not sure: > |> > |> I currently (under Linux) have a program that uses Queue.put > |> (raw_input('')) in a signal handler and Queue.get()

Re: A note on heapq module

2007-01-18 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Steven Bethard wrote: >> The current code fails when using unbound methods however:: > > I don't like your solution, this class was already slow enough. Don't > use unbound methods with this class :-) > Maybe there's a (better) solution to your problem: to make Heap a >

Iterator length

2007-01-18 Thread bearophileHUGS
Often I need to tell the len of an iterator, this is a stupid example: >>> l = (i for i in xrange(100) if i&1) len isn't able to tell it: >>> len(l) Traceback (most recent call last): File "", line 1, in TypeError: object of type 'generator' has no len() This is a bad solution, it may need t

Re: Making a simple script standalone

2007-01-18 Thread Rikishi 42
On Thursday 18 January 2007 10:13, robert wrote: > stay with py23 for "a script" (and more) and make <700kB > independent distros - UPX and 7zip involved: > > http://groups.google.com/group/comp.lang.python/msg/edf469a1b3dc3802 Thanks, that might be an option. But I might just convince the person

Re: Regex Question

2007-01-18 Thread Bill Mill
Gabriel Genellina wrote: > At Tuesday 16/1/2007 16:36, Bill Mill wrote: > > > > py> import re > > > py> rgx = re.compile('1?') > > > py> rgx.search('a1').groups() > > > (None,) > > > py> rgx = re.compile('(1)+') > > > py> rgx.search('a1').groups() > > > >But shouldn't the ? be greedy, and thus pre

Re: How to find out if another process is using a file

2007-01-18 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Donn Cave <[EMAIL PROTECTED]> writes: |> > |> |> > |> O_EXCL fails if the file exists at all - whether closed or open. |> > |> > Yes. In theory. In practice, it usually works on normal files, provided |> > that all opens are local. Under some circumstances, it

Re: How to write code to get focuse the application which is open from server

2007-01-18 Thread Mark
Hi, There are better places to find me then on comp.lang.python (just too much traffic for me) pywinauto forums: http://forums.openqa.org/forum.jspa?forumID=15 or subscribe pywinauto mailing list: https://lists.sourceforge.net/lists/listinfo/pywinauto-users vithi wrote: > MatchError: Could not

Re: A note on heapq module

2007-01-18 Thread bearophileHUGS
Steven Bethard wrote: > The current code fails when using unbound methods however:: I don't like your solution, this class was already slow enough. Don't use unbound methods with this class :-) Maybe there's a (better) solution to your problem: to make Heap a function (or classmethod) that return

Re: How to find out if another process is using a file

2007-01-18 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Nick Maclaren) wrote: > In article <[EMAIL PROTECTED]>, > Donn Cave <[EMAIL PROTECTED]> writes: > |> In article <[EMAIL PROTECTED]>, > |> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > |> > "Tom Wright" <[EMAIL PROTECTED]> escribió en el mensaj

Re: Anyone has a nice "view_var" procedure ?

2007-01-18 Thread Stef Mientki
thanks Gabriel > str(key)[7:-2] => key.__name__ I didn't know that one > Nice to see you built a useful tool! It's a great way to learn a language. Yes, and this group is helping me a whole lot, thanks ! cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Module name to filename and back?

2007-01-18 Thread Ron Adam
Ron Adam wrote: > Is there a function to find a filename from a dotted module (or package) name > without importing it? > > The imp function find_module() doesn't work with dotted file names. And it > looks like it may import the file as it raises an ImportError error exception > if > it ca

Re: *POLL* How many sheeple believe in the 911 fairy tale and willing to accept an Orwellian doublespeak and enslavement world ?

2007-01-18 Thread st911
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > [...] > > Ask yourself, how can all these people, supposed physicists, engineers, > software developers, people of supposed intelligence be incapable of > understanding that fire cannot make buildings free fall? How can they > not understand th

Re: A note on heapq module

2007-01-18 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Steven Bethard: >> Antoon Pardon: >>> For me, your class has the same drawback as the heappush, heappop >>> procedurers: no way to specify a comparision function. >> Agreed. I'd love to see something like ``Heap(key=my_key_func)``. > > It can be done, but the code becom

Re: import vs. subdirectory search

2007-01-18 Thread gordyt
John try this: from M2Crypto import SSL That should put your SSL module in the namespace as you want. --gordy -- http://mail.python.org/mailman/listinfo/python-list

Re: Traversing the properties of a Class

2007-01-18 Thread EdG
That works perfectly thank you. Bruno Desthuilliers wrote: > EdG a écrit : > (top-post corrected) > > > > Neil Cerutti wrote: > > > >>On 2007-01-18, EdG <[EMAIL PROTECTED]> wrote: > >> > >>>For debugging purposes, I would like to traverse the class > >>>listing out all the properties. > >> > >>Thi

Tiling and Spacefilling

2007-01-18 Thread [EMAIL PROTECTED]
[ slightly improved over Math Forum draft ] Probably a fault line or cultural divide between acutely differing schools of thought, is in this area of tiling or mosaic making. Some schools consider this a stupid waste of time, others a core topic, whereas a 3rd group stays more neutral on the issue

Re: Traversing the properties of a Class

2007-01-18 Thread Bruno Desthuilliers
EdG a écrit : (top-post corrected) > > Neil Cerutti wrote: > >>On 2007-01-18, EdG <[EMAIL PROTECTED]> wrote: >> >>>For debugging purposes, I would like to traverse the class >>>listing out all the properties. >> >>This is the first thing that came to mind. >> >>def show_properties(cls): >> for a

distutils data file difficulties

2007-01-18 Thread Brian L. Troutwine
I am new to the use of distutils and am having difficulty getting distutils recognize and install data files. Here are the relevant parts of my source directory: ExampleTree/ |-- __init__.py |-- data | |-- Example1.txt | |-- Example2.txt | `-- __init__.py |-- subPackage1 | |-- (...) `-- su

Re: More M2Crypto issues

2007-01-18 Thread John Nagle
Upgraded to Python 2.5 on the Linux system, rebuild M2Crypto, and it stil fails, but the last line of the error message changed to: ValueError: invalid literal for long() with base 10: '_40f91a08_p_SSL_CTX' Others have encountered this problem, from a Google search. Is "long" suppose

Re: [Python-Dev] Deletion order when leaving a scope?

2007-01-18 Thread Terry Reedy
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | "Calvin Spealman" <[EMAIL PROTECTED]> wrote in message | news:[EMAIL PROTECTED] | > Absolutely an irrelevent side effect, especially when you take into | > consideration the 4 and counting alternative implementations of

Re: Traversing the properties of a Class

2007-01-18 Thread EdG
This works great. I have one more question. Now that I have the name of the property, how do I get it's value? I want to print '%s = %s' % (attr,theattributesvalue) Thanks. Neil Cerutti wrote: > On 2007-01-18, EdG <[EMAIL PROTECTED]> wrote: > > For debugging purposes, I would like to traverse

Re: How can I create a linked list in Python?

2007-01-18 Thread Neil Cerutti
On 2007-01-18, sturlamolden <[EMAIL PROTECTED]> wrote: > > Paul Rubin wrote: > >> But that's what Lisp does too. > > Ok, I may have to reread Paul Graham's book on ANSI Common Lisp > then. Here's something silly I whipped up to play with. r""" Lisp style singly-linked lists called llist. """ d

Zope 3 Boot Camp and Sprint registration open

2007-01-18 Thread Chris Calloway
The Triangle (NC) Zope and Python Users Group invites you to register for Camp 5 and the BBQ Sprint: http://trizpug.org/boot-camp/camp5/ This is a Zope 3 boot camp followed by a Plone 3 sprint. The boot camp is taught by Philipp von Weitershausen, author of Web Component Development with Zope

Re: How to find out if another process is using a file

2007-01-18 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Donn Cave <[EMAIL PROTECTED]> writes: |> In article <[EMAIL PROTECTED]>, |> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: |> > "Tom Wright" <[EMAIL PROTECTED]> escribió en el mensaje |> > news:[EMAIL PROTECTED] |> > |> > > I'm writing a program which reads a ser

Re: PyMeld for html templates?

2007-01-18 Thread Bruno Desthuilliers
Sean Schertell a écrit : > I'm trying to decide which template system to get married to. I think > I've narrowed it down to PyMeld, Cheetah, or Jinja but leaning heavily > toward PyMeld because I love the idea that your templates are *totally* > clean and that get manipulated from behind the

Re: Traversing the properties of a Class

2007-01-18 Thread Bruno Desthuilliers
EdG a écrit : > I'm using Python version 2.4 and I created a class with some properties > like: > > def GetCallAmount(self): > return somedata The recommended naming convention is all_lower,ie: def get_call_amount(self): And FWIW, there are idioms to avoid polluting the class namespace

Re: How to find out if another process is using a file

2007-01-18 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > "Tom Wright" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > > > I'm writing a program which reads a series of data files as they are > > dumped > > into a directory by another process. At t

Re: Python Web Frameworks

2007-01-18 Thread Ximo Nadal
Shortash wrote: > Hi Gurus, > > I want to build a Python web app but im not sure which one to go for. I > prefer something like asp.Net , which would allow me to fully seperate > the presentation layer from the logic. Please advise? > > thanks, > > "Shortash' > Hi, Look at

Re: spidering script

2007-01-18 Thread dubs
Check out the quick start section in the documentation at Beautiful Soup http://www.crummy.com/software/BeautifulSoup/ Wes Jonathan Curran wrote: > On Thursday 18 January 2007 11:57, David Waizer wrote: > > Hello.. > > > > I'm looking for a script (perl, python, sh...)or program (such as wget)

Re: How can I create a linked list in Python?

2007-01-18 Thread sturlamolden
Paul Rubin wrote: > But that's what Lisp does too. Ok, I may have to reread Paul Graham's book on ANSI Common Lisp then. -- http://mail.python.org/mailman/listinfo/python-list

Re: Traversing the properties of a Class

2007-01-18 Thread EdG
Thanks. Daniel Nogradi wrote: > > I'm using Python version 2.4 and I created a class with some properties > > like: > > > > def GetCallAmount(self): > > return somedata > > > > def GetCallCurrency(self): > > return somemoredata > > > > moredefs..etc. > > > > CallAmount =

Re: Traversing the properties of a Class

2007-01-18 Thread EdG
Thanks. Neil Cerutti wrote: > On 2007-01-18, EdG <[EMAIL PROTECTED]> wrote: > > For debugging purposes, I would like to traverse the class > > listing out all the properties. > > This is the first thing that came to mind. > > def show_properties(cls): > for attr in dir(cls): > if isinstance(

Re: Traversing the properties of a Class

2007-01-18 Thread Neil Cerutti
On 2007-01-18, EdG <[EMAIL PROTECTED]> wrote: > For debugging purposes, I would like to traverse the class > listing out all the properties. This is the first thing that came to mind. def show_properties(cls): for attr in dir(cls): if isinstance(getattr(cls, attr), property): print at

Re: spidering script

2007-01-18 Thread Jonathan Curran
On Thursday 18 January 2007 11:57, David Waizer wrote: > Hello.. > > I'm looking for a script (perl, python, sh...)or program (such as wget) > that will help me get a list of ALL the links on a website. > > For example ./magicscript.pl www.yahoo.com and outputs it to a file, it > would be kind of

Re: Traversing the properties of a Class

2007-01-18 Thread Daniel Nogradi
> I'm using Python version 2.4 and I created a class with some properties > like: > > def GetCallAmount(self): > return somedata > > def GetCallCurrency(self): > return somemoredata > > moredefs..etc. > > CallAmount = property(GetCallAmount,None,None,None) > CallCurrency

Re: Memory Management in Embedded Python

2007-01-18 Thread Martin v. Löwis
Huayang Xia schrieb: > I have a piece of code like this: > > void funct(PyObject* pyobj) > { > char str[128]; > strncpy(str, "just a test string", sizeof(str)); > PyObject* pydata = PyObject_CallMethod(pyobj, "method_x", > "s", str); > Py_DECREF(py

Memory Management in Embedded Python

2007-01-18 Thread Huayang Xia
Hi there, I have a piece of code like this: void funct(PyObject* pyobj) { char str[128]; strncpy(str, "just a test string", sizeof(str)); PyObject* pydata = PyObject_CallMethod(pyobj, "method_x", "s", str); Py_DECREF(pydata); } After the fu

Re: closing a "forever" Server Socket

2007-01-18 Thread Matimus
> I want to ask if someone knows a better way for closing a "forever > server" or if there is a lack in my design. Generally you don't create a 'forever server'. You create an 'until I say stop' server. I would do this by looking at the 'serve_forever' method, and implementing my own 'serve_until_

spidering script

2007-01-18 Thread David Waizer
Hello.. I'm looking for a script (perl, python, sh...)or program (such as wget) that will help me get a list of ALL the links on a website. For example ./magicscript.pl www.yahoo.com and outputs it to a file, it would be kind of like a spidering software.. Any suggestions would be appreciated

Re: How to find out if another process is using a file

2007-01-18 Thread Jean-Paul Calderone
On Thu, 18 Jan 2007 14:34:52 -0300, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >"Tom Wright" <[EMAIL PROTECTED]> escribió en el mensaje >news:[EMAIL PROTECTED] > >> I'm writing a program which reads a series of data files as they are >> dumped >> into a directory by another process. At the momen

Re: How to find out if another process is using a file

2007-01-18 Thread Gabriel Genellina
"Tom Wright" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > I'm writing a program which reads a series of data files as they are > dumped > into a directory by another process. At the moment, it gets sporadic bugs > when it tries to read files which are only partially writt

Traversing the properties of a Class

2007-01-18 Thread EdG
I'm using Python version 2.4 and I created a class with some properties like: def GetCallAmount(self): return somedata def GetCallCurrency(self): return somemoredata moredefs..etc. CallAmount = property(GetCallAmount,None,None,None) CallCurrency = property(Get

Re: How to read and write huge binary files

2007-01-18 Thread Gabriel Genellina
"Lad" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > What is a good way to read binary data from HUGE file and write it > to another file? Without processing the data read? shutil.copy2 or similar Else, a lot of applications can follow the pattern read-process-write: read

Re: Is it possible to fasten the import of cgi?

2007-01-18 Thread Gabriel Genellina
"Cecil Westerhof" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] > Gabriel Genellina wrote: > >> "Cecil Westerhof" <[EMAIL PROTECTED]> escribió en el mensaje >> news:[EMAIL PROTECTED] >> >>>I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse >>>I >>> can no

Re: Would a Dutch speaker please check this wiki page please?

2007-01-18 Thread Roel Schroeven
Paul Rubin schreef: > "Martin P. Hellwig" <[EMAIL PROTECTED]> writes: >> Indeed it's not Afrikaans but just incorrect use of Dutch and not >> related to python. > > It was apparently posted by someone with a .be address, so I'll guess > it was written a Belgian French speaker who knows some Dutch.

Re: Catching wx events

2007-01-18 Thread Cruelemort
Chris Mellon wrote: > On 18 Jan 2007 06:12:17 -0800, Cruelemort <[EMAIL PROTECTED]> wrote: > > Hello all, > > > > I am new to this group (and new to Python) and was hoping someone would > > be able to help me with something, it is not so much a problem it is > > more of a general interest query a

Re: A note on heapq module

2007-01-18 Thread Neil Cerutti
On 2007-01-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Neil Cerutti: >> One more idea, cribbed from the linked list thread elsewhere: >> it might be nice if your Heap could optionally use an >> underlying collections.deque instead of a list. I don't know >> how excellent Python's deque is, b

Re: How to read and write huge binary files

2007-01-18 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lad wrote: > What is a good way to read binary data from HUGE file and write it > to another file? What about `shutil.copy()`? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: connection to server not accepted (but no error) only after several hours

2007-01-18 Thread seb
Hi Dennis, I think I have some new informations. My system is "blocked" now but the following change make it work again !!! I will test it for tonight to be sure of the improvements. I changed : service.bind(("", self.PORT)) to service.bind((socket.gethostname(), se

Re: How to find out if another process is using a file

2007-01-18 Thread js
How about using lock? Let writing process locks the files before writing, and unlock after the job's done. I think it'd work file in most environment. On 1/19/07, Tom Wright <[EMAIL PROTECTED]> wrote: > I'm writing a program which reads a series of data files as they are dumped > into a director

nsis and command-line argument

2007-01-18 Thread manouchk
Hi, is there a standart way to prepare a single exe with nsis that pass the command line to an exe created by py2exe on windows? py2exe allows to prepare an exe that get the command-line but needs some lib file so that it is not so elegant to ditribute. I tried a simple setup.nsis script to prepa

Re: urllib2 and transfer-encoding = chunked

2007-01-18 Thread jdvolz
Haha! My mistake. The error is that when a web server is chunking a web page only the first chunk appears to be acquired by the urllib2.urlopen call. If you check the headers, there is no 'Content-length' (as expected) and instead there is 'transfer-encoding' = 'chunked'. I am getting about the

How to find out if another process is using a file

2007-01-18 Thread Tom Wright
I'm writing a program which reads a series of data files as they are dumped into a directory by another process. At the moment, it gets sporadic bugs when it tries to read files which are only partially written. I'm looking for a function which will tell me if a file is opened in write-mode by an

How to read and write huge binary files

2007-01-18 Thread Lad
What is a good way to read binary data from HUGE file and write it to another file? Thanks for help La. -- http://mail.python.org/mailman/listinfo/python-list

Re: variable scope

2007-01-18 Thread Bruno Desthuilliers
gonzlobo a écrit : > Greetings, > I've been using Python to successfully parse files. When the entire > program was smaller, the variable firstMsg worked fine, but now > doesn't because it's used in function PID_MinMax. I know it's a result > of variables and their scope. > > I declare the variabl

Module name to filename and back?

2007-01-18 Thread Ron Adam
Is there a function to find a filename from a dotted module (or package) name without importing it? The imp function find_module() doesn't work with dotted file names. And it looks like it may import the file as it raises an ImportError error exception if it can't find the module. (Shouldn

Re: The proper use of QSignalMapper

2007-01-18 Thread David Boddie
borntonetwork wrote: > Thanks, David, for you help. > > When I change the slot function to what you show in your second > example, I get the same results: nothing. This may be due to something I missed in your code. When you connect the signal from the signal mapper to your class, you need to spec

Re: Would a Dutch speaker please check this wiki page please?

2007-01-18 Thread Paul Rubin
"Martin P. Hellwig" <[EMAIL PROTECTED]> writes: > Indeed it's not Afrikaans but just incorrect use of Dutch and not > related to python. It was apparently posted by someone with a .be address, so I'll guess it was written a Belgian French speaker who knows some Dutch. The "me" vs "mijn" error sou

variable scope

2007-01-18 Thread gonzlobo
Greetings, I've been using Python to successfully parse files. When the entire program was smaller, the variable firstMsg worked fine, but now doesn't because it's used in function PID_MinMax. I know it's a result of variables and their scope. I declare the variable 'firstMsg = 0' in the main loop

Re: Is it possible to fasten the import of cgi?

2007-01-18 Thread Cecil Westerhof
Gabriel Genellina wrote: > "Cecil Westerhof" <[EMAIL PROTECTED]> escribió en el mensaje > news:[EMAIL PROTECTED] > >>I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse >>I >> can not time the time used to import time, but os and sys do not take >> more as a millisecond. My

Re: Would a Dutch speaker please check this wiki page please?

2007-01-18 Thread Martin P. Hellwig
Stef Mientki wrote: > [EMAIL PROTECTED] wrote: >> Got a note about a new page on the Python Wiki: >> >>> "Wade" == Wade McDaniel <[EMAIL PROTECTED]> writes: >> >> http://wiki.python.org/moin/Selcuk_Altun >> >> I suspect it's junk since it doesn't seem to mention Python and the >> website >

Re: Catching wx events

2007-01-18 Thread Chris Mellon
On 18 Jan 2007 06:12:17 -0800, Cruelemort <[EMAIL PROTECTED]> wrote: > Hello all, > > I am new to this group (and new to Python) and was hoping someone would > be able to help me with something, it is not so much a problem it is > more of a general interest query about something i have a solution t

Re: Asyncore select statement problem

2007-01-18 Thread Gabriel Genellina
"JamesHoward" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] >I have a problem with python's asyncore module throwing a bad file > descriptor error. The code might be difficult to copy here, but the > problem is essentially: > > The server wants to sever the connection of an o

Re: import vs. subdirectory search

2007-01-18 Thread Gabriel Genellina
"John Nagle" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] >I'm running Python 2.3.4 from a CGI script on a shared hosting Linux > system. > The CGI program is being executed from Apache, as "nobody". I have some > local modules installed in "~myname/lib/python"; these i

PythonTidy 1.10

2007-01-18 Thread Chuck Rhode
PythonTidy cleans up, regularizes, and reformats the text of Python scripts. It is released under the GNU General Public License. Python scripts are usually so good looking that no beautification is required. However, from time to time, it may be necessary to alter the style to conform to chan

Re: urllib2 and transfer-encoding = chunked

2007-01-18 Thread Gabriel Genellina
<[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] >I am having errors which appear to be linked to a previous bug in > urllib2 (and urllib) for v2.4 and v2.5 of Python. Has this been fixed? > Has anyone established a standard workaround? I keep finding old > posts about it, that

Re: One more regular expressions question

2007-01-18 Thread Neil Cerutti
On 2007-01-18, Victor Polukcht <[EMAIL PROTECTED]> wrote: > My pattern now is: > > (?P[^(]+)(?P\d+)\)\s+(?P\d+) > > And i expect to get: > > var1 = "Unassigned Number " > var2 = "1" > var3 = "32" > > I'm sure my regexp is incorrect, but can't understand where > exactly. Break it up using verbose n

Re: Is it possible to fasten the import of cgi?

2007-01-18 Thread Gabriel Genellina
"Cecil Westerhof" <[EMAIL PROTECTED]> escribió en el mensaje news:[EMAIL PROTECTED] >I have a cgi-script dat uses the modules cgi, os, sys and time. Offcourse I > can not time the time used to import time, but os and sys do not take more > as a millisecond. My script itself takes 3 or 4 milliseco

Re: Would a Dutch speaker please check this wiki page please?

2007-01-18 Thread skip
Martin> Could be Afrikaans too, but the page is gone now so I can't Martin> check. Actually, you can... ;-) Even though it's a nonexistent page, its history still exists. Poke the "Get Info" link and view the first revision of the file. Skip -- http://mail.python.org/mailman/listinfo/

  1   2   >