Python Threads and C Semaphores

2007-01-15 Thread Jeremy
Hello, I have a fat C++ extension to a Python 2.3.4 program. In all, I count five threads. Of these, two are started in Python using thread.start_new_thread(), and both of these wait on semaphores in the C++ extension using sem_wait(). There also are two other Python threads and one thread runnin

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Carl Banks
Ron Adam wrote: > There have been times where I would like assert to be a little more assertive > than it is. :-) > > ie.. not being able to turn them off with the -0/-00 switches, and having them > generate a more verbose traceback. Personally, I'd rather see it get less assertive, i.e., having

Re: Maths error

2007-01-15 Thread Hendrik van Rooyen
"Nick Maclaren" <[EMAIL PROTECTED]> wrote: [Tim Roberts] > |> Actually, this is a very well studied part of computer science called > |> "interval arithmetic". As you say, you do every computation twice, once to > |> compute the minimum, once to compute the maximum. When you're done, you > |> ca

I wrote a C++ code generator in Python, would anyone please help me to review the code? :)

2007-01-15 Thread Kevin Wan
fgen is a free command line tool that facilitates cross platform c++ development, including header generation, cpp file generation, makefile generation, unit test framework generation, etc. http://sf.net/projects/fgen I'm not very familiar with Python. Any feedback are appreciated! Or anyone like

Re: RotatingFileHandler + subprocess module problems

2007-01-15 Thread Stephen Hansen
That was perfect-- it now all behaves as it should. Thanks! On 1/11/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote: At Thursday 11/1/2007 15:59, Stephen Hansen wrote: >If I run app1, and then app2, it all works fine. Specifically, the >apps are logging correctly and I can see with Process Exp

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Ron Adam
Steven D'Aprano wrote: > On Mon, 15 Jan 2007 21:01:35 -0600, Ron Adam wrote: > > >> There have been times where I would like assert to be a little more >> assertive >> than it is. :-) >> >> ie.. not being able to turn them off with the -0/-00 switches, and having >> them >> generate a more v

Debugging SocketServer.ThreadingTCPServer

2007-01-15 Thread Stuart D. Gathman
I have a ThreadingTCPServer application (pygossip, part of http://sourceforge.net/projects/pymilter). It mostly runs well, but occasionally goes into a loop. How can I get a stack trace of running threads to figure out where the loop is? Is there some equivalent of sending SIGQUIT to Java to ge

Re: Watch log

2007-01-15 Thread Michele Simionato
Salvatore Di Fazio wrote: > Hi guys, > I've an application that writes a log file. > I need to write an application with python that will read this file. You may begin from this: $ cat showlog.py import sys from ScrolledText import ScrolledText interval =50 # ms def displayfile(f, textwidget):

installing/maintaining modules for multiple versions of python

2007-01-15 Thread John
I have a suse box that has by default python 2.4 running and I have a 2.5 version installed in /reg/python2.5. How do I install new modules for only 2.5 without disturbing the 2.4 default installation. Thanks, --j -- http://mail.python.org/mailman/listinfo/python-list

Re: html + javascript automations = [mechanize + ?? ] or something else?

2007-01-15 Thread John
I am curious about the webbrowser module. I can open up firefox using webbrowser.open(), but can one control it? Say enter a login / passwd on a webpage? Send keystrokes to firefox? mouse clicks? Thanks, --j John wrote: > I have to write a spyder for a webpage that uses html + javascript. I > ha

Re: Python web app. (advice sought)

2007-01-15 Thread Duncan Smith
Thanks all. It's looking like Turbogears at the moment (unless my boss makes an executive decision). Cheers. Duncan -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-15 Thread Scott David Daniels
Tim Peters wrote: > ... Alas, most people wouldn't read that either <0.5 wink>. Oh the loss, you missed the chance for a <0.47684987 wink>. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python web app. (advice sought)

2007-01-15 Thread Ralf Schönian
Tim Williams schrieb: > On 15 Jan 2007 00:52:33 -0800, Torabisu <[EMAIL PROTECTED]> wrote: > > Don't overlook Karrigell either, with a tiny learning curve its > always worth consideration, especially if you need rapid development > and a web server that will sit on top of your exising .py module

html + javascript automations = [mechanize + ?? ] or something else?

2007-01-15 Thread John
I have to write a spyder for a webpage that uses html + javascript. I had it written using mechanize but the authors of the webpage now use a lot of javascript. Mechanize can no longer do the job. Does anyone know how I could automate my spyder to understand javascript? Is there a way to control a

Re: Does class patching actually work

2007-01-15 Thread James Stroud
John Nagle wrote: > In M2Crypto/m2urllib there is this: > > import string, sys, urllib > from urllib import * > > def open_https(self, url, data=None, ssl_context=None): > ... > > # Minor brain surgery. > URLopener.open_https = open_https > > The intent of this is to re

Re: Conflicting needs for __init__ method

2007-01-15 Thread Ben Finney
"Steven D'Aprano" <[EMAIL PROTECTED]> writes: > On Tue, 16 Jan 2007 08:54:09 +1100, Ben Finney wrote: > > def __add__(self, other): > > result = perform_addition(self, other) > > return result > > But that could just as easily be written as: > > def __add__(self

Re: Watch log

2007-01-15 Thread Thinker
Salvatore Di Fazio wrote: > Bjoern Schliessmann ha scritto: > > >> Why not read the file continuously and only do something if a new >> line is complete (i. e. a newline char is detected)? >> > > How can I read the file continuously? > > What you want is something like 'tail -f' in linu

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Steven D'Aprano
On Mon, 15 Jan 2007 21:01:35 -0600, Ron Adam wrote: > There have been times where I would like assert to be a little more assertive > than it is. :-) > > ie.. not being able to turn them off with the -0/-00 switches, and having > them > generate a more verbose traceback. If you want somethi

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Calvin Spealman
On 1/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 15 Jan 2007 17:50:56 -0500, Calvin Spealman wrote: > > > assert foo(0x10) == 0 # Assertions are much better tests than prints :-) > > I dispute that assertion (pun intended). Hah! > Firstly, print statements work even if you pass t

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Calvin Spealman
On 1/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 15 Jan 2007 21:38:42 -0500, Calvin Spealman wrote: > > > On 1/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> On Mon, 15 Jan 2007 17:50:56 -0500, Calvin Spealman wrote: > >> > >> > assert foo(0x10) == 0 # Assertions are much b

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Steven D'Aprano
On Mon, 15 Jan 2007 21:38:42 -0500, Calvin Spealman wrote: > On 1/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> On Mon, 15 Jan 2007 17:50:56 -0500, Calvin Spealman wrote: >> >> > assert foo(0x10) == 0 # Assertions are much better tests than prints :-) >> >> I dispute that assertion (pun in

Re: assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Ron Adam
Calvin Spealman wrote: > On 1/15/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> On Mon, 15 Jan 2007 17:50:56 -0500, Calvin Spealman wrote: >> >>> assert foo(0x10) == 0 # Assertions are much better tests than prints :-) >> I dispute that assertion (pun intended). > > Hah! > >> Firstly, print s

Re: Conflicting needs for __init__ method

2007-01-15 Thread Steven D'Aprano
On Tue, 16 Jan 2007 08:54:09 +1100, Ben Finney wrote: > [EMAIL PROTECTED] writes: > >> Suppose you're writing a class "Rational" for rational numbers. The >> __init__ function of such a class has two quite different roles to >> play. > > That should be your first clue to question whether you're

Does class patching actually work

2007-01-15 Thread John Nagle
In M2Crypto/m2urllib there is this: import string, sys, urllib from urllib import * def open_https(self, url, data=None, ssl_context=None): ... # Minor brain surgery. URLopener.open_https = open_https The intent of this is to replace method open_

Re: Class list of a module

2007-01-15 Thread George Sakkis
[EMAIL PROTECTED] wrote: > Gabriel Genellina: > > >import inspect > > def getClassList(aModule): > > return [cls for cls in vars(aModule).itervalues() > > if inspect.isclass(cls)] > > This is short enough too: > > from inspect import isclass > getclasses = lambda module:

assert versus print [was Re: The curious behavior of integer objects]

2007-01-15 Thread Steven D'Aprano
On Mon, 15 Jan 2007 17:50:56 -0500, Calvin Spealman wrote: > assert foo(0x10) == 0 # Assertions are much better tests than prints :-) I dispute that assertion (pun intended). Firstly, print statements work even if you pass the -O (optimize) flag to Python. Your asserts don't. Secondly, a bare

Re: for v in l:

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 21:48, Gert Cuykens wrote: is there a other way then this to loop trough a list and change the values i=-1 for v in l: i=i+1 l[i]=v+x for i,value in enumerate(my_list): my_list[i] = compute_new_value(value) See the tutor

Re: Can't find module named 'svn' in python

2007-01-15 Thread Nanjundi
My first thought: Check if you have /usr/local/lib/svn-python/ in your PYTHONPATH environment variable (echo $PYTHONPATH). If its missing, set it in the environment. export PYTHONPATH=$PYTHONPATH:/usr/local/lib/svn-python -N [EMAIL PROTECTED] wrote: > Hi, > > i have a simple test which tries to

Re: for v in l:

2007-01-15 Thread Nanjundi
Try: l = [i+x for i in l] OR l = map(lambda i: i+x, l) -N Gert Cuykens wrote: > is there a other way then this to loop trough a list and change the values > > i=-1 > for v in l: > i=i+1 > l[i]=v+x > > something like > > for v in l: >

for v in l:

2007-01-15 Thread Gert Cuykens
is there a other way then this to loop trough a list and change the values i=-1 for v in l: i=i+1 l[i]=v+x something like for v in l: l[v]=l[v]+x -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone has a nice "view_var" procedure ?

2007-01-15 Thread Larry Bates
Stef Mientki wrote: > hello, > > Is there some handy/ nice manner to view the properties of some variable ? > As a newbie, I often want to see want all the properties of a var, > and also some corner values (large arrays) etc. > > Probably it's not so difficult, > but I don't see how to distingui

Re: Watch log

2007-01-15 Thread Larry Bates
Salvatore Di Fazio wrote: > Hi guys, > I've an application that writes a log file. > I need to write an application with python that will read this file. > > I would like wait until a new line will be write in the file. > > Something like the "watch cat Log" command on Linux os. > > How can I ch

Can't find module named 'svn' in python

2007-01-15 Thread [EMAIL PROTECTED]
Hi, i have a simple test which tries to load 'svn' moddule. # python -c "from svn import client" Traceback (most recent call last): File "", line 1, in ? ImportError: No module named svn I have checked I have sub-directories 'libsvn', 'svn' under /usr/local/lib/svn-python/ cd /usr/local/lib/s

Re: How naive is Python?

2007-01-15 Thread John Bauman
[EMAIL PROTECTED] wrote: > Actually, it isn't until I work my way back to 2.3 that I start to see > quadratic behavior: Yes, that's because the behavior was changed for 2.4, so it wouldn't be quadratic in this case. -- http://mail.python.org/mailman/listinfo/python-list

Re: ReportLab - Frames - Images

2007-01-15 Thread Chuck
Thanks for the help. I made you changes but it still puts the picture above the text, not beside the text. I also found a user group at http://news.gmane.org/gmane.comp.python.reportlab.user . It may be the same. I have now posted there. Chuck -- http://mail.python.org/mailman/listinfo/python-l

Re: whats wrong with my reg expression ?

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 20:43, Gert Cuykens wrote: PS i also cant figure out what is wrong here ? rex=re.compile('^"(?P[^"]*)"$',re.M) for v in l: v=rex.match(v).group('value') v=v.replace('""','"') return(l) v=rex.match(v).group('value') Attribu

Re: Conflicting needs for __init__ method

2007-01-15 Thread fumanchu
Steven D'Aprano wrote: > > class Rational(object): > > def __init__(self, numerator, denominator): > > print "lots of heavy processing here..." > > # processing ints, floats, strings, special case arguments, > > # blah blah blah... > > self.numerator = numerator

Re: Problem with win32pipe.popen2

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 07:24, diego wrote: I'm trying to understand how popen2 works. Found in this group, that popen2.popen2 can cause trouble so i chose win32pipe.popen2. have a look a the listing of 2 files: ekmain.py: ** import win32pipe (stdin1, stdout1) = win32pipe.popen2("test1

Cygwin Python/PIL TCL/TK fork rebase solution

2007-01-15 Thread Ross Patterson
I recently was forced to build PIL under Cygwin Python 2.4.3 and ran into the Cygwin fork/rebase issue with TCL/TK yet again. Unfortunately, none of the rebase workarounds I found through my copious STFWing worked this time. Through trial and error I found that the following worked: rebase -b 0x1

Re: Anyone has a nice "view_var" procedure ?

2007-01-15 Thread Adam
Stef Mientki wrote: > hello, > > Is there some handy/ nice manner to view the properties of some variable ? > As a newbie, I often want to see want all the properties of a var, > and also some corner values (large arrays) etc. > > Probably it's not so difficult, > but I don't see how to distingui

Re: download win32file

2007-01-15 Thread hg
jim-on-linux wrote: > On Monday 15 January 2007 10:37, hg wrote: >> jim-on-linux wrote: >> > Where can I download win32file / win32ui? >> > >> > The links below are broken. Mark Hammond >> > should be made aware of this. >> > >> > >> > URL below has two links that send you no >> > place >> > http

Re: whats wrong with my reg expression ?

2007-01-15 Thread Gert Cuykens
thx PS i also cant figure out what is wrong here ? rex=re.compile('^"(?P[^"]*)"$',re.M) for v in l: v=rex.match(v).group('value') v=v.replace('""','"') return(l) v=rex.match(v).group('value') AttributeError: 'NoneType' object has no attribute '

Re: ReportLab - Frames - Images

2007-01-15 Thread Robin Becker
Chuck wrote: > I have been trying all day to get this to work. My complete code is > below. I can get my text into the PDF, I can get my image in the PDF. > What I can't get to work is frames so that the image (logo) appears to > the right of the text. The image always appears first and then the te

Re: can't get import to work!

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 14:35, [EMAIL PROTECTED] wrote: from just.for.fun import Fubar This doesn't work. The following error is displayed: ImportError: No module named for You can't have a module named "for", it's a reserved word. Try using "For" instead (or any other legal name!). --

Re: Anyone has a nice "view_var" procedure ?

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 17:45, Stef Mientki wrote: Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc. You can try dir(x), vars(x). If you want a "nice print",

Re: download win32file

2007-01-15 Thread jim-on-linux
On Monday 15 January 2007 18:02, Bill Tydeman wrote: > > ?? Do I have to download pywin32 to get > > win32ui, or win32file, or win32api > > Yes Got it. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: download win32file

2007-01-15 Thread Bill Tydeman
?? Do I have to download pywin32 to get win32ui, or win32file, or win32api Yes -- There is no reason for any individual to have a computer in his home. Ken Olsen, President, Digital Equipment, 1977 US computer engineer & industrialist (1926 - ) -- http://mail.python.org/mailm

Re: whats wrong with my reg expression ?

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 19:41, Gert Cuykens wrote: rex2=re.compile('^"(?P[^]*)"$',re.M) [^set-of-forbidden-characters] -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías s

Re: download win32file

2007-01-15 Thread jim-on-linux
On Monday 15 January 2007 10:37, hg wrote: > jim-on-linux wrote: > > Where can I download win32file / win32ui? > > > > The links below are broken. Mark Hammond > > should be made aware of this. > > > > > > URL below has two links that send you no > > place > > http://mail.python.org/pipermail/pyth

Re: The curious behavior of integer objects

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 19:28, Jim B. Wilson wrote: Am I nuts? Or only profoundly confused? I expected the this little script to print "0": class foo(int): def __init__(self, value): self = value & 0xF print foo(0x10) Instead, it prints "16" (at least on python 2.4.4 (Linux) and 2.5 (Wine).

Re: The curious behavior of integer objects

2007-01-15 Thread Robert Kern
Jim B. Wilson wrote: > Am I nuts? Or only profoundly confused? I expected the this little script > to print "0": > > class foo(int): > def __init__(self, value): > self = value & 0xF That statement only rebinds the local name self to something else. It does not modify the object at all or

Re: The curious behavior of integer objects

2007-01-15 Thread Calvin Spealman
As it turns out, this has little to do with integers and the operations you are trying to do on them. I'll explain in more detail. Integers are immutable, which you may already know. This presents a problem with subclassing them and using the usual special method __init__, because the int object h

Re: whats wrong with my reg expression ?

2007-01-15 Thread James Stroud
Gert Cuykens wrote: > rex2=re.compile('^"(?P[^]*)"$',re.M) > > File "/usr/lib/python2.5/re.py", line 180, in compile >return _compile(pattern, flags) > File "/usr/lib/python2.5/re.py", line 233, in _compile >raise error, v # invalid expression > sre_constants.error: unexpected end of reg

[ANN] Py2Py 0.0.1 - python code reformatter, initial dev release

2007-01-15 Thread Andrey Khavryuchenko
Folks, We release development preview snapshot of Py2Py code reformatter [1]. It is a byproduct of the PyBeast project aimed to create the python mutation tester. Now Py2Py code reformatter ignores all comments and 80-char line length requirement. Nevertheless, it produces the same AST as the or

whats wrong with my reg expression ?

2007-01-15 Thread Gert Cuykens
rex2=re.compile('^"(?P[^]*)"$',re.M) File "/usr/lib/python2.5/re.py", line 180, in compile return _compile(pattern, flags) File "/usr/lib/python2.5/re.py", line 233, in _compile raise error, v # invalid expression sre_constants.error: unexpected end of regular expression ? -- http:/

Re: download win32file

2007-01-15 Thread hg
jim-on-linux wrote: > > > Where can I download win32file / win32ui? > > The links below are broken. Mark Hammond should > be made aware of this. > > > URL below has two links that send you no place > http://mail.python.org/pipermail/python-list/2002-October/167638.html > > > Links: > http:

The curious behavior of integer objects

2007-01-15 Thread Jim B. Wilson
Am I nuts? Or only profoundly confused? I expected the this little script to print "0": class foo(int): def __init__(self, value): self = value & 0xF print foo(0x10) Instead, it prints "16" (at least on python 2.4.4 (Linux) and 2.5 (Wine). Jim Wilson GNV, FL -- http://mail.python.org/ma

download win32file

2007-01-15 Thread jim-on-linux
Where can I download win32file / win32ui? The links below are broken. Mark Hammond should be made aware of this. URL below has two links that send you no place http://mail.python.org/pipermail/python-list/2002-October/167638.html Links: http://starship.python.net/crew/mhammond/win32/Downlo

ReportLab - Frames - Images

2007-01-15 Thread Chuck
I have been trying all day to get this to work. My complete code is below. I can get my text into the PDF, I can get my image in the PDF. What I can't get to work is frames so that the image (logo) appears to the right of the text. The image always appears first and then the text below on the next

Re: Conflicting needs for __init__ method

2007-01-15 Thread Ben Finney
[EMAIL PROTECTED] writes: > Suppose you're writing a class "Rational" for rational numbers. The > __init__ function of such a class has two quite different roles to > play. That should be your first clue to question whether you're actually needing separate functions, rather than trying to force

Re: Watch log

2007-01-15 Thread Salvatore Di Fazio
Bjoern Schliessmann ha scritto: > Why not read the file continuously and only do something if a new > line is complete (i. e. a newline char is detected)? How can I read the file continuously? -- http://mail.python.org/mailman/listinfo/python-list

Re: Watch log

2007-01-15 Thread Bjoern Schliessmann
Salvatore Di Fazio wrote: > I would like wait until a new line will be write in the file. > > Something like the "watch cat Log" command on Linux os. Why not read the file continuously and only do something if a new line is complete (i. e. a newline char is detected)? > How can I check the eof

Re: Maths error

2007-01-15 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Rhamphoryncus" <[EMAIL PROTECTED]> writes: |> |> I've been experimenting with a fixed-point interval type in python. I |> expect many algorithms would require you to explicitly |> round/collapse/whatever-term the interval as they go along, essentially |> making i

Re: Maths error

2007-01-15 Thread Rhamphoryncus
Nick Maclaren wrote: > The problem with it is that it is an unrealistically pessimal model, > and there are huge classes of algorithm that it can't handle at all; > anything involving iterative convergence for a start. It has been > around for yonks (I first dabbled with it 30+ years ago), and it

Re: Newbie - converting csv files to arrays in NumPy - Matlab vs. Numpy comparison

2007-01-15 Thread Travis E. Oliphant
oyekomova wrote: > Thanks to everyone for their excellent suggestions. I was able to > acheive the following results with all your suggestions. However, I am > unable to cross file size of 6 million rows. I would appreciate any > helpful suggestions on avoiding memory errors. None of the solutions

Anyone has a nice "view_var" procedure ?

2007-01-15 Thread Stef Mientki
hello, Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc. Probably it's not so difficult, but I don't see how to distinguish for example between a string and

Re: How naive is Python?

2007-01-15 Thread John Machin
[EMAIL PROTECTED] wrote: > John> Sorry, Skip, but I find that very hard to believe. The foo() > John> function would take quadratic time if it were merely adding on > John> pieces of constant size -- however len(str(i)) is not a constant, > John> it is O(log10(i)), so the time should b

Watch log

2007-01-15 Thread Salvatore Di Fazio
Hi guys, I've an application that writes a log file. I need to write an application with python that will read this file. I would like wait until a new line will be write in the file. Something like the "watch cat Log" command on Linux os. How can I check the eof and restart the reading? -- ht

Re: check if there is data in stdin without blocking

2007-01-15 Thread hg
Gabriel Genellina wrote: > At Monday 15/1/2007 05:55, hg wrote: > >>Well I'm testing under Linux but need support under Windows ... is there >>any way to poll stdin somehow under both plateform ? > > I think you may want this portable getch function: >

Re: Type casting a base class to a derived one?

2007-01-15 Thread Frederic Rentsch
Chris Mellon wrote: > On 11 Jan 2007 15:01:48 +0100, Neil Cerutti <[EMAIL PROTECTED]> wrote: > >> On 2007-01-11, Frederic Rentsch <[EMAIL PROTECTED]> wrote: >> >>> If I derive a class from another one because I need a few extra >>> features, is there a way to promote the base class to the >

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

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 15:53, vithi wrote: I am sorry that was a typing error. I try like that app.Print.OK.Click() but it was not working. The printer window was not IdentifiedIs their any method I can use to achive the same goal. How the window title was used as class name?. Could you please help

Re: Segfault with tktreectrl on python-2.5 on linux

2007-01-15 Thread Anton Hartl
Hi, On 2007-01-15, klappnase <[EMAIL PROTECTED]> wrote: > Some people sent me mail describing the same problem, so I think it is > not a problem with my installation of python-2.5. The treectrl widget > itself works well when running from Tcl or from python2.4, so i suspect > that it is a bug in

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

2007-01-15 Thread vithi
Dennis, I am sorry that was a typing error. I try like that app.Print.OK.Click() but it was not working. The printer window was not IdentifiedIs their any method I can use to achive the same goal. How the window title was used as class name?. Could you please help me to solve this problem. thanks t

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

2007-01-15 Thread vithi
Dennis, I am sorry that was a typing error. I try like that app.Print.OK.Click() but it was not working. The printer window was not IdentifiedIs their any method I can use to achive the same goal. How the window title was used as class name?. Could you please help me to solve this problem. thanks t

Re: How can I integrate RPC with WSGI ???

2007-01-15 Thread Bruno Desthuilliers
வினோத் a écrit : > How can I integrate RPC You mean xmlrpc or Soap ? > with WSGI ??? > is any methods for it?? > What's your problem exactly ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for Job

2007-01-15 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Any one looking for job.. I need someone good at phyton Sorry, you'll only sporadically find people competent with plants here. Regards, Björn -- BOFH excuse #83: Support staff hung over, send aspirin and come back LATER. -- http://mail.python.org/mailman/listin

Re: compile your python programs with rpython

2007-01-15 Thread Bjoern Schliessmann
Simon Burton wrote: > The pypy'ers have written a brief description on > using rpython to create standalone executables: > > http://codespeak.net/pypy/dist/pypy/doc/standalone-howto.html > > This is definately worth playing around with, it's very nice > writing (r)python code that gets executed

Re: check if there is data in stdin without blocking

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 05:55, hg wrote: Well I'm testing under Linux but need support under Windows ... is there any way to poll stdin somehow under both plateform ? I think you may want this portable getch function: -- Gabriel Ge

compile your python programs with rpython

2007-01-15 Thread Simon Burton
The pypy'ers have written a brief description on using rpython to create standalone executables: http://codespeak.net/pypy/dist/pypy/doc/standalone-howto.html This is definately worth playing around with, it's very nice writing (r)python code that gets executed as if it were c code. Simon. --

Segfault with tktreectrl on python-2.5 on linux

2007-01-15 Thread klappnase
Hello, I use the tktreectrl Tk extension (http://tktreectrl.sourceforge.net) through the python wrapper module (http://klappnase.zexxo.net/TkinterTreectrl/index.html). With python-2.5 it seems that each time some text is inserted into the treectrl widget a segfault occurs (on linux, on windows2000

can't get import to work!

2007-01-15 Thread corsairdgr
I am brand new to jython/python. I want to use my own Java class from within a Jython script. In Java, I created a class called Fubar and put this in a jar file called testit.jar. The Fubar class is in the just.for.fun package and this path shows up in the testit.jar file. I then modified

Re: catching signals in an object

2007-01-15 Thread robert
hg wrote: > Hi, > > I need to catch a signal "SIGUSR1" in an object ... and I need the signal > def that traps is to access the object context ... is that possible ? > (*nix and windows) > > ex: > > class test: > def __init__(self): > self.Set_Signal() > > def S

Re: How naive is Python?

2007-01-15 Thread John Nagle
[EMAIL PROTECTED] wrote: > John> Sorry, Skip, but I find that very hard to believe. The foo() > John> function would take quadratic time if it were merely adding on > John> pieces of constant size -- however len(str(i)) is not a constant, > John> it is O(log10(i)), so the time shoul

catching signals in an object

2007-01-15 Thread hg
Hi, I need to catch a signal "SIGUSR1" in an object ... and I need the signal def that traps is to access the object context ... is that possible ? (*nix and windows) ex: class test: def __init__(self): self.Set_Signal() def Set_Signal(self): imp

Looking for Job

2007-01-15 Thread fhk6431
Hi, Any one looking for job.. I need someone good at phyton to do black box and white box testing Contact me at [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__ equivalent for a module

2007-01-15 Thread Maksim Kasimov
Hi Leif, many thanks - it works Leif K-Brooks wrote: > Maksim Kasimov wrote: >> so my question is: how to tune up a module get default attribute if we >> try to get access to not actually exists attribute of a module? > > You could wrap it in an object, but that's a bit of a hack. > > import s

Re: How naive is Python?

2007-01-15 Thread skip
John> Sorry, Skip, but I find that very hard to believe. The foo() John> function would take quadratic time if it were merely adding on John> pieces of constant size -- however len(str(i)) is not a constant, John> it is O(log10(i)), so the time should be super-quadratic. me> S

Re: check if there is data in stdin without blocking

2007-01-15 Thread hg
Paul Boddie wrote: > hg wrote: >> import select > > [...] > >> File "/home/philippe/Desktop/select.py", line 4, in ? > > Consider which module Python is trying to import here: the standard > library select module or your own program? > > Paul Argh ;-) thanks -- http://mail.python

Re: Conflicting needs for __init__ method

2007-01-15 Thread Mark Dickinson
On Jan 14, 10:43 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 14 Jan 2007 15:32:35 -0800, dickinsm wrote: > > (You could include the normalization in __init__, but that's wasteful > Is it really? Have you measured it or are you guessing? Is it more or less > wasteful than any other so

Re: __getattr__ equivalent for a module

2007-01-15 Thread Leif K-Brooks
Maksim Kasimov wrote: > so my question is: how to tune up a module get default attribute if we > try to get access to not actually exists attribute of a module? You could wrap it in an object, but that's a bit of a hack. import sys class Foo(object): def __init__(self, wrapped): s

Re: Conflicting needs for __init__ method

2007-01-15 Thread Mark Dickinson
On Jan 14, 7:49 pm, "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote: > Mark wrote:[a lot of valid, but long concerns about types that return > an object of their own type from some of their methods] > > I think that the best solution is to use an alternative constructor > in your arithmetic methods. Th

__getattr__ equivalent for a module

2007-01-15 Thread Maksim Kasimov
Hi, in any python class it is possible to define __getattr__ method so that if we try to get some value of not actually exists instance attribute, we can get some default value. For example: class MyClass: def __getattr__(self, attname): if attname.startswith('a'):

Re: check if there is data in stdin without blocking

2007-01-15 Thread Paul Boddie
hg wrote: > import select [...] > File "/home/philippe/Desktop/select.py", line 4, in ? Consider which module Python is trying to import here: the standard library select module or your own program? Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: check if there is data in stdin without blocking

2007-01-15 Thread hg
Laurent Pointal wrote: > hg a écrit : >> hg wrote: >> >>> Hi, >>> >>> Is there a way ? ... select ? >>> >>> >>> >>> hg >> PS: >> >> import sys >> import select >> >> l_r = select.select([sys.stdin],[],[],0) >> >> gives me: >> File "select.py", line 2, in ? >> import select >> File "/ho

Re: check if there is data in stdin without blocking

2007-01-15 Thread Laurent Pointal
hg a écrit : > hg wrote: > >> Hi, >> >> Is there a way ? ... select ? >> >> >> >> hg > PS: > > import sys > import select > > l_r = select.select([sys.stdin],[],[],0) > > gives me: > File "select.py", line 2, in ? > import select > File "/home/philippe/Desktop/select.py", line 4, in ? >

Re: check if there is data in stdin without blocking

2007-01-15 Thread hg
hg wrote: > Hi, > > Is there a way ? ... select ? > > > > hg PS: import sys import select l_r = select.select([sys.stdin],[],[],0) gives me: File "select.py", line 2, in ? import select File "/home/philippe/Desktop/select.py", line 4, in ? l_r = select.select([sys.stdin],[],[],0

Default event handlers in wxPython

2007-01-15 Thread Tom Wright
Hi all I'm writing my first wxPython app and am having a problem with event handlers. I've set up a multi-part status bar and would like all the tooltips, menu help strings etc. to go into the second part of it. Is there some easy way of doing this? I've not found one, so have set up the follow

Re: How naive is Python?

2007-01-15 Thread skip
John> Sorry, Skip, but I find that very hard to believe. The foo() John> function would take quadratic time if it were merely adding on John> pieces of constant size -- however len(str(i)) is not a constant, John> it is O(log10(i)), so the time should be John> super-quadratic.

check if there is data in stdin without blocking

2007-01-15 Thread hg
Hi, Is there a way ? ... select ? hg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python web app. (advice sought)

2007-01-15 Thread Istvan Albert
Duncan Smith wrote: > I've had a look at Django, Turbogears and Plone, and at the moment I am > torn between Turbogears and Plone. I Plone is not suited for the type of application you are building (as others have pointed out in this thread). Take a second look at TurboGears (or CherryPy for t

  1   2   >