generator with subfunction calling yield

2006-09-27 Thread andy . leszczynski
Hi,

I might understand why this does not work, but I am not convinced it
should not - following:

def nnn():
print 'inside'
yield 1

def nn():
def _nn():
print 'inside'
yield 1

print 'before'
_nn()
print 'after'


for i in nnn():
print i

for i in nn():
print i



gives results:

$ python f.py
inside
1
before
after
Traceback (most recent call last):
  File "f.py", line 18, in ?
for i in nn():
TypeError: iteration over non-sequence

while I would expect:
$ python f.py
inside
1
before
inside
1
after

Any insight?

andy

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: HP open source printer drivers are in Python

2006-01-17 Thread Andy Leszczynski
Andy Leszczynski wrote:
> I have a specific question, anybody is familiar?

Just wanted to report, that problem is solved :-).


But seriously, sorry for enigmatic question. I have had a very weird 
problem with HPLIP 0.97. Wanted to check out if there is someone 
familiar with the design of HPLIP before diving into deep details. But 
in meantime after detailed debugging of the Python and C++ parts I 
pinpointed the problem which turned out to be not uninstalled older 
version of sane shared libraries which screwed up some part of the inter 
process communication.

Anyway, thx for the interest.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


HP open source printer drivers are in Python

2006-01-12 Thread Andy Leszczynski
I have a specific question, anybody is familiar?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


adding vectors

2005-12-19 Thread Andy Leszczynski
Hi,

Short question: why (1,"abc",0.3)+(2,"def",10.2) != (3,"abcdef",10.5)?

How to elegantly achieve (3,"abcdef",10.5) as a result of addition ...


Andy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ?: in Python

2005-12-17 Thread Andy Leszczynski
Steven D'Aprano wrote:
> On Wed, 14 Dec 2005 20:17:28 -0500, Andy Leszczynski wrote:
> 
> 
>>I can tell you what is not elegant in the if else: approach. It is 
>>logically a one operation while you are forced to use varaible "a" 
>>twice. Fundamental flaw IMO.
> 
> 
> "Logically" one operation?
> 
> def twenty_countries_in_seven_days_bus_tour():
> ...
> if today() == Monday:
> write_postcode_to_mother("We must be in Belgium.")
> else:
> get_back_on_the_bus("Not again!")
> ...
> 
> 
> if...else expressions with a single operation are just a special case.
> Perhaps a common special case, but still a special case.
> 
> 

First:
"Special cases aren't special enough to break the rules.
Although practicality beats purity."


Second, let's look at again:
 >if condition:
 >   a=1
 >else:
 >   a=2

The primer meaning behind that is that I want to assign something to a. 
  What I want to assign is secondary issue. I do not like C syntax of ?: 
either but I think it is just practical and self-explanatory.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ?: in Python

2005-12-14 Thread Andy Leszczynski
Steven D'Aprano wrote:
> On Wed, 14 Dec 2005 14:09:10 -0500, Andy Leszczynski wrote:
> 
> 
>>How can do elegantly in Python:
>>
>>if condition:
>>a=1
>>else:
>>a=2
>>
>>like in C:
>>
>>a=condition?1:2
> 
> 
> I thought you wanted to do it *elegantly*?
> 
> Your first solution is perfectly elegant to my eyes, unlike that horrible
> C syntax.

I can tell you what is not elegant in the if else: approach. It is 
logically a one operation while you are forced to use varaible "a" 
twice. Fundamental flaw IMO.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ?: in Python

2005-12-14 Thread Andy Leszczynski
Lawrence Oluyede wrote:
> Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto:
> 
>>How can do elegantly in Python:
>>
>>if condition:
>>a=1
>>else:
>>a=2
>>
>>like in C:
>>
>>a=condition?1:2
>>
> 
> 
> There are tons of threads on this newsgroup and in the python-dev mailing
> list about a ternary operator. There's also a PEP AFAIK.
> 
> I like this:
> 
> In [1]:switch = True
> 
> In [2]:a = (1, 2)[switch]
> 
> In [3]:print a
> 2
> 
> 

Like it too, thx. Switch does not have to be bool, so it is more 
powerfull than ?:.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


?: in Python

2005-12-14 Thread Andy Leszczynski
How can do elegantly in Python:

if condition:
a=1
else:
a=2

like in C:

a=condition?1:2

-- 
http://mail.python.org/mailman/listinfo/python-list


attaching to running python program with the debugger?

2005-12-13 Thread Andy Leszczynski
Hi,

I have a program which somewhere gets into infinite look and take 100% 
of CPU. How can attach to it with the debugger to find out where it 
takes place?


A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [OT] Oracle 9i client for Linux

2005-11-29 Thread Andy Leszczynski
Bernard Delmée wrote:
> Look into the Oracle Instant Client: 
>  
> (might require a -free- OTN registration)

It is version 10, would it be compatible with 9i servers?

> Be sure to download the smallish "sdk" if you want to compile client code
> (e.g. cx_oracle - highly recommended  

Indeed I use cx_oracle but on M$ yet. Want to move to Linux.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


[OT] Oracle 9i client for Linux

2005-11-29 Thread Andy Leszczynski
Where can I find such? I can download from Oracle whole thing but no the 
client itself.

Any insight?

Thanks, A.
-- 
http://mail.python.org/mailman/listinfo/python-list


pickle - recursion - stack size limit - MS windows

2005-11-05 Thread Andy Leszczynski
I need to pickle quite complex objects and first limitation was default
200 for the recursion. sys.setrecursionlimit helped, but still bigger
objects fail to be pickled because of XP stack size limitation.

Any idea how to get around the problem ...

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python vs Ruby

2005-10-26 Thread Andy Leszczynski
Amol Vaidya wrote:
> Hi. I am interested in learning a new programming language, and have been 
> debating whether to learn Ruby or Python. How do these compare and contrast 
> with one another, and what advantages does one language provide over the 
> other? I would like to consider as many opinions as I can on this matter 
> before I start studying either language in depth. Any help/comments are 
> greatly appreciated. Thanks in advance for your help. 

How Ruby solves the problem of global interpreter lock?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python vs Ruby

2005-10-26 Thread Andy Leszczynski
Steven D'Aprano wrote:

> 
> Every line = more labour for the developer = more cost and time.
> Every line = more places for bugs to exist = more cost and time.
>

The place I work at the creation rate is not a problem - we could crank 
out in the team 1000s lines a week. Most time we spend is on maintanance 
. This is where Pyton shines over Java/C++/Perl. It is easy to read thus 
  maintane.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


creating/altering the OpenOffice spredsheet docs

2005-10-26 Thread Andy Leszczynski
Any idea how to do that the way ActiveX would be used on M$?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TurboGears /.-ed, >new == True< or >new == "True"

2005-10-12 Thread Andy Leszczynski
Sybren Stuvel wrote:
> Andy Leszczynski enlightened us with:
> 
>>should not it be:
>>
>>2 def save(self, pagename, data, submit, new):
>>3 hub.begin()
>>4 if new == True:
>>5 page = Page(pagename=pagename, data=data)
>>6 else:
>>7 page = Page.byPagename(pagename)
>>8 page.data = data
>>
>>instead of:
>>
>>4 if new == "True":
> 
> 
> No it should not. The values passed to the function are the strings
> passed by the GET request, hence all strings. There are methods of
> dealing with this - read the rest of the documentation.
> 
> Sybren

So how does it correspond to other piece of the code:

2   def notfound(self, pagename):
3   return dict(pagename=pagename, data="", new=True)

new is a boolean here?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: piping out binaries properly

2005-10-11 Thread Andy Leszczynski
Mike Meyer wrote:
> It's not normal to write binary content to stdout - you normally write

Well, I grew up in the Unix world and it is normal over there.

I am still curious which layer adds that 0xd. Is it python, cygwin, 
windows ...

Thx for reply, Andy
-- 
http://mail.python.org/mailman/listinfo/python-list


piping out binaries properly

2005-10-11 Thread Andy Leszczynski
I have got following program:

import sys
import binascii
from string import *
sys.stdout.write(binascii.unhexlify("41410A4141"))


when I run under Unix I got:

$ python u.py > u.bin
$ od -t x1 u.bin
000 41 41 0a 41 41

and under Windows/Cygwin following:

$ python u.py > u.bin
$ od -t x1 u.bin
000 41 41 0d 0a 41 41
006


The question is how can I pipe out binary content properly and platform
independently?


A.
-- 
http://mail.python.org/mailman/listinfo/python-list


TurboGears /.-ed, >new == True< or >new == "True"

2005-10-11 Thread Andy Leszczynski
watch this:
http://www.turbogears.org.nyud.net:8090/docs/wiki20/20MinuteWiki.mov

or read this:
http://www.turbogears.org.nyud.net:8090/docs/wiki2 0/page4.html

should not it be:

2 def save(self, pagename, data, submit, new):
3 hub.begin()
4 if new == True:
5 page = Page(pagename=pagename, data=data)
6 else:
7 page = Page.byPagename(pagename)
8 page.data = data

instead of:

4 if new == "True":
-- 
http://mail.python.org/mailman/listinfo/python-list


RFC 1521 and missing binary Content-Transfer-Encoding in email module

2005-09-15 Thread Andy Leszczynski
Why email/Encoders.py is missing binary encoding. It should be there 
according to RFC 1521:

encoding := "Content-Transfer-Encoding" ":" mechanism
mechanism := "7bit"  ;  case-insensitive
   / "quoted-printable"
   / "base64"
   / "8bit"
   / "binary"
   / x-token

Would it be difficult to make it up?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Manging multiple Python installation

2005-09-13 Thread Andy Leszczynski
Jeremy Jones wrote:

> I guess I'm still having a hard time understanding "what does it 
> matter?".


I was under impression that configure embeds the prefix in the build 
itself. I was concerned to have to preform the configure/make every time 
I change the destination path. It turns out that the makefile produced 
by configure uses prefix only for the install. Thus it is not big deal 
anymore.

Thx for all commnets.

A.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Manging multiple Python installation

2005-09-07 Thread Andy Leszczynski
Robert Kern wrote:
> Andy Leszczynski wrote:
> 
>>Jeremy Jones wrote:
>>
>>
>>>Andy Leszczynski wrote:
>>>
>>>Download the source, untar, cd to the new directory, run:
>>>
>>>./configure --prefix=/opt/mypython
>>>make
>>>make install
>>
>>Is there any way to pass the prefix to the "make install"?
> Is passing it to the configure script a problem?

not really but seems to be a bit illogical to me that the build (set of 
executables and libraries) depends on the destination installation path.

Under M$ Windows I was able to install Python in let's say C:\Program 
Files\python and then move/copy it frelly to whatever location I need. 
Only thing was the resetting PATH to the new location. I miss that under 
Linux.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Manging multiple Python installation

2005-09-07 Thread Andy Leszczynski
Jeremy Jones wrote:
> Andy Leszczynski wrote:
> 
> Download the source, untar, cd to the new directory, run:
> 
> ./configure --prefix=/opt/mypython
> make
> make install

Is there any way to pass the prefix to the "make install"? Why "make" 
depends on that?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Manging multiple Python installation

2005-09-07 Thread Andy Leszczynski
Hi,
I run Mandrake 10.0 with python 2.3 installed by default. I want to keep 
it as it is but need another, very customized Python installation based 
of 2.3 as well. I would prefer to have it the way it is on Windows, one 
folder e.g. /opt/mypython with all the stuff under that. It would be 
unlike that standard installation where everything is scattered across 
/usr /bin/ /.../doc. That way I can easily tar it and distribute to 
whatever machine I want.

How can I achieve that? Please help, Andy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python supports LSP, does it?

2005-08-10 Thread Andy Leszczynski
Mike Meyer wrote:
[...]
> The wikipedia was really abusing the phrase LSP. I've corrected the
> wikipedia.
>  http://mail.python.org/mailman/listinfo/python-list


Python supports LSP, does it?

2005-08-09 Thread Andy Leszczynski
wikipedia 
(http://en.wikipedia.org/wiki/Python_programming_language#Object-oriented_programming)
 
says:
"""
Python's support for object oriented programming paradigm is vast. It 
supports polymorphism [...] fully in the Liskov substitution 
principle-sense for all objects.
"""

Just wondering if it is true statement. Is not LSP more a quality of the 
desing of class hierachy rather then language itslef? Comments?

AndyL
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Berkely DB – many writers, many readers

2005-08-06 Thread Andy Leszczynski
Eric S. Johansson wrote:
> Andy Leszczynski wrote:
> 
>>
>> I need to now option I open the Berkley DB (both db and env) to have 
>> configuration for multiple writers and multiple readers.  Via multiple 
>> processes  and multiple threads. No trx needed.
> 
> 
> the simple answer is you can't.  bdbm is probably single writer multiple 
> reader.  I believe if you use of the the most recent sleepy cat 
> database, you have support for multiple readers and writers in any context.
[...]

I have learned later that you can, just use Concurrent DB poruct 
(db.DB_INIT_CDB):

...envflags=db.DB_CREATE|db.DB_INIT_MPOOL|db.DB_THREAD|db.DB_INIT_CDB
...env.open(file,envflags)

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: >time.strftime %T missing in 2.3

2005-08-04 Thread Andy Leszczynski
Robert Kern wrote:
> Andy Leszczynski wrote:
> 
>> Python 2.2/Unix
>>
>>  >>time.strftime("%T")
>> '22:12:15'
>>  >>time.strftime("%X")
>> '22:12:17'
>>
>> Python 2.3/Windows
>>
>>  >>time.strftime("%X")
>> '22:12:47'
>>  >> time.strftime("%T")
>> ''
> 
> 
>  From http://docs.python.org/lib/node252.html
> 
> """The full set of format codes supported varies across platforms, 
> because Python calls the platform C library's strftime() function, and 
> platform variations are common."""
> 
> So I suggest that it's a platform issue, not a Python version issue. FWIW:
> 
> Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import time
>  >>> time.strftime("%T")
> '22:50:49'
>  >>> time.strftime("%X")
> '22:50:59'
> 

I accept that, but still pain. Took me a while to filter out the problem 
in the code running on the Unix and not on M$.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


>time.strftime %T missing in 2.3

2005-08-04 Thread Andy Leszczynski
Python 2.2/Unix

 >>time.strftime("%T")
'22:12:15'
 >>time.strftime("%X")
'22:12:17'

Python 2.3/Windows

 >>time.strftime("%X")
'22:12:47'
 >> time.strftime("%T")
''

Any clues?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Berkely DB – many writers, many rea ders

2005-07-07 Thread Andy Leszczynski


I need to now option I open the Berkley DB (both db and env) to have 
configuration for multiple writers and multiple readers.  Via multiple 
processes  and multiple threads. No trx needed.

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Python Challenge web site

2005-06-08 Thread Andy Leszczynski
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

http://www.pythonchallenge.com/

anybody get to the level 30? :-)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do i read just the last line of a text file?

2005-05-29 Thread Andy Leszczynski
Chris F.A. Johnson wrote:
> On Sun, 29 May 2005 at 05:57 GMT, John Machin wrote:
> 
>>Chris F.A. Johnson wrote:
>>
>>
>>>file = open(argv[1])  ## Open the file given on the command line
>>>all_lines = file.readlines()  ## Read all the lines
>>
>>I see your shadowing and raise you one obfuscation:
> 
> 
>;)
> 
> 
>>open = file(argv[1])  ## File the open given on the command line
>>all_lines = open.readlines()  ## Read all the lines
> 
> 
>Such verbosity! (I excuse mine on the grounds that it was my first
>attempt at a Python program.)
> 
> all_lines = file(argv[1]).readlines()
> 
>And to answer the question in the subject line:
> 
> last_line = file(argv[1]).readlines()[-1]
> 
>Both of which assume "from sys import argv".
> 
> 
>Now I have to get serious and forget those bad habits.
> 

What if a file is long enough?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: write to the same file from multiple processes at the same time?

2005-05-27 Thread Andy Leszczynski
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


how to import a module from a arbitraty path?

2005-05-25 Thread Andy Leszczynski
I have a program which is going to dynamicly load components from some 
arbitrary defined paths. How to do that?

A.
-- 
http://mail.python.org/mailman/listinfo/python-list


ldaptor based LDAP server

2005-05-19 Thread Andy Leszczynski
Hi,
I am looking for a Python barebones for a simple LDAP
server project. It does not have to be Twisted based,
but it would be wonderful if it is. I need a very
simple server which is listening on some port and
accepts following LDAP messages:
-bind
-search
-unbind

There are not going to be a actual LDAP database
backend. All what happens is parsing above and reply
with some simple content based on the some parameters
from the request.

I am just wondering with using ldaptor's protocol
components I could easily come up with such a server?
What do you think, would it be feasible with that?

Thanks in advance,

AndyL
-- 
http://mail.python.org/mailman/listinfo/python-list


Getting a list of classes in the current module/auto introspection

2005-04-28 Thread Andy Leszczynski
Hi,
I have a following problem. Let's say there is a module which could be 
imported or run as __main__. It is going to contain hundreds of classes, 
something like that:

import moduleA
from moduleB import *
class A:
pass
class B:
pass
class C:
pass
[...]
I would like to be able to get references (or names) of all of them but 
excluding stuff from moduleA and module B. Is there any pythonic/elegant 
way to do that?

Thanks, Andy
--
http://mail.python.org/mailman/listinfo/python-list


Re: How remove directories with the content in the platform independent way?

2005-04-28 Thread Andy Leszczynski
Jason Mobarak wrote:
There's also the shutil module, which is platform independant.
http://docs.python.org/lib/module-shutil.html
...see the rmtree function
Thanks, this is what I was looking for.
A.
--
http://mail.python.org/mailman/listinfo/python-list


Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
Andy Leszczynski wrote:
James Stroud wrote:
Look at the os and os.path modules.
http://docs.python.org/lib/module-os.html
http://docs.python.org/lib/module-os.path.html

On Tuesday 26 April 2005 07:27 pm, so sayeth Andy Leszczynski:
How remove directories with the content in the platform independent way?
Is the API for that?
Thx, A.


It is not clear if rmdir would remove the non-empty dir ...
never min, I found this in that doc :-)
# Delete everything reachable from the directory named in 'top',
# assuming there are no symbolic links.
# CAUTION:  This is dangerous!  For example, if top == '/', it
# could delete all your disk files.
import os
for root, dirs, files in os.walk(top, topdown=False):
for name in files:
os.remove(os.path.join(root, name))
for name in dirs:
os.rmdir(os.path.join(root, name))
--
http://mail.python.org/mailman/listinfo/python-list


Re: How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
James Stroud wrote:
Look at the os and os.path modules.
http://docs.python.org/lib/module-os.html
http://docs.python.org/lib/module-os.path.html

On Tuesday 26 April 2005 07:27 pm, so sayeth Andy Leszczynski:
How remove directories with the content in the platform independent way?
Is the API for that?
Thx, A.

It is not clear if rmdir would remove the non-empty dir ...
--
http://mail.python.org/mailman/listinfo/python-list


How remove directories with the content in the platform independent way?

2005-04-26 Thread Andy Leszczynski
How remove directories with the content in the platform independent way?
Is the API for that?
Thx, A.
--
http://mail.python.org/mailman/listinfo/python-list


Re: SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-13 Thread Andy Leszczynski
Steve Holden wrote:
Andy Leszczynski wrote:
Sorry for questioning Python :-) - it turned out that this is a 
problem with Mozilla. For some reason it holds up with opening second 
connection to given host until the previous one is completed. 
Interestingly enough, IE works better with Python multi threaded 
server in that regard.

Thx, A.

Try switching keepalives off, or falling back to HTTP 1.0 - ironically 
it may be the attempt to use the same connection for both pieces of 
content that holds things up.

regards
 Steve
I tested it before and it did not work either. Have to try  HTTP 1.0 thouh.
Thanks, A.
--
http://mail.python.org/mailman/listinfo/python-list


Re: SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-11 Thread Andy Leszczynski
Sorry for questioning Python :-) - it turned out that this is a problem 
with Mozilla. For some reason it holds up with opening second connection 
to given host until the previous one is completed. Interestingly enough, 
IE works better with Python multi threaded server in that regard.

Thx, A.
--
http://mail.python.org/mailman/listinfo/python-list


looking for case insesitive dictionary

2005-03-09 Thread Andy Leszczynski
so e.g.
x={}
x['a']=1
x['A']=2
print x['a'] #prints 2
Thx, A.
--
http://mail.python.org/mailman/listinfo/python-list


BaseHTTPServer.BaseHTTPRequestHandler and HTTP chunking

2005-03-09 Thread Andy Leszczynski
Does BaseHTTPServer.BaseHTTPRequestHandler support HTTP protocol chunking?
Thanks, Andy
--
http://mail.python.org/mailman/listinfo/python-list


SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-09 Thread Andy Leszczynski
I need a HTTP server handling long lasting requests e.g. 10-30 seconds. 
Below is a pice of the code. In order to make the server reponsive while 
handling othere requests I use SocketServer.ThreadingMixIn.

However the problem is the it does not work out. I checked thet a new 
thread is created for each new connection new, but the main loop seems 
to be frozen until the prevoius handling ends.

What could go wrong?
Thanks, Andy

* * *
import os
import time
import BaseHTTPServer
import SocketServer
import threading
import sys
class
SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
response=""+str(time.time())
self.send_response(200)
self.send_header("Content-type",'text/plain')
self.send_header("Content-Length",len(response))
self.end_headers()
time.sleep(10) #simulation of the processing
self.wfile.write(response)
def do_POST(self):
self.do_GET()
class
myWebServer(SocketServer.ThreadingMixIn,BaseHTTPServer.HTTPServer):
  pass
if __name__ == '__main__':
server_address = ('',80)
httpd=myWebServer(server_address,SimpleHTTPRequestHandler)
sa=httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1],"..."
httpd.serve_forever()
--
http://mail.python.org/mailman/listinfo/python-list


What e-mail list provides the best support for Twisted?

2005-03-02 Thread Andy Leszczynski
Thx, A.
--
http://mail.python.org/mailman/listinfo/python-list


[Twisted] potential bug in the reactor's handling events loop

2005-03-01 Thread Andy Leszczynski
Python 2.3, one of the latest Twisted version:
I noted that under Linux there is not way to Control-C the reactor loop. 
After digging a little I found that following change helpes:

[EMAIL PROTECTED] internet]# diff base.py{,.ori}
>
302d301
<   print "1",sysEvtTriggers
305d303
<   print "2",`self._eventTriggers`
307,308c305
< for callable, args, kw in sysEvtTriggers[1]:
<   print "3"
---
>
> for callable, args, kw in sysEvtTriggers[0]:
317d313
<   print "4"
320d315
<   print "5",`eventType`
Of course it is quick work around, not a permanent fix, but it really helps.
Please advice, Andy
--
http://mail.python.org/mailman/listinfo/python-list


rounding problem

2005-02-23 Thread Andy Leszczynski
It is on Windows, Linux, Python 2.3:
[GCC 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a=1.1
>>> a
1.1001
>>>
Is it normal?
Andy
--
http://mail.python.org/mailman/listinfo/python-list


wxPython 2.5 - bug in wx.Execute

2005-02-19 Thread Andy Leszczynski
Hi,
I need a help with following problem which is blocking me quite seriously.
I noted some weird behavior on Windows (Python 2.3, wxPython 2.5). The 
same code works fine under Linux.

When using “pid = wx.Execute(cmd, wx.EXEC_ASYNC, self.process)” to spawn 
new wxPython based GUI program, the GUI does not pop up. I checked that 
the process itself is running/alive, the print over the streams get 
propagated to the parent process, but no GUI. It only happnes for 
wxPython based programs - for e.g. regural python command line programs 
it works fine.

It is easy to be replicated using wx Demo by opening Process and 
Events/Process.  Then after typing in "python -u demo.py"  nothing happens.

Please help, it really blocks me.  The temporary work around is to use 
"cmd /e python -u demo.py", but I lose the unbuffered -u effect.

Thanks,
Andy
--
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython demo /Process does not open new demo

2005-02-18 Thread Andy Leszczynski
Andy Leszczynski wrote:
Try to run wxPython 2.5 (for python 2.3) demo. Then Open Process and 
Events/Process. Type in "python -u demo.py" and wait. There is a splash 
screen but nothing more. Why?

Regards,A.
Forgot to add that it happnes on Win2K.
--
http://mail.python.org/mailman/listinfo/python-list


wxPython demo /Process does not open new demo

2005-02-18 Thread Andy Leszczynski
Try to run wxPython 2.5 (for python 2.3) demo. Then Open Process and 
Events/Process. Type in "python -u demo.py" and wait. There is a splash 
screen but nothing more. Why?

Regards,A.
--
http://mail.python.org/mailman/listinfo/python-list