I'm trying to use signal.alarm to stop a run-away os.system command.
Can anyone exlain the following behavior?
Given following the trivial program:
import os
import signal
def timeoutHandler(signum, frame):
print "Timeout"
raise ValueError
signal.signal(signal.SIGALRM, timeoutHandler)
I have read in a file and need to get the number of lines.
cpn_file = open('Central Part number list.txt')
cpn_version = cpn_file.read().split('\n')
I want to know the number of elements in cpn_version.
--
http://mail.python.org/mailman/listinfo/python-list
"George van den Driessche" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi folks,
>
> I'm looking at packaging a project I'm working on using distutils. The
> project is for Windows and contains a COM server which needs registration,
> so the installer needs to be a little more
"Elliot Temple" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> One other interesting thing about case sensitivity I don't think anyone
> has mentioned: in Python keywords are all lowercase already (the way I
> want to type them). In some other languages, they aren't...
Not qui
PyParsing rocks! Here's what I ended up with:
def unpack_sql_array(s):
import pyparsing as pp
withquotes = pp.dblQuotedString.setParseAction(pp.removeQuotes)
withoutquotes = pp.CharsNotIn('",')
parser = pp.StringStart() + \
pp.Word('{').suppress() + \
pp.
A fetchall() call causes the above error. There must be some non-utf8 chars
in the table in question and - indeed - there very likely are: The table
contains pathnames of files on the harddisk of a German "speaking" PC.
What I have already done to try to overcome this is:
- Inserted "# coding: iso
On May 27, 2005, at 12:17 PM, [EMAIL PROTECTED] wrote:
> I have read in a file and need to get the number of lines.
>
> cpn_file = open('Central Part number list.txt')
> cpn_version = cpn_file.read().split('\n')
>
> I want to know the number of elements in cpn_version.
Could you use:
co
For now, the names of the tables, the app knows of, are added into an
internal list, when the app is started. Then, when queries fail, the app
knoes that it has to create them.
It would be nice somehow to be able to ask the database what tables it
contains. Is anyone doing this that way? How do yo
On 27 May 2005 12:09:39 -0700, [EMAIL PROTECTED] wrote:
>I'm trying to use signal.alarm to stop a run-away os.system command.
>Can anyone exlain the following behavior?
>
>Given following the trivial program:
>
>import os
>import signal
>
>def timeoutHandler(signum, frame):
>print "Timeout"
>
On Fri, 27 May 2005 22:28:06 +0300, Catalin Constantin <[EMAIL PROTECTED]>
wrote:
>Hi there,
>
>I have the following xmlrpc method:
>
>class FeederResource(xmlrpc.XMLRPC):
>def __init__(self):
>xmlrpc.XMLRPC.__init__(self)
>self.feeder=Feeder()
>
>de
Err woops. Wrong list, sorry.
Jp
--
http://mail.python.org/mailman/listinfo/python-list
Thanks, that's the kind of on-target info I needed. Now, shouldn't
there be some kind of mention of this limitation in the docs?
--
http://mail.python.org/mailman/listinfo/python-list
Thanks! I was trying len(cpn_version) and that didn't work.
--
http://mail.python.org/mailman/listinfo/python-list
Alan Isaac wrote:
> Default parameter values are evaluated once when the function definition
is
> executed. Where are they stored? ... Where is this documented?
Forgive any poor phrasing: I'm not a computer science type.
At http://www.network-theory.co.uk/docs/pytut/tut_26.html we read:
"The execu
On Fri, 27 May 2005 21:07:56 GMT, David Isaac <[EMAIL PROTECTED]> wrote:
>Alan Isaac wrote:
>> Default parameter values are evaluated once when the function definition
>is
>> executed. Where are they stored? ... Where is this documented?
>
>Forgive any poor phrasing: I'm not a computer science type
XPN (X Python Newsreader XPN) is a multi-platform newsreader with
Unicode support. It has features like scoring/actions, X-Face and Face
decoding, muting of quoted text, newsrc import/export, find article and
search in the body, spoiler char/rot13, random taglines, and
configurable attribution line
Thanks Paul! When I get a chance I'll mess around with Py + Excel as
you have suggested . I was hoping not to have to deal with VBScript :)
--
http://mail.python.org/mailman/listinfo/python-list
hi,
I have written a trace function in C using the Python/C API. I want to
find whether the call occured is a function call or method call and if
a method call, its self object.
int tracer(PyObject *obj, PyObject *f, int what, PyObject *args){
PyObject *item,*SelfItem;
switch(what){
case PyTrace_
thanks! I didn't realize it was in the cookbook:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/168639
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I would like to pass a dictionary from my Python code to my Python
extension, extract
various values from the dictionary (from within the extension) , modify the
values for the
relevant keys and return the modified dictionary to Python.
Can someone point me to an example of what the C code
Hi,
I have an application that has an embedded interpreter. This application
loads many
DLL's and passes a PyObject * to each DLL that was gotten from the
following call:
PyObject * pmod = PyImport_AddModule("__main__") ;
Later, in one of the many DLL's that interact with the embedded
inte
Hi !
You can use WMI, for that.
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
Mentre io pensavo ad una intro simpatica "Irmen de Jong" scriveva:
>> XPN (X Python Newsreader XPN) is a multi-platform newsreader with
>> Unicode support. It has features like scoring/actions, X-Face and Face
>> decoding, muting of quoted text, newsrc import/export, find article and
>> search in
Grant Edwards wrote:
> On 2005-05-27, Peter Hansen <[EMAIL PROTECTED]> wrote:
>>Unfortunately this assumes that the open() call will always succeed,
>>when in fact it is likely to fail sometimes when another file has
>>already opened the file but not yet completed writing to it, AFAIK.
>
> Not i
"mmf" <[EMAIL PROTECTED]> writes:
> How can I make sure that a Python process does not use more that 30% of
> the CPU at any time. I only want that the process never uses more, but
> I don't want the process being killed when it reaches the limit (like
> it can be done with resource module).
>
> C
Paul Rubin wrote:
> http://www.sqlite.org/faq.html#q7
[snip]
> Multiple processes can have the same database open at the same
> time. Multiple processes can be doing a SELECT at the same
> time. But only one process can be making changes to the database
> at once.
>
> But multiple
Peter Hansen <[EMAIL PROTECTED]> writes:
> And PySQLite conveniently wraps the relevant calls with retries when
> the database is "locked" by the writing process, making it roughly a
> no-brainer to use SQLite databases as nice simple log files where
> you're trying to write from multiple CGI proce
rbt wrote:
> [EMAIL PROTECTED] wrote:
>> finished = False
>> while not finished:
>
> Why don't you just write 'while True'??? 'while not false' is like
> saying 'I am not unemployed by Microsoft' instead of saying 'I am
> employed by Microsoft'. It's confusing, complex and unnecessary. Lawyers
F. GEIGER wrote:
>
> It would be nice somehow to be able to ask the database what tables it
> contains. Is anyone doing this that way? How do you do that?
>
Information can be found in "Information_Schema_TABLES"
See:
http://www.sqlite.org/cvstrac/wiki?p=InformationSchema
--
http://mail.python.o
Jp Calderone <[EMAIL PROTECTED]> writes:
> >Oh, ok. But what kind of locks does it use?
>
> It doesn't really matter, does it?
Huh? Sure, if there's some simple way to accomplish the locking, the
OP's act can do the same thing without SQlite's complexity.
> I'm sure the locking mechanisms it u
On 05/27/2005-06:02PM, Peter Hansen wrote:
>
> Hmm... just tried it: you're right! On the other hand, the results were
> unacceptable: each process has a separate file pointer, so it appears
> whichever one writes first will have its output overwritten by the
> second process.
Did you open th
F. GEIGER wrote:
> For now, the names of the tables, the app knows of, are added into an
> internal list, when the app is started. Then, when queries fail, the app
> knoes that it has to create them.
>
> It would be nice somehow to be able to ask the database what tables it
> contains. Is anyone d
On 27 May 2005 15:22:17 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid>
wrote:
>Jp Calderone <[EMAIL PROTECTED]> writes:
>> >Oh, ok. But what kind of locks does it use?
>>
>> It doesn't really matter, does it?
>
>Huh? Sure, if there's some simple way to accomplish the locking, the
>OP's act c
Peter Hansen wrote:
> Grant Edwards wrote:
>> Not in my experience. At least under Unix, it's perfectly OK
>> to open a file while somebody else is writing to it. Perhaps
>> Windows can't deal with that situation?
>
> Hmm... just tried it: you're right!
Umm... the part you were right about wa
Paul Rubin wrote:
> Peter Hansen <[EMAIL PROTECTED]> writes:
>
>>And PySQLite conveniently wraps the relevant calls with retries when
>>the database is "locked" by the writing process, making it roughly a
>>no-brainer to use SQLite databases as nice simple log files where
>>you're trying to write
Christopher Weimann wrote:
> On 05/27/2005-06:02PM, Peter Hansen wrote:
>
>>Hmm... just tried it: you're right! On the other hand, the results were
>>unacceptable: each process has a separate file pointer, so it appears
>>whichever one writes first will have its output overwritten by the
>>sec
Nemesis wrote:
> XPN (X Python Newsreader XPN) is a multi-platform newsreader with
> Unicode support. It has features like scoring/actions, X-Face and Face
> decoding, muting of quoted text, newsrc import/export, find article and
> search in the body, spoiler char/rot13, random taglines, and
> conf
CL, after you install py_win32 on windows you should look for a module
called "excel*.py" under your ${PYTHONHOME} directory. They have a
very basic COM Server Excel AddIn as an example.
--
http://mail.python.org/mailman/listinfo/python-list
On 27 May 2005 15:10:16 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid>
wrote:
>Peter Hansen <[EMAIL PROTECTED]> writes:
>> And PySQLite conveniently wraps the relevant calls with retries when
>> the database is "locked" by the writing process, making it roughly a
>> no-brainer to use SQLite da
Peter Hansen <[EMAIL PROTECTED]> writes:
> I think the FAQ can answer that better than I can, since I'm not sure
> whether you're asking about any low-level (OS) locks it might use or
> higher-level (e.g. database-level locking) that it might use. In
> summary, however, at the database level it pr
gabor wrote:
> the problem is:
> what happens if 2 users invoke the cgi at the same time?
Would BerkleyDB support that?
--
http://mail.python.org/mailman/listinfo/python-list
John Roth wrote:
> "Elliot Temple" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>> One other interesting thing about case sensitivity I don't think
>> anyone has mentioned: in Python keywords are all lowercase already
>> (the way I want to type them). In some other languages,
sorry
--
http://mail.python.org/mailman/listinfo/python-list
You know how you can specify that stderr, stdin, stdout should be
unbuffered by running python with the -u switch? Is there any way I
can have the same affect in code by doing something to the sys.std*
variables?
--
http://mail.python.org/mailman/listinfo/python-list
1. Why not to simplfy the problem. You can extract values from the
dictionari in python (this is fast). Put them in a list (fast). Pass
the list to the extension, handle it and return to python. etc.
2. Use Pyrex.
--
http://mail.python.org/mailman/listinfo/python-list
I understand, that what I suggest does not solve the problem you want,
but..
Why do you want to restrict CPU usage to 30%? In Windows I run CPU
intesive therads on IDLE priority, while interfacand/or communication
threads run on normal. This gives me best of two worlds:
1. I use 100% CPU (good) an
Hi,
I'm not sure if this is the right group to post this. If not, then I
would appreciate if somebody could point me to the correct group.
This is my first time releasing software to the public and I'm wanting
to release a Python program I wrote for review (and critique) and
testing on other plat
Elliot Temple wrote:
>
> On May 27, 2005, at 12:17 PM, [EMAIL PROTECTED] wrote:
>
>> I have read in a file and need to get the number of lines.
>>
>> cpn_file = open('Central Part number list.txt')
>> cpn_version = cpn_file.read().split('\n')
>>
>> I want to know the number of elements in
"poisondart" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> testing on other platforms, but also I would like to explore the
> different software licenses that are available (there seems to be
There is an Open Software Foundation (or something close) with a site
listing and linki
Hi everyone.
Has anyone seen that problem with running a python cgi script in a
server?
It takes you to myspace.com/redmartian or something. Anyway, does
anyone know when this problem will be fixed?
--
http://mail.python.org/mailman/listinfo/python-list
chris patton wrote:
> Hi everyone.
>
> Has anyone seen that problem with running a python cgi script in a
> server?
> It takes you to myspace.com/redmartian or something. Anyway, does
> anyone know when this problem will be fixed?
It could be solved much sooner if you follow these steps:
(1) Care
<[EMAIL PROTECTED]> wrote>
> 1) Intellisense is really just another crutch that does more harm than
> good? There were a few hardcore defenders of this position but not
> many.
I'm primarily a VB programmer, but I also do Java and web stuff as well.
Whenever I look at a new IDE the FIRST thing I lo
George -
Thanks for your enthusiastic endorsement!
Here are some quibbles about your pyparsing grammar (but really, not
bad for a first timer):
1. The Word class is used to define "words" or collective groups of
characters, by specifying what sets of characters are valid as leading
and/or body ch
Hi all!
I'm trying to learn myself wxPython, and I got some questions:
Whats the name of the event that occur when I press the
exit/cross-button on the frame?
How do I connect a function with that event?
How do I start a new process of the same program I'm running? I do not
want to create a new fr
On Fri, 27 May 2005 18:50:14 -0700, poisondart wrote:
> - being able to distribute it freely, anybody can modify it
> - nobody is allowed to make profit from my code (other than myself)
Terry mentioned OS.org, so I will not repeat that. (opensource.org)
Also, check out http://creativecommons.org.
Hi,
2005/5/28, Vamsee Krishna Gomatam <[EMAIL PROTECTED]>:
> Hello,
> I'm having some problems understanding Regexps in Python. I want
> to replace "PHRASE" with
> "http://www.google.com/search?q=PHRASE>PHRASE" in a block of
> text. How can I achieve this in Python? Sorry for the naive que
101 - 156 of 156 matches
Mail list logo