Pydev 1.4.7 Released

2009-07-09 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.4.7 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Re: Python Error from Apress book

2009-07-09 Thread Gabriel Genellina
En Wed, 08 Jul 2009 06:35:54 -0300, Dave Angel da...@ieee.org escribió: Gabriel Genellina wrote: Jul 2009 09:55:13 -0300, Dave Angel da...@ieee.org escribió: Gabriel Genellina wrote: En Mon, 06 Jul 2009 19:56:40 -0300, matt0177 matt0...@gmail.com escribió: When I try to run the command as

Re: PyQt GUI

2009-07-09 Thread Helvin
On Jul 9, 11:29 am, Robert Kern robert.k...@gmail.com wrote: On 2009-07-08 18:10, Helvin wrote: Thanks for the fast replies! I will look into how to use VTK now. Where would I find VTK's explicit support for PyQt? Wrapping/Python/vtk/qt4/ in the VTK sources. Because I have installed VTK

Re: tough-to-explain Python

2009-07-09 Thread greg
Dave Angel wrote: By the time I graduated, I had five six-level languages ^^^ Are they languages that you have to edit using vi? :-) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Pydev 1.4.7 Released

2009-07-09 Thread Morten Nygaard Aasnes
On 2009-07-08, Fabio Zadrozny fabi...@gmail.com wrote: Hi All, Pydev and Pydev Extensions 1.4.7 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Nice! Will this work in

Re: [0, 0, 0, 1, 1, 1, 0] ... remove all 0 values

2009-07-09 Thread Stefan Behnel
Paul Rubin wrote: Daniel Austria writes: just one question. How can i remove all 0 values in a list? I prefer: newlist = list(x for x in oldlist if x != 0) to the square bracket list comprehension that a few people have suggested. This is because in python 2.x, the listcomp leaks

Re: Emacs Python-mode. Newbie problem.

2009-07-09 Thread Lacrima
On Jul 8, 10:54 pm, Piet van Oostrum p...@cs.uu.nl wrote: Lacrima lacrima.ma...@gmail.com (L) wrote: L Hello! L I have just started using Emacs to write python scripts. L I installed python-mode.el L Then I just tried this code: L print 'hello world' L When I press C-c RET, new blank

can i write a assemly language programs in python

2009-07-09 Thread m.reddy prasad reddy
can any one tell me how to write assembly language programs in python...if no is there any other way to write the programs in python Reddi prasad reddy ph.no:09958083797 -- http://mail.python.org/mailman/listinfo/python-list

Re: count

2009-07-09 Thread Paul Rubin
a...@pythoncraft.com (Aahz) writes: When dealing with small N, O() can get easily swamped by the constant factors. How often do you deal with more than a hundred fields? The number of fields in the OP's post was not stated. Expecting it to be less than 100 seems like an ill-advised

PyGtk Depends on Numeric

2009-07-09 Thread dieter
Get with the times people and port to numpy. :P Don't you think its about time? ~Pete -- http://mail.python.org/mailman/listinfo/python-list

Re: ... remove all 0 values

2009-07-09 Thread Daniel Austria
Thanks a lot for your advices, i decided to use the filter() method to sort out the 0. i can ´t use the sum() function cause i need the list afterwards best, Dan -- http://mail.python.org/mailman/listinfo/python-list

i need immediate help from u

2009-07-09 Thread m.reddy prasad reddy
i m new this community .; can any one send me the solution for writing the assembly language programs in python my mail ID:redd@gmail.com id%3aredd@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: i need immediate help from u

2009-07-09 Thread Chris Rebert
On Thu, Jul 9, 2009 at 12:25 AM, m.reddy prasad reddyreddy@gmail.com wrote: i m new this community .; can any one send me the solution for writing the assembly language programs in python my mail ID:redd@gmail.com Please read http://catb.org/esr/faqs/smart-questions.html Cheers,

Re: regex help

2009-07-09 Thread Peter Otten
David wrote: tdnbsp;/td td width=1% class=keyOpen: /td td width=1% class=val5.50 /td tdnbsp;/td td width=1% class=keyMkt Cap: /td td width=1% class=val6.92M /td tdnbsp;/td td width=1% class=keyP/E: /td td width=1% class=val21.99 /td I want to extract the open, mkt cap and

Re: Problem reading file with umlauts

2009-07-09 Thread Claus Hausberger
Thanks a lot. I will try that on the weekend. Claus Claus Hausberger wrote: Thanks a lot. Now I am one step further but I get another strange error: Traceback (most recent call last): File ./read.py, line 12, in module of.write(text) UnicodeEncodeError: 'ascii' codec can't

Re: Clarity vs. code reuse/generality

2009-07-09 Thread Gabriel Genellina
En Wed, 08 Jul 2009 23:19:25 -0300, kj no.em...@please.post escribió: In mailman.2700.1246895025.8015.python-l...@python.org Tim Rowe digi...@gmail.com writes: 2009/7/4 kj no.em...@please.post: Precisely. =A0As I've stated elsewhere, this is an internal helper function, to be called only

Re: Check file is locked?

2009-07-09 Thread Rajat
On Jul 8, 12:45 pm, Tim Golden m...@timgolden.me.uk wrote: Rajat wrote: On Jul 8, 4:57 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.2795.1246997268.8015.python-l...@python.org, Christian Heimes wrote: By the way most operating systems don't lock

Re: tkinter problem

2009-07-09 Thread Peter Otten
Paul Simon wrote: Chris Rebert c...@rebertia.com wrote in message news:mailman.2863.1247095339.8015.python-l...@python.org... On Wed, Jul 8, 2009 at 4:18 PM, Paul Simonpsi...@sonic.net wrote: I have the tkinter problem and need some assistance to straighten it out. From the web page

Re: Problem with list of dicts and copying

2009-07-09 Thread Gabriel Genellina
En Wed, 08 Jul 2009 14:09:43 -0300, Cameron Pulsford cameron.pulsf...@gmail.com escribió: I'm representing the board as a dictionary, where the keys are (x, y) positions, and the values are candidates. So my program goes along picking numbers from the list of candidates and then propagating

Re: Check file is locked?

2009-07-09 Thread Tim Golden
Rajat wrote: I've used the Handle.exe and got the following results: -- notepad.exe pid: 3540 COMP\rajatd C: File (RW-) C:\Documents and Settings\rajatd\Desktop 10: File (RW-)

Re: windows command-line

2009-07-09 Thread Gabriel Genellina
En Wed, 08 Jul 2009 14:23:54 -0300, Emile van Sebille em...@fenx.com escribió: On 7/8/2009 10:07 AM Lucas Junqueira said... Hi, I'd like to run a simple windows command-line program from within my python script and agt all the returt it generates. Is this possible? How can I do it?

Hello

2009-07-09 Thread Tanmoy
Hi ... I have been trying to set this 2-D array of this sort. 0 10 20 ... 1000 1 11 21... 1000 Here is the code i tried ... arr=[] for i in range(0,1010,10): arr.append([]) for j in range(0,1001,1): arr[i].append(i+j) print arr I am getting

Re: python3 fail to start

2009-07-09 Thread Mark Dickinson
On Jun 30, 3:43 pm, ts thaisi...@gmail.com wrote: i just install the python 3.1 dmg onto my mac. when i run python3, it fail with : Fatal Python error: Py_Initialize: can't initialize sys standard streamsLookupError: unknown encoding: Abort trap couldnt understand the problem. anyone can

Re: Hello

2009-07-09 Thread MRAB
Tanmoy wrote: T Hi ... I have been trying to set this 2-D array of this sort. 0 10 20 ... 1000 1 11 21... 1000 Here is the code i tried ... arr=[] for i in range(0,1010,10): arr.append([]) for j in range(0,1001,1): arr[i].append(i+j)

Re: can i write a assemly language programs in python

2009-07-09 Thread Gabriel Genellina
En Thu, 09 Jul 2009 04:17:52 -0300, m.reddy prasad reddy reddy@gmail.com escribió: can any one tell me how to write assembly language programs in python...if no is there any other way to write the programs in python You write Python programs using Python, not assembly. Perhaps if you

subprocess + python-daemon - bug/problem?

2009-07-09 Thread Andy Clegg
Hi all, I'm trying to daemonize a python program, and occasionally have it run subprocesses, however I'm running into a nasty error, as follows: File /users/rsg/ancl/devcocast/devcocast-svn/scripts/DaemonSpawnTes t.py, line 5, in module subprocess.Popen('echo 1').wait() File

older pythons

2009-07-09 Thread superpollo
hi everybody. i have a certain set of old python scripts and data used by said scripts which were written using python 2.3 in particular i used some features which were later modified or deprecated by the language newer versions (e.g.: cmp(), print as keyword, and such...) for reasons i

hoe to build a patched socketmodule.c

2009-07-09 Thread jacopo mondi
Hi all, I need to patch socketmodule.c (the _socket module) in order to add support to an experimental socket family. I'm guessing about the patched module build process: does a stand alone build script using distutils makes sense, or have I to patch sockmodule.c, eventualy rename it, modify

Re: subprocess + python-daemon - bug/problem?

2009-07-09 Thread Andy Clegg
My apologies, the python code should have been: import daemon import subprocess daemon.DaemonContext(stderr = open(fakeConsole.txt,w+)).open() subprocess.Popen(['echo','1']).wait() However the error remains the same. Yours, Andy On Jul 9, 10:26 am, Andy Clegg andy...@gmail.com wrote: Hi

Re: older pythons

2009-07-09 Thread Adrian Dziubek
The recommended Debian way is update-alternatives. I find it a bit unintuitive, so I have to read through the documentation every time I use it, but it should be able link a chosen version of python to /usr/ bin/python. I don't know if it's set up by default, I have only one version installed. --

Re: Check file is locked?

2009-07-09 Thread Rajat
On Jul 9, 1:21 pm, Tim Golden m...@timgolden.me.uk wrote: Rajat wrote: I've used the Handle.exe and got the following results: ---­--- notepad.exe pid: 3540 COMP\rajatd     C: File  (RW-)   C:\Documents and

Psyco 64 bits

2009-07-09 Thread Luis P. Mendes
Hi, I used Psyco to speed up my Python code. Due to the great amount of data I have to proccess, I moved my Linux system to a 64 bits version with more RAM. It seems that Psyco cannot be used in such platforms. Or is there another version of Psyco for 64 bits platform? I googled and arrived to

Re: can i write a assemly language programs in python

2009-07-09 Thread Tom Kermode
I wonder if the OP is trying to find out whether python programmes can be compiled and run as stand alone executables. (I know assembly and machine code are not the same, but it might be what they're after.) On windows you can use http://www.py2exe.org/ to bundle python programs into stand alone

Re: Check file is locked?

2009-07-09 Thread Tim Golden
Rajat wrote: The Notepad process information is fine here. However, with wordpad the results are not much differentiating: -- wordpad.exe pid: 2832 COMP\rajatd 1C: File (RW-)

Re: Python-list Digest, Vol 70, Issue 123

2009-07-09 Thread Tanmoy
Hello , When i==0 you append an empty list to arr, so arr[i] is arr[0]. No problem. When i==10 you append another empty list to arr, so arr[i] is arr[10]. Index error because there's no arr[10], only arr[0] and arr[1]. Thanks for your prompt reply... How can i pass this problem

Re: Python-list Digest, Vol 70, Issue 123

2009-07-09 Thread MRAB
Tanmoy wrote: Hello , When i==0 you append an empty list to arr, so arr[i] is arr[0]. No problem. When i==10 you append another empty list to arr, so arr[i] is arr[10]. Index error because there's no arr[10], only arr[0] and arr[1]. Thanks for your prompt reply... How can i pass

Re: IP Address Function

2009-07-09 Thread Piet van Oostrum
Fred Atkinson fatkin...@mishmash.com (FA) wrote: FA On Wed, 08 Jul 2009 12:29:54 +0200, Piet van Oostrum p...@cs.uu.nl FA wrote: Something like: #! /usr/bin/env python import cgi from os import getenv print Content-type: text/html print ipaddr = (getenv(HTTP_CLIENT_IP) or

Re: older pythons

2009-07-09 Thread superpollo
Adrian Dziubek wrote: The recommended Debian way is update-alternatives. I find it a bit unintuitive, so I have to read through the documentation every time I use it, but it should be able link a chosen version of python to /usr/ bin/python. I don't know if it's set up by default, I have only

Re: Check file is locked?

2009-07-09 Thread Rajat
On Jul 9, 3:21 pm, Tim Golden m...@timgolden.me.uk wrote: Rajat wrote: The Notepad process information is fine here. However, with wordpad the results are not much differentiating: ---­--- wordpad.exe pid: 2832

property using a classmethod

2009-07-09 Thread Emanuele D'Arrigo
Greetings, today I did something like this: class MyClass(object): @classmethod def myClassMethod(self): print ham myProperty = property(myClassMethod, None, None) As many of you know this doesn't work and returns a TypeError: the object passed to the property is not a

Re: count

2009-07-09 Thread Bearophile
Paul Rubin: print x, sum(1 for _ in g) Don't use that, use my function :-) If g has a __len__ you are wasting time. And sum(1 ...) is (on my PC) slower. J. Clifford Dyer: if __name__ == '__main__':     test_func(summer, 1000)     test_func(tupler, 1000)     test_func(summer,

Re: Psyco 64 bits

2009-07-09 Thread Bearophile
Luis P. Mendes: It seems that Psyco cannot be used in such platforms. Or is there another version of Psyco for 64 bits platform? I googled and arrived to PyPy.  But I don't know how to use it. Psyco will be updated, but probably not for 64 bit CPUs. At the moment PyPy doesn't give you much

python-ldap

2009-07-09 Thread Larry kavanagh
Hi, I need a PYTHON-LDAP package. I'm trying to install ploneldap and it tells me I need python-ldap package first .. but I can't find one to match my versions. I'm using plone 3.2.2, Python 2.4.4 and Zope 2.10.7 on a Win32 environment. Preferable I'd like an EXE as not too familiar with

Re: older pythons

2009-07-09 Thread Lie Ryan
superpollo wrote: Adrian Dziubek wrote: The recommended Debian way is update-alternatives. I find it a bit unintuitive, so I have to read through the documentation every time I use it, but it should be able link a chosen version of python to /usr/ bin/python. I don't know if it's set up by

Re: Emacs Python-mode. Newbie problem.

2009-07-09 Thread Piet van Oostrum
Lacrima lacrima.ma...@gmail.com (L) wrote: L Thanks for your reply! L My file name is 'trains.py'. L When I do C-h k C-c RET, it shows me help from manual: C-c RET runs L the command py-execute-import-or-reload Lwhich is an interactive Lisp function in `python-mode'... and so L on. L And

Re: Pydev 1.4.7 Released

2009-07-09 Thread Fabio Zadrozny
Yes. On Thu, Jul 9, 2009 at 3:32 AM, Morten Nygaard Aasnesmorten.aas...@gmail.com wrote: On 2009-07-08, Fabio Zadrozny fabi...@gmail.com wrote: Hi All, Pydev and Pydev Extensions 1.4.7 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev:

Re: older pythons

2009-07-09 Thread superpollo
Lie Ryan wrote: AFAIK, no major linux distributions have officially ported to python 3.x. http://packages.debian.org/experimental/python3.1 thanks for help -- http://mail.python.org/mailman/listinfo/python-list

Re: PyQt GUI

2009-07-09 Thread Helvin
On Jul 9, 6:27 pm, Helvin helvin...@gmail.com wrote: On Jul 9, 11:29 am, Robert Kern robert.k...@gmail.com wrote: On 2009-07-08 18:10, Helvin wrote: Thanks for the fast replies! I will look into how to use VTK now. Where would I find VTK's explicit support for PyQt?

Re: property using a classmethod

2009-07-09 Thread Bruno Desthuilliers
Emanuele D'Arrigo a écrit : Greetings, today I did something like this: class MyClass(object): @classmethod def myClassMethod(self): ot Usually, the first argument of classmethods is named 'cls' /ot print ham myProperty = property(myClassMethod, None, None) As many

Particle research opens door for new technology

2009-07-09 Thread Rashid Ali Soomro
Big uses for small particles will be explored at the annual Particle Technology Research Centre Conference at The University of Western Ontario July 9 and 10. for more details on http://0nanotechnology0.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: older pythons

2009-07-09 Thread Lie Ryan
superpollo wrote: Lie Ryan wrote: AFAIK, no major linux distributions have officially ported to python 3.x. http://packages.debian.org/experimental/python3.1 thanks for help Note the word experimental -- http://mail.python.org/mailman/listinfo/python-list

Re: python-ldap

2009-07-09 Thread Michael Ströder
Larry kavanagh wrote: I need a PYTHON-LDAP package. I'm trying to install ploneldap and it tells me I need python-ldap package first .. but I can't find one to match my versions. I'm using plone 3.2.2, Python 2.4.4 and Zope 2.10.7 on a Win32 environment. Did you check all the links on

Re: OT: unix to Windows technology

2009-07-09 Thread Xah Lee
a fried showed me this today: http://xahlee.org/funny/Microsoft_eula.html not sure which site originally reported it. Xah ∑ http://xahlee.org/ ☄ -- http://mail.python.org/mailman/listinfo/python-list

Re: older pythons

2009-07-09 Thread superpollo
Lie Ryan wrote: superpollo wrote: Lie Ryan wrote: AFAIK, no major linux distributions have officially ported to python 3.x. http://packages.debian.org/experimental/python3.1 thanks for help Note the word experimental i noticed. isn't experimental official? i thought it was...

Re: older pythons

2009-07-09 Thread Marco Mariani
superpollo wrote: what i was asking for is about a way to *INSTALL* and mantain different python versions, a task i think is not unusal for developers. Check out virtualenv, I ask myself how I could work without it. http://pypi.python.org/pypi/virtualenv --

Re: property using a classmethod

2009-07-09 Thread Lie Ryan
Emanuele D'Arrigo wrote: Greetings, today I did something like this: class MyClass(object): @classmethod def myClassMethod(self): print ham myProperty = property(myClassMethod, None, None) As many of you know this doesn't work and returns a TypeError: the

Hello

2009-07-09 Thread Tanmoy
Hello , When i==0 you append an empty list to arr, so arr[i] is arr[0]. No problem. When i==10 you append another empty list to arr, so arr[i] is arr[10]. Index error because there's no arr[10], only arr[0] and arr[1]. Thanks for your prompt reply... How can i pass this problem

Re: function local namespace question

2009-07-09 Thread Dave Angel
Paul LaFollette wrote: Kind people, Using Python 3.1 under FreeBSD and WinXP. I've been tearing my hair out trying to solve this myself, but I need to ask for help. I want (for obscure reasons) to be able to log transactions in the namespace(s) of a script. Specifically I would like to log

Re: function local namespace question

2009-07-09 Thread Diez B. Roggisch
Dave Angel wrote: Paul LaFollette wrote: Kind people, Using Python 3.1 under FreeBSD and WinXP. I've been tearing my hair out trying to solve this myself, but I need to ask for help. I want (for obscure reasons) to be able to log transactions in the namespace(s) of a script.

Re: property using a classmethod

2009-07-09 Thread Bruno Desthuilliers
Lie Ryan a écrit : Emanuele D'Arrigo wrote: (snip) Ultimately all I want is a non-callable class-level attribute MyClass.myProperty that gives the result of MyClass.myClassMethod(). This works like what you seem to want (it's ugly): Ugly, indeed. And an extreme case of arbitrary

Re: older pythons

2009-07-09 Thread superpollo
Marco Mariani wrote: superpollo wrote: what i was asking for is about a way to *INSTALL* and mantain different python versions, a task i think is not unusal for developers. Check out virtualenv, I ask myself how I could work without it. http://pypi.python.org/pypi/virtualenv much

Re: Catching control-C

2009-07-09 Thread Lie Ryan
Michael Mossey wrote: On Jul 6, 2:47 pm, Philip Semanchuk phi...@semanchuk.com wrote: On Jul 6, 2009, at 5:37 PM, Michael Mossey wrote: What is required in a python program to make sure it catches a control- c on the command-line? Do some i/o? The OS here is Linux. You can use a

Re: Hello

2009-07-09 Thread MRAB
Tanmoy wrote: Hello , When i==0 you append an empty list to arr, so arr[i] is arr[0]. No problem. When i==10 you append another empty list to arr, so arr[i] is arr[10]. Index error because there's no arr[10], only arr[0] and arr[1]. Thanks for your

Re: tough-to-explain Python

2009-07-09 Thread Dave Angel
greg wrote: div class=moz-text-flowed style=font-family: -moz-fixedDave Angel wrote: By the time I graduated, I had five six-level languages ^^^ Are they languages that you have to edit using vi? :-) Back then I didn't need glasses. That was of course

Re: Emacs Python-mode. Newbie problem.

2009-07-09 Thread Lacrima
On Jul 9, 2:31 pm, Piet van Oostrum p...@cs.uu.nl wrote: Lacrima lacrima.ma...@gmail.com (L) wrote: L Thanks for your reply! L My file name is 'trains.py'. L When I do C-h k C-c RET, it shows me help from manual: C-c RET runs L the command py-execute-import-or-reload L    which is an

Re: can i write a assemly language programs in python

2009-07-09 Thread Dave Angel
m.reddy prasad reddy wrote: can any one tell me how to write assembly language programs in python...if no is there any other way to write the programs in python Reddi prasad reddy ph.no:09958083797 Assembly language is a different programming language than Python. You can use both in the

gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Nick
I've seen a lot of posts on this problem, but none seems to help. Here is the code: /code file = open(prefix1) text = file.readlines() len = len(text) fields = text[1].split() num_rows = int(fields[1]) num_cols = int(fields[2]) U1_matrix = [] print fields print repr(fields) print len(fields)

Re: tough-to-explain Python

2009-07-09 Thread Benjamin Kaplan
On Thu, Jul 9, 2009 at 1:05 AM, Simon Formansajmik...@gmail.com wrote: Everyone gets so caught up in programming via languages that you get, well, people trying to teach Computer Programming as if it were only necessary to grok a language, rather than grokking /symbol manipulation/ itself.

Blocking XMPP API?

2009-07-09 Thread Gabriel Rossetti
Hello everyone, I am looking for blocking XMPP API. I'm wanting to make a webservice that uses XMPP, but all the XMPP libs I find are non-blocking (i.e. w/ callbacks). I'd like to be able to do something like : cl = Client(t...@domain.com/res01, password,) msg = m. result = cl.send(msg)

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Lutz Horn
Hi, Nick schrieb: I've seen a lot of posts on this problem, but none seems to help. Could you please post a sample input file and the exact error message? Thanks Lutz -- Strike Out ⇒ http://www.fourmilab.ch/documents/strikeout -- http://mail.python.org/mailman/listinfo/python-list

Re: older pythons

2009-07-09 Thread Benjamin Kaplan
On Thu, Jul 9, 2009 at 8:10 AM, Lie Ryanlie.1...@gmail.com wrote: superpollo wrote: Lie Ryan wrote: AFAIK, no major linux distributions have officially ported to python 3.x. http://packages.debian.org/experimental/python3.1 thanks for help Note the word experimental Assuming that

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Friðrik Már Jónsson
Look at: len = len(text) You're overriding `len` (a built-in method), with an integer (`len(text)`). You then call: for i in range(len(fields)): But `len` is no longer a callable, but merely an integer. Regards, Friðrik Már P.S. While this is a fairly obvious problem it's usually a

Re: Check file is locked?

2009-07-09 Thread Gabriel Genellina
En Thu, 09 Jul 2009 07:53:29 -0300, Rajat rajat.dud...@gmail.com escribió: Thanks Tim for the details. Just further on this, my whole idea is to close the wordpad / notepad application so that I can delete the file and the directory where this file resides. With notepad it is no more a

Re: Hello

2009-07-09 Thread Dave Angel
You could pick a much better title. And apparently you started a new thread with this one. When responding to an existing message, you ought to reply-all to the existing message, rather than starting a new thread. Tanmoy wrote: Hello , When i==0 you append an empty list to arr, so

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Richard Brodie
Nick nleio...@gmail.com wrote in message news:e54c4461-c0b7-42fb-8542-cefd7bf5f...@h18g2000yqj.googlegroups.com... file = open(prefix1) text = file.readlines() len = len(text) You have redefined two built-in functions file and len in the first three lines. This is usually considered poor

Re: a little wsgi framework

2009-07-09 Thread timmyt
On Jul 7, 5:19 am, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: timmyt a écrit : i'm interested in getting opinions on a smallwsgiframework i assembled from webob, sqlalchemy, genshi, and various code fragments i found on the inter-tubes here is the interesting

Problem with two instances of PySerial

2009-07-09 Thread Shine Jose
Hello friends,I am developing an application to read data from serial port and display it on the screen using GUI developed in pyQT. For this I have instantiated the GUI as well as pySerial objects in the main thread. I have provided a button 'Read' which when clicked by the user reads from the

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Nick
On Jul 9, 10:02 am, Richard Brodie r.bro...@rl.ac.uk wrote: Nick nleio...@gmail.com wrote in message news:e54c4461-c0b7-42fb-8542-cefd7bf5f...@h18g2000yqj.googlegroups.com... file = open(prefix1) text = file.readlines() len = len(text) You have redefined two built-in functions file and

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Bruno Desthuilliers
Nick a écrit : I've seen a lot of posts on this problem, but none seems to help. Here is the code: /code file = open(prefix1) shadows the builtin 'file' type. text = file.readlines() len = len(text) shadows the builtin 'len' function. fields = text[1].split() num_rows = int(fields[1])

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Dave Angel
Nick wrote: I've seen a lot of posts on this problem, but none seems to help. Here is the code: /code file = open(prefix1) text = file.readlines() len = len(text) fields = text[1].split() num_rows = int(fields[1]) num_cols = int(fields[2]) U1_matrix = [] print fields print repr(fields) print

Re: count

2009-07-09 Thread J. Cliff Dyer
Bearophile wins! (This only times the loop itself. It doesn't check for __len__) summer:5 0:00:00.51 bearophile:5 0:00:00.09 summer:50 0:00:00.30 bearophile:50 0:00:00.13 summer:500 0:00:00.77 bearophile:500 0:00:00.53 summer:5000 0:00:00.000575 bearophile:5000

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Friðrik Már Jónsson
Previously, I wrote: P.S. While this is a fairly obvious problem it's usually a good idea to post working code and a traceback when requesting help. Nick wrote: thanks for spotting the obvious errors, its my 2nd day programming python in about 3 years. I'm sorry, my saying it was obvious

Re: PyQt GUI

2009-07-09 Thread Robert Kern
On 2009-07-09 01:27, Helvin wrote: On Jul 9, 11:29 am, Robert Kernrobert.k...@gmail.com wrote: On 2009-07-08 18:10, Helvin wrote: Thanks for the fast replies! I will look into how to use VTK now. Where would I find VTK's explicit support for PyQt? Wrapping/Python/vtk/qt4/ in the VTK

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Nick
no problem, i understand, i haven't coded anything in literally 2 years, but it was a simple and pretty obvious mistake. thanks for all your help, nick On Jul 9, 11:30 am, Friðrik Már Jónsson frid...@pyth.net wrote: Previously, I wrote: P.S. While this is a fairly obvious problem it's

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Tom Kermode
Hi, Do you know a good way to avoid running into this problem? It makes sense to suggest not calling variables the same names as built-in functions, but that's hard for a new python programmer who doesn't already know what all the built-in functions are. Over time a programmer will learn

Re: tkinter problem

2009-07-09 Thread Paul Simon
Peter Otten __pete...@web.de wrote in message news:h3481q$d95$0...@news.t-online.com... Paul Simon wrote: Chris Rebert c...@rebertia.com wrote in message news:mailman.2863.1247095339.8015.python-l...@python.org... On Wed, Jul 8, 2009 at 4:18 PM, Paul Simonpsi...@sonic.net wrote: I have the

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Richard Brodie
Tom Kermode tkerm...@gmail.com wrote in message news:mailman.2903.1247155607.8015.python-l...@python.org... Do you know a good way to avoid running into this problem? It makes sense to suggest not calling variables the same names as built-in functions, but that's hard for a new python

send keys to focused window

2009-07-09 Thread Broken
Hi, I am new to Python, and I'm miserably failing to send specific keys to (say) notepad. Here is the scenario: I have notepad open. My python script is running in the background. When I press ALT+a I want to intercept the keys and send ä(ASCII code: ALT+0228) instead. OS: Windows 7 Libraries

Running a script to build docs from setup.py

2009-07-09 Thread Tony Houghton
I want to write a setup.py script, using distutils, for a python library called ROX-Lib2 (package name rox). The library includes a script to build HTML documentation from the pydoc strings. I'd like to run that script from setup.py but I don't know the best way to do that. I've looked through the

Re: gett error message: TypeError: 'int' object is not callable

2009-07-09 Thread Friðrik Már Jónsson
Tom Kermode wrote: Do you know a good way to avoid running into this problem? It makes sense to suggest not calling variables the same names as built-in functions, but that's hard for a new python programmer who doesn't already know what all the built-in functions are. One way is using a code

Re: tkinter problem

2009-07-09 Thread Peter Otten
Paul Simon wrote: Peter Otten __pete...@web.de wrote in message news:h3481q$d95$0...@news.t-online.com... Paul Simon wrote: Chris Rebert c...@rebertia.com wrote in message news:mailman.2863.1247095339.8015.python-l...@python.org... On Wed, Jul 8, 2009 at 4:18 PM, Paul

Examples of Python driven Microsoft UI Automation wanted

2009-07-09 Thread TheSeeker
Hi, I am embarking on teaching myself Microsoft UI Automation using Python as the scripting language. I have asked some questions in the IronPython users group, but have yet to get a response, so I thought I would broaden the audience by asking here. Specifically, I have a WinForms application

Re: Opening a SQLite database in readonly mode

2009-07-09 Thread Joshua Kugler
Joshua Kugler wrote: Sorry about that...since pysqlite and APSW are both discusses on the pysqlite list, I had made an incorrect assumption. Oops. are both discusses? Yeef, I must have been out of it. Discussed, thank you. :) j -- http://mail.python.org/mailman/listinfo/python-list

Re: tough-to-explain Python

2009-07-09 Thread Steven D'Aprano
On Wed, 08 Jul 2009 22:05:57 -0700, Simon Forman wrote: The core abstractions of [mechanical] computation are just not that complicated. You can teach them to anybody in about a half an hour, drunk. I have. That's *easy*. Anyone can teach the most complicated and abstract principles of any

Re: Examples of Python driven Microsoft UI Automation wanted

2009-07-09 Thread Tim Harig
On 2009-07-09, TheSeeker duane.kauf...@gmail.com wrote: Specifically, I have a WinForms application I will be wanting to automate. Does anyone have some Python examples of driving Microsoft UI Automation they could share with me to get me started? The structure of the UI automation classes

Re: Cleaning up after failing to contructing objects

2009-07-09 Thread Lie Ryan
brasse wrote: Hello! I have been thinking about how write exception safe constructors in Python. By exception safe I mean a constructor that does not leak resources when an exception is raised within it. The following is an example of one possible way to do it: First, your automatic cleaning

Concatenating images (numpy arrays), but they look like HSV images

2009-07-09 Thread Sebastian Schabe
Hello everybody, I want to concatenate 2 numpy array which in fact are RGB images: def concat_images(im1,im2): rows1 = im1.shape[0] rows2 = im2.shape[0] if rows1 rows2: im1 = concatenate((im1,zeros((rows2-rows1,im1.shape[1],3), int)), axis=0) elif rows1 rows2: im2 =

Re: property using a classmethod

2009-07-09 Thread Scott David Daniels
Emanuele D'Arrigo wrote: class MyClass(object): @classmethod def myClassMethod(self): print ham myProperty = property(myClassMethod, None, None) ... doesn't work and returns a TypeError: So, how do I do this? Ultimately all I want is a non-callable class-level

Re: property using a classmethod

2009-07-09 Thread Lie Ryan
Bruno Desthuilliers wrote: Lie Ryan a écrit : Emanuele D'Arrigo wrote: (snip) Ultimately all I want is a non-callable class-level attribute MyClass.myProperty that gives the result of MyClass.myClassMethod(). This works like what you seem to want (it's ugly): Ugly, indeed. And an extreme

Re: Examples of Python driven Microsoft UI Automation wanted

2009-07-09 Thread DuaneKaufman
On Jul 9, 12:18 pm, Tim Harig user...@ilthio.net wrote: On 2009-07-09, TheSeeker duane.kauf...@gmail.com wrote: Specifically, I have a WinForms application I will be wanting to automate. Does anyone have some Python examples of driving Microsoft UI Automation they could share with me to

  1   2   3   >