Python North-West meeting - 6 november 18.30

2007-10-29 Thread Giacomo Lacava
New meeting of the Python North-West UK community! This month's talk is: - Michael Sparks on Greylisting with Kamaelia - dramatic spam reduction with a few lines of Python. After the talk, you'll be able to showcase your cool python stuff, get tips from others, have a chat with fellow-minded

ANN: Veusz 1.0 - a scientific plotting package

2007-10-29 Thread Jeremy Sanders
I'm pleased to announce Veusz 1.0. Source, windows and linux i386 binaries are available - Jeremy Sanders Veusz 1.0 - Velvet Ember Under Sky Zenith - http://home.gna.org/veusz/ Veusz is Copyright (C) 2003-2007 Jeremy Sanders [EMAIL PROTECTED] Licenced under

Elixir 0.4.0 released!

2007-10-29 Thread Gaetan de Menten
I am very pleased to announce that version 0.4.0 of Elixir is now available. As always, feedback is very welcome, preferably on Elixir mailing list. Highlights for this release - - Implemented a new attribute-based syntax to declare fields and relationships,

Python-URL! - weekly Python news and links (Oct 29)

2007-10-29 Thread Gabriel Genellina
QOTW: Template engines are amongst the things that seem easy enough to look at the available software and say 'bah, I'll write my own in a day', but are complex enough to keep them growing over years until they become as huge and inaccessible as all the other implementations. Then it's time for

ANN: Learning Python 3rd Edition

2007-10-29 Thread lutz
I'm pleased to announce the release of the 3rd Edition of the book Learning Python. This new edition has been updated to cover Python 2.5, and includes numerous pointers for migrating to Python 3.0 in the future. Among other things, this edition has been augmented with material on function

lxml 1.3.6 released

2007-10-29 Thread Stefan Behnel
Hi all, lxml 1.3.6 is up on PyPI. This is a bug fix release for the stable 1.3 series. It features two important fixes for crash bugs. Updating is recommended. http://codespeak.net/lxml/ http://pypi.python.org/pypi/lxml/ ** Install it with $ easy_install lxml==1.3.6 ** What is lxml?

A class question

2007-10-29 Thread Donn Ingle
Hello, Is there a way I can, for debugging, access the instance variable name from within a class? E.g: Class X: def debug(self): print My instance var is %s % (some magic Python stuff) So that: x = X() x.debug() My Instance var is x ( Without passing the name in like: x=X(name=x) ) Thx.

Re: cron, python and samba restart

2007-10-29 Thread Nick Craig-Wood
symbioid [EMAIL PROTECTED] wrote: Is there something in the way I'm calling with the subprocess.call() function that's not able to work through cron? My concern is that I'm using sudo, and that may be where the problem lies. http://www.gratisoft.us/pipermail/sudo-users/2005-May/002518.html

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Donn Ingle a écrit : Hello, Is there a way I can, for debugging, access the instance variable name from within a class? E.g: Class X: def debug(self): print My instance var is %s % (some magic Python stuff) So that: x = X() x.debug() My Instance var is x ( Without passing the

Re: sharing vars with different functions

2007-10-29 Thread Marc 'BlackJack' Rintsch
On Mon, 29 Oct 2007 09:03:14 +, [EMAIL PROTECTED] wrote: Im tryin to call a var thats sitting in a function, example: class someclass(object): somevar = open(blah, 'r').readlines() Thats a class variable. Is that really what you want!? def something(): for line in

sharing vars with different functions

2007-10-29 Thread [EMAIL PROTECTED]
Im tryin to call a var thats sitting in a function, example: class someclass(object): somevar = open(blah, 'r').readlines() def something(): for line in somevar: print line --- i guess im not

Re: Need some help...

2007-10-29 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : I want to create a program that I type in a word. for example... chaos each letter equals a number A=1 B=20 and so on. So Chaos would be C=13 H=4 A=1 O=7 S=5 I want to then have those numbers 13+4+1+7+5 added together to be 30. How can

Re: SQLObject - Connect to established DB with non-int 'id' field

2007-10-29 Thread Pradeep Jindal
On Saturday 20 Oct 2007 5:43:48 am Sean DiZazzo wrote: Hi all, I am just beginning with TurboGears and have run into a problem with SQLObject. I'm trying to connect to an established mysql DB, and use TurboGears to display results from the DB only. The problem is that the DB already has

Re: Python Windows Installation

2007-10-29 Thread TheFlyingDutchman
I finally gave up trying to install to c:\Python25 and went with the install to C:\. However, I tried to install a module called pywin32 (Python for Windows Extensions) and after recognizing that the Python installation was in C:\ and saying it would install to C:\LIB\SITE- PACKAGES, it would

ANN: Veusz 1.0 - a scientific plotting package

2007-10-29 Thread Jeremy Sanders
I'm pleased to announce Veusz 1.0. Source, windows and linux i386 binaries are available. Jeremy Sanders Veusz 1.0 - Velvet Ember Under Sky Zenith - http://home.gna.org/veusz/ Veusz is Copyright (C) 2003-2007 Jeremy Sanders [EMAIL PROTECTED] Licenced under the

sorting data

2007-10-29 Thread Beema shafreen
hi all, I have problem to sort the data.. the file includes data as follow. file: chrX:123343123123343182A_16_P41787782 chrX:123343417123343476A_16_P03762840 chrX:123343460123343519A_16_P41787783 chrX:1233433612334395A_16_P03655927 chrX:

Re: A class question

2007-10-29 Thread Carl Banks
On Oct 28, 6:01 am, Donn Ingle [EMAIL PROTECTED] wrote: Hello, Is there a way I can, for debugging, access the instance variable name from within a class? E.g: Class X: def debug(self): print My instance var is %s % (some magic Python stuff) So that: x = X() x.debug() My Instance

Re: ANN: Veusz 1.0 - a scientific plotting package

2007-10-29 Thread Wildemar Wildenburger
Jeremy Sanders wrote: I'm pleased to announce Veusz 1.0. Source, windows and linux i386 binaries are available. Jeremy Sanders [snip] Veusz is a scientific plotting package written in Python, using PyQt4 for display and user-interfaces, and numpy for handling the numeric data. Veusz is

Re: sharing vars with different functions

2007-10-29 Thread Martin Marcher
I hate gmail, always forgetting to set the right recipient... -- Forwarded message -- From: Martin Marcher [EMAIL PROTECTED] Date: 29.10.2007 10:11 Subject: Re: sharing vars with different functions To: [EMAIL PROTECTED] [EMAIL PROTECTED] 2007/10/29, [EMAIL PROTECTED] [EMAIL

Re: urllib2 weirdness when https_proxy environment variable is exported

2007-10-29 Thread Devraj
Hi John, Thanks for that. Do you have any web urls that I can see an example of the hack? On Oct 28, 3:50 am, [EMAIL PROTECTED] (John J. Lee) wrote: Devraj [EMAIL PROTECTED] writes: I have been extensively using Python's urllib2 while developing a project with the Google Data API. The

Re: A class question

2007-10-29 Thread Hrvoje Niksic
Donn Ingle [EMAIL PROTECTED] writes: Is there a way I can, for debugging, access the instance variable name from within a class? E.g: Class X: def debug(self): print My instance var is %s % (some magic Python stuff) As others have answered, an instance can live in many variables, so

Using msvcrt (in Windows), how to catch Enter key?

2007-10-29 Thread Dick Moores
Windows XP Pro, Python 2.5.1 import msvcrt while True: if msvcrt.kbhit(): key = msvcrt.getch() if key == 'Enter' do something Is there a way to catch the pressing of the 'Enter' key? Thanks, Dick Moores -- http://mail.python.org/mailman/listinfo/python-list

problem opening html file with webbrowser.open

2007-10-29 Thread krishnakant Mane
hello all, as I posted in my previous thread, I am generating html reports for my client software. I am yet to find a satisfactory module which can help me actually create headings, bold and italics etc without merging html with data variables. any ways I am right now doing the hamd coding myself.

Re: ANN: Veusz 1.0 - a scientific plotting package

2007-10-29 Thread Jeremy Sanders
Wildemar Wildenburger wrote: Not that I don't value your effort, but why another plotting package while we have pyx and matplotlib already? In addition to the Python based scripting command line and embedding interface, it has a powerful graphical user interface for constructing plots and

Re: ANN: Veusz 1.0 - a scientific plotting package

2007-10-29 Thread Wildemar Wildenburger
Jeremy Sanders wrote: Wildemar Wildenburger wrote: Not that I don't value your effort, but why another plotting package while we have pyx and matplotlib already? In addition to the Python based scripting command line and embedding interface, it has a powerful graphical user interface for

Re: building a linux executable

2007-10-29 Thread BlueBird
Hi, Some time ago, I compiled a small list of tools to perform the some python executable bundling tasks. It might be useful for you. Here is the list: http://www.freehackers.org/Packaging_a_python_program Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: problem opening html file with webbrowser.open

2007-10-29 Thread Stefan Behnel
krishnakant Mane wrote: as I posted in my previous thread, I am generating html reports for my client software. I am yet to find a satisfactory module which can help me actually create headings, bold and italics etc without merging html with data variables. Maybe this is something for you:

Re: problem opening html file with webbrowser.open

2007-10-29 Thread Paul Boddie
On 29 Okt, 11:44, krishnakant Mane [EMAIL PROTECTED] wrote: hello all, as I posted in my previous thread, I am generating html reports for my client software. I am yet to find a satisfactory module which can help me actually create headings, bold and italics etc without merging html with data

Re: ANN: Veusz 1.0 - a scientific plotting package

2007-10-29 Thread Jeremy Sanders
Wildemar Wildenburger wrote: Oh, OK. I though it was a library. I now see that it is an actual application. Sorry to have bothered you :) It's a library too :-) -- Jeremy Sanders http://www.jeremysanders.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Using msvcrt (in Windows), how to catch Enter key?

2007-10-29 Thread Filip Wasilewski
On Oct 29, 11:26 am, Dick Moores [EMAIL PROTECTED] wrote: Windows XP Pro, Python 2.5.1 import msvcrt while True: if msvcrt.kbhit(): key = msvcrt.getch() if key == 'Enter' do something Is there a way to catch the pressing of the 'Enter' key? Yes there is.

Re: A class question

2007-10-29 Thread Martin Marcher
2007/10/29, Hrvoje Niksic [EMAIL PROTECTED]: Sbe unpx inyhr, urer vf n cbffvoyr vzcyrzragngvba: ... was that on purpose? martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list

Re: Using msvcrt (in Windows), how to catch Enter key?

2007-10-29 Thread Dustan
On Oct 29, 4:26 am, Dick Moores [EMAIL PROTECTED] wrote: Windows XP Pro, Python 2.5.1 import msvcrt while True: if msvcrt.kbhit(): key = msvcrt.getch() if key == 'Enter' do something Is there a way to catch the pressing of the 'Enter' key? Thanks, Dick

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : Donn Ingle [EMAIL PROTECTED] writes: Is there a way I can, for debugging, access the instance variable name from within a class? E.g: Class X: def debug(self): print My instance var is %s % (some magic Python stuff) As others have answered, an instance can

Re: sharing vars with different functions

2007-10-29 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Im tryin to call s/call/access/ a var thats sitting s/sitting/defined/ in a function, example: In this example, s/function/class/ class someclass(object): pep08 : should be SomeClass(object): somevar = open(blah, 'r').readlines() Doing IO in the

SQLite3; weird error

2007-10-29 Thread TYR
Has anyone else experienced a weird SQLite3 problem? Going by the documentation at docs.python.org, the syntax is as follows: foo = sqlite3.connect(dbname) creates a connection object representing the state of dbname and assigns it to variable foo. If dbname doesn't exist, a file of that name is

Re: A class question

2007-10-29 Thread Hrvoje Niksic
Bruno Desthuilliers [EMAIL PROTECTED] writes: As others have answered, an instance can live in many variables, be bound to many names would be more accurate IMHO. Technically more accurate maybe (but see below), but I was responding to a beginner's post, so I was striving for ease of

Re: Using msvcrt (in Windows), how to catch Enter key?

2007-10-29 Thread Dick Moores
At 04:29 AM 10/29/2007, Filip Wasilewski wrote: On Oct 29, 11:26 am, Dick Moores [EMAIL PROTECTED] wrote: Windows XP Pro, Python 2.5.1 import msvcrt while True: if msvcrt.kbhit(): key = msvcrt.getch() if key == 'Enter' do something Is there a way

Re: Which index can i use ?

2007-10-29 Thread Gerardo Herzig
Abandoned wrote: Hi.. I want to do index in postgresql python. My table: id(int) | id2(int) | w(int) | d(int) My query: select id, w where id=x and id2=y (sometimes and d=z) I have too many insert and select operation on this table. And which index type can i use ? Btree, Rtree, Gist or Hash ?

Re: Yet another comparison of Python Web Frameworks

2007-10-29 Thread Bruno Desthuilliers
johnbraduk a écrit : Thomas, Like many others I have been going round the same loop for months. I have struggled with most of the Python solutions, including TurboGears and have given up and gone back to ColdFusion. I am not trying to kick of a religious war about the pros and cons of

Re: Capturing output with input

2007-10-29 Thread gopala
On Oct 29, 9:03 am, Gabriel Genellina [EMAIL PROTECTED] wrote: On Linux, use the script command. On Windows, select the region to copy using the mouse and paste it onto a notepad file. I don't think Python would help here. Thanks :-) Now i just do os.system(exeFile) and i can easily copy

Re: SQLite3; weird error

2007-10-29 Thread Duncan Booth
TYR [EMAIL PROTECTED] wrote: To do anything with it, you then need to create a cursor object by calling foo's method cursor (bar = foo.cursor). Perhaps this would work better if you actually try calling foo's method? bar = foo.cursor() Without the parentheses all you are doing is

Re: SQLite3; weird error

2007-10-29 Thread Diez B. Roggisch
TYR wrote: Has anyone else experienced a weird SQLite3 problem? Going by the documentation at docs.python.org, the syntax is as follows: foo = sqlite3.connect(dbname) creates a connection object representing the state of dbname and assigns it to variable foo. If dbname doesn't exist, a

Re: problem opening html file with webbrowser.open

2007-10-29 Thread Jake McKnight
Maybe your browser is not in the executable path? Try passing the PATH environment variable to the Python interpreter and make sure it contains the directory where your browser is installed. Clearly the browser is in the path, because it opens. It just fails to open the file supplied by the

Re: Help with pyparsing and dealing with null values

2007-10-29 Thread Paul McGuire
On Oct 29, 1:11 am, avidfan [EMAIL PROTECTED] wrote: Help with pyparsing and dealing with null values I am trying to parse a log file (web.out) similar to this: --- MBeanName: mtg-model:Name=mtg-model_managed2,Type=Server

Re: IEC - cannot find button

2007-10-29 Thread kyosohma
On Oct 29, 12:58 am, [EMAIL PROTECTED] wrote: I'm brand new to Python--and programming in general. I'm trying to use IEC to control Internet Explorer. I've navigated to a page, and now I'm trying to click a button. The button appears to be called 'PDF Preview' but I honestly do not know

Re: SQLite3; weird error

2007-10-29 Thread TYR
On Oct 29, 11:51 am, Duncan Booth [EMAIL PROTECTED] wrote: TYR [EMAIL PROTECTED] wrote: To do anything with it, you then need to create a cursor object by calling foo's method cursor (bar = foo.cursor). Perhaps this would work better if you actually try calling foo's method? bar =

Re: Pari Python

2007-10-29 Thread Anton Mellit
Hi, thanks for the comments. I think I should target on making my module as a normal python module without using any modifications and additionally (only additionally) provide some optional workaround for the '^' and '/' problem. I am going to look at what Michael proposed With that in mind, why

Built-in functions and keyword arguments

2007-10-29 Thread Armando Serrano Lombillo
Why does Python give an error when I try to do this: len(object=[1,2]) Traceback (most recent call last): File pyshell#40, line 1, in module len(object=[1,2]) TypeError: len() takes no keyword arguments but not when I use a normal function: def my_len(object): return len(object)

Python-URL! - weekly Python news and links (Oct 29)

2007-10-29 Thread Gabriel Genellina
QOTW: Template engines are amongst the things that seem easy enough to look at the available software and say 'bah, I'll write my own in a day', but are complex enough to keep them growing over years until they become as huge and inaccessible as all the other implementations. Then it's time for

Re: Built-in functions and keyword arguments

2007-10-29 Thread Duncan Booth
Armando Serrano Lombillo [EMAIL PROTECTED] wrote: Why does Python give an error when I try to do this: len(object=[1,2]) Traceback (most recent call last): File pyshell#40, line 1, in module len(object=[1,2]) TypeError: len() takes no keyword arguments but not when I use a normal

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: As others have answered, an instance can live in many variables, be bound to many names would be more accurate IMHO. Technically more accurate maybe (but see below), but I was responding to a beginner's post, so I was

Re: Built-in functions and keyword arguments

2007-10-29 Thread Bruno Desthuilliers
Armando Serrano Lombillo a écrit : Why does Python give an error when I try to do this: len(object=[1,2]) Traceback (most recent call last): File pyshell#40, line 1, in module len(object=[1,2]) TypeError: len() takes no keyword arguments but not when I use a normal function:

Re: A class question

2007-10-29 Thread emorfo
On Oct 29, 12:46 pm, Martin Marcher [EMAIL PROTECTED] wrote: 2007/10/29, Hrvoje Niksic [EMAIL PROTECTED]: Sbe unpx inyhr, urer vf n cbffvoyr vzcyrzragngvba: ... was that on purpose? martin --http://noneisyours.marcher.namehttp://feeds.feedburner.com/NoneIsYours for humans: For hack

Re: Built-in functions and keyword arguments

2007-10-29 Thread Steven D'Aprano
On Mon, 29 Oct 2007 13:52:04 +, Armando Serrano Lombillo wrote: Why does Python give an error when I try to do this: len(object=[1,2]) Traceback (most recent call last): File pyshell#40, line 1, in module len(object=[1,2]) TypeError: len() takes no keyword arguments but not

Re: while within while

2007-10-29 Thread Steven D'Aprano
On Sun, 28 Oct 2007 21:02:02 -0400, Shawn Minisall wrote: Thanks a lot for your suggestions. Unfortunately, a lot of the issues brought up were simply the way I was taught by my professor and the way she wants things done,having to use a numbered menu as opposed to entering r, p or s, being

Re: Built-in functions and keyword arguments

2007-10-29 Thread Duncan Booth
Bruno Desthuilliers [EMAIL PROTECTED] wrote: In the second case, the name of the argument *is* 'object'. Which is not the case for the builtin len (which, fwiw, has type 'builtin_function_or_method', not 'function', so inspect.getargspec couldn't tell me more). ot While we're at it,

Re: New

2007-10-29 Thread Shawn Milochik
On 10/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi! Am new to Python and am looking for a sample project that demonstrates how to connect to MySQL, save data in MySQL database using a form on a web page. Regards, Joseph -- http://mail.python.org/mailman/listinfo/python-list 1.

Re: Built-in functions and keyword arguments

2007-10-29 Thread Tim Chase
ot While we're at it, you should avoid using builtin's names for identifiers - here, using 'object' as the arg name shadows the builtin 'object' class). /ot I think you are being a little bit unfair here: help(len) says: len(...) len(object) - integer Return the number

Handle Exceptions Inside List Comprehension

2007-10-29 Thread beginner
Hi All, I am wondering if there is any way to handle exceptions inside list comprehension. For example, [f(x) for x in xs] I want to skip the point if f(x) raises an exception. How can I do that without totally removing the list comprehension? Thanks, Geoffrey --

Re: A class question

2007-10-29 Thread Hrvoje Niksic
Bruno Desthuilliers [EMAIL PROTECTED] writes: The problem is that your formulation implies (to me at least) that the variable is actually a kind of container for the object. I really didn't expect it to be read that way, especially since the sentence claims that the same instance can reside in

Re: Handle Exceptions Inside List Comprehension

2007-10-29 Thread Paul Rubin
beginner [EMAIL PROTECTED] writes: [f(x) for x in xs] I want to skip the point if f(x) raises an exception. How can I do that without totally removing the list comprehension? def ff(xs): for x in xs: try: yield f(x) except: pass [x for x in ff(xs)] or alternatively

Re: while within while

2007-10-29 Thread kyosohma
On Oct 29, 9:26 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 28 Oct 2007 21:02:02 -0400, Shawn Minisall wrote: Thanks a lot for your suggestions. Unfortunately, a lot of the issues brought up were simply the way I was taught by my professor and the way she wants

two file into a single file

2007-10-29 Thread Beema shafreen
hi everybody, I have a two file, file 1: 17097 17186 1723 17895 17906 18295 18311 1880 19160 19629 file 2: 17097 17186 1723 17895 17906 18295 18311 1880 19160 19629 how do i make into a single

what version python and wxPython comes with Mac OS X Leopard

2007-10-29 Thread chewie54
Hello, Anyone using Leopard know which versions of Python and wxPython and any other Python related modules are default with the new OS? Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Built-in functions and keyword arguments

2007-10-29 Thread Armando Serrano Lombillo
On Oct 29, 3:10 pm, Duncan Booth [EMAIL PROTECTED] wrote: Armando Serrano Lombillo [EMAIL PROTECTED] wrote: Why does Python give an error when I try to do this: len(object=[1,2]) Traceback (most recent call last): File pyshell#40, line 1, in module len(object=[1,2])

Re: two file into a single file

2007-10-29 Thread J. Clifford Dyer
You will need to use the open() builtin for each input file, and again for the output file. Documentation is available in the python tutorial here: http://docs.python.org/tut/node9.html#SECTION00920 You should read also the whole tutorial, and work with it until you understand

simple try/except question

2007-10-29 Thread Alan Isaac
Is the behavior below expected? If so, why is the exception not caught? Thanks, Alan Isaac x,y='','' try: x/y ... except TypeError: print 'oops' ... Traceback (most recent call last): File stdin, line 1, in module TypeError: unsupported operand type(s) for /: 'str' and 'str' --

Re: Built-in functions and keyword arguments

2007-10-29 Thread Armando Serrano Lombillo
On Oct 29, 3:20 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Armando Serrano Lombillo a écrit : Why does Python give an error when I try to do this: len(object=[1,2]) Traceback (most recent call last): File pyshell#40, line 1, in module len(object=[1,2]) TypeError:

Re: two file into a single file

2007-10-29 Thread Tim Chase
I have a two file, file 1: 17097 17186 1723 17895 17906 18295 18311 1880 19160 19629 file 2: 17097 17186 1723 17895 17906 18295 18311 1880 19160 19629 how do i make into a

swig-python - shared (vs) static libraries

2007-10-29 Thread abarun22
HI I am new to SWIG Python and right now i am in the process of wrapping some C functionalities present in a static library for python. I do have my C file name.c which just contains some helper functions. I tried to link my object files (e.g name.o name_wrap.o) with the static libraries (whose

Re: Built-in functions and keyword arguments

2007-10-29 Thread Marc 'BlackJack' Rintsch
On Mon, 29 Oct 2007 08:34:58 -0700, Armando Serrano Lombillo wrote: On Oct 29, 3:10 pm, Duncan Booth [EMAIL PROTECTED] wrote: I don't know if the reason that most builtin functions don't accept keywords is just historical (someone would have to go through a lot of code and add keyword

Re: while within while

2007-10-29 Thread cokofreedom
On Oct 29, 4:28 pm, [EMAIL PROTECTED] wrote: On Oct 29, 9:26 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 28 Oct 2007 21:02:02 -0400, Shawn Minisall wrote: Thanks a lot for your suggestions. Unfortunately, a lot of the issues brought up were simply the way

Re: simple try/except question

2007-10-29 Thread Tim Chase
Is the behavior below expected? If so, why is the exception not caught? Thanks, Alan Isaac x,y='','' try: x/y ... except TypeError: print 'oops' ... Traceback (most recent call last): File stdin, line 1, in module TypeError: unsupported operand type(s) for /: 'str' and 'str' A typo

Re: IEC - cannot find button

2007-10-29 Thread daniel
On Oct 29, 6:04 am, [EMAIL PROTECTED] wrote: On Oct 29, 12:58 am, [EMAIL PROTECTED] wrote: I'm brand new to Python--and programming in general. I'm trying to use IEC to control Internet Explorer. I've navigated to a page, and now I'm trying to click a button. The button appears to be

Re: simple try/except question

2007-10-29 Thread Gabriel Genellina
On 29 oct, 12:46, Alan Isaac [EMAIL PROTECTED] wrote: Is the behavior below expected? If so, why is the exception not caught? Thanks, Alan Isaac x,y='','' try: x/y ... except TypeError: print 'oops' ... Traceback (most recent call last): File stdin, line 1, in module TypeError:

Re: simple try/except question

2007-10-29 Thread Alan Isaac
Tim Chase wrote: It works for me(tm)... Python 2.4.3 Sorry to have left out that detail. Yes, it works for me in Python 2.4, but not in 2.5.1. The code I posted was copyied from the interpreter. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Solaris 10 + Sun Studio 12 Pyrhon 2.4.4 64-bit build problem

2007-10-29 Thread MrJean1
Maybe this helps. Using ./configure --without-gcc in Python 2.5.1 on Solaris 10 gives a different message. That message indicates that C++ compiler 'c++' will be used but the Studio C++ compiler on Solaris is 'CC'. Using ./configure --without-gcc --with-cxx-main=CC made that message

interesting threading result..

2007-10-29 Thread Abandoned
Hi.. I have a interesting threading result.. class GetData(threading.Thread): def __init__(self, name): threading.Thread.__init__(self) self.name = name def run(self): self.data={2:3, 3:4...} current = GetData(a) nlist.append(current) current.start() end=[] dd=nlist[0]

Re: simple try/except question

2007-10-29 Thread Alan Isaac
False alarm. Fresh start of interpreter and all is well. Apologies. Still tracking. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: simple try/except question

2007-10-29 Thread Alan Isaac
Gabriel Genellina wrote: Perhaps you reassigned TypeError? Yes, that was it. Sheesh. Thanks! Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : Bruno Desthuilliers [EMAIL PROTECTED] writes: The problem is that your formulation implies (to me at least) that the variable is actually a kind of container for the object. I really didn't expect it to be read that way, especially since the sentence claims that

two files into an alternate list

2007-10-29 Thread Beema shafreen
hi everybody , i have a file : file 1: 1 2 3 4 5 6 file2: a b c d e f how do i make the two files into list like this = [1,a,2,b,3,c,4,d,5,e,6,f] regards shafreen -- http://mail.python.org/mailman/listinfo/python-list

python2.5 and mysqldb

2007-10-29 Thread writeson
Hi all, At work we're using python2.3 and I'd like to start getting us moved up to python2.5. We run Centos4 which is the free, open source version of RedHat Enterprise. I've got python2.5 installed on this machine, but am stuck trying to get mysqldb installed and running on this machine. I've

Re: elementtree w/utf8

2007-10-29 Thread Tim Arnold
Stefan Behnel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Tim Arnold wrote: On a related note, I have another question--where/how can I get the cElementTree.py module? Sorry for something so basic, but I tried installing cElementTree, but while I could compile with setup.py

Re: python2.5 and mysqldb

2007-10-29 Thread Diez B. Roggisch
writeson wrote: Hi all, At work we're using python2.3 and I'd like to start getting us moved up to python2.5. We run Centos4 which is the free, open source version of RedHat Enterprise. I've got python2.5 installed on this machine, but am stuck trying to get mysqldb installed and running

Re: what version python and wxPython comes with Mac OS X Leopard

2007-10-29 Thread Stephen Hansen
Python 2.5.1, and wxPython 2.8.4.0. On 10/29/07, chewie54 [EMAIL PROTECTED] wrote: Hello, Anyone using Leopard know which versions of Python and wxPython and any other Python related modules are default with the new OS? Thanks, -- http://mail.python.org/mailman/listinfo/python-list --

Re: Using msvcrt (in Windows), how to catch Enter key?

2007-10-29 Thread Gabriel Genellina
On 29 oct, 09:23, Dick Moores [EMAIL PROTECTED] wrote: while True: if msvcrt.getch() == '\r': I tried it and find that without the msvcrt.kbhit the first key I hit doesn't do anything. I have to hit that key again, or another key. I'd say there is a logic error in your program then;

Re: Built-in functions and keyword arguments

2007-10-29 Thread Hendrik van Rooyen
Tim Chase [EMAIL PROTECTED] I think you are being a little bit unfair here: help(len) says: len(...) len(object) - integer Return the number of items of a sequence or mapping. which implies that the argument to len has the name 'object' (although in fact it

Re: Using msvcrt (in Windows), how to catch Enter key?

2007-10-29 Thread Dick Moores
At 09:53 AM 10/29/2007, Dick Moores wrote: At 09:26 AM 10/29/2007, Gabriel Genellina wrote: On 29 oct, 09:23, Dick Moores [EMAIL PROTECTED] wrote: while True: if msvcrt.getch() == '\r': I tried it and find that without the msvcrt.kbhit the first key I hit doesn't do

Re: Built-in functions and keyword arguments

2007-10-29 Thread Jean-Paul Calderone
On Mon, 29 Oct 2007 19:03:34 +0200, Hendrik van Rooyen [EMAIL PROTECTED] wrote: Tim Chase [EMAIL PROTECTED] I think you are being a little bit unfair here: help(len) says: len(...) len(object) - integer Return the number of items of a sequence or mapping. which implies

Re: Built-in functions and keyword arguments

2007-10-29 Thread Bruno Desthuilliers
Armando Serrano Lombillo a écrit : On Oct 29, 3:20 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Armando Serrano Lombillo a écrit : Why does Python give an error when I try to do this: len(object=[1,2]) Traceback (most recent call last): File pyshell#40, line 1, in module

Re: A class question

2007-10-29 Thread Donn Ingle
bump :) -- http://mail.python.org/mailman/listinfo/python-list

Re: two files into an alternate list

2007-10-29 Thread J. Clifford Dyer
That depends: What do you want when you have these two files: file 1: a b c file 2: 1 2 3 4 5 Options: *['a',1,'b',2,'c',3,None,4,None,5] *['a',1,'b',2,'c',3,4,5] *['a',1,'b',2,'c',3] *Throw an exception And what if file 1 has more lines than file 2? Cheers, Cliff 1 On Mon, Oct 29, 2007 at

Re: Function to resize global numpy array interactively in ipython

2007-10-29 Thread Robert Kern
David Sanders wrote: Hi, I have a script with function definitions which I load into ipython for interactive use. These functions modify a global numpy array, whose size I need to be able to change interactively. I thus have a script which looks like this: from numpy import * def

Re: Using msvcrt (in Windows), how to catch Enter key?

2007-10-29 Thread Dick Moores
At 09:26 AM 10/29/2007, Gabriel Genellina wrote: On 29 oct, 09:23, Dick Moores [EMAIL PROTECTED] wrote: while True: if msvcrt.getch() == '\r': I tried it and find that without the msvcrt.kbhit the first key I hit doesn't do anything. I have to hit that key again, or another key.

Re: Built-in functions and keyword arguments

2007-10-29 Thread J. Clifford Dyer
On Mon, Oct 29, 2007 at 02:27:50PM +, Duncan Booth wrote regarding Re: Built-in functions and keyword arguments: Bruno Desthuilliers [EMAIL PROTECTED] wrote: In the second case, the name of the argument *is* 'object'. Which is not the case for the builtin len (which, fwiw, has

Re: Built-in functions and keyword arguments

2007-10-29 Thread Duncan Booth
J. Clifford Dyer [EMAIL PROTECTED] wrote: I think you are being a little bit unfair here: help(len) says: len(...) len(object) - integer Return the number of items of a sequence or mapping. which implies that the argument to len has the name 'object' (although in fact it

Re: coverage.py: Statement coverage is the weakest measure of code coverage

2007-10-29 Thread John Roth
On Oct 28, 9:15 pm, Ben Finney [EMAIL PROTECTED] wrote: Kay Schluehr [EMAIL PROTECTED] writes: I used to write once a coverage tool ( maybe I can factor this out of my tool suite some time ) That'd be wonderful. I'd like to see comparisons between different test-coverage tools, just as we

Re: Solaris 10 + Sun Studio 12 Pyrhon 2.4.4 64-bit build problem

2007-10-29 Thread MrJean1
Building 64-bit Python is still elusive. I tried various ways to add - xtarget=opteron -xarch-amd64 to the C/C++ flags but that still fails to produce a 64-bit build. Changing the Makefile is not sufficient since that causes compilation errors. It looks like the ./configure command must run

Re: python2.5 and mysqldb

2007-10-29 Thread brad
writeson wrote: ... stuck trying to get mysqldb installed and running on this machine. I've tried with easy_install and by building from the tar file and both return a long list of errors from a gcc compile. I'm not sure what to do next to resolve this issue, so if anyone could give me some

  1   2   3   >