ANNOUNCE: Gaphor 0.11.2 and Gaphas 0.3.2

2007-08-14 Thread Arjan Molenaar
Hi, I just released a new version of Gaphor, the pure Python UML modelling tool. This is bug fix release: - improved items's connection adapters - fixed comment line, comment, message and lifeline items connection adapters to implement UML specification more closely - items glueing speedup -

New url for Tktreectrl and Tkdnd wrapper modules

2007-08-14 Thread klappnase
Hello, maybe you have noticed that the TkinterTreectrl and TkinterDnd wrappers had disappeared from the web. My isp missed to tell me that they shut down their service, so it took me a while to notice. Finally my pages are back online again. The new url for the Tktreectrl wrapper is

IDLE path browser not recognizing my PYTHONPATH

2007-08-14 Thread Brisingman
Hi, I set PYTHONPATH to /home/me/bin in bash.bashrc, however the IDLE path browser is not recognizing this. Not sure why. Grateful for any insight. Best -- http://mail.python.org/mailman/listinfo/python-list

how to move cursor in Interactive Interpreter

2007-08-14 Thread yan . python
i have a question. when i run Interactive Interpreter in linux command promt,how can i move the cursor. for example,when i enter a string,i often enter the quotation mark first,and the move the cursor inside the mark to enter the string,in windows,it is ok.but when i do that in linux,pressing

►ENJOY free satellite tv on your pc◄

2007-08-14 Thread Lisa Jones
The New Way To Enjoy Satellite TV on your PC! • Watch all your favorite shows on your Computer from anywhere in the World! • Save 1000's of $$$ over many years on cable and satellite bills • Plus Get FREE Unlimited Downloads Movies, MP3s Music, etc !!! • INSTANT DOWNLOAD For More Details:

Re: how to move cursor in Interactive Interpreter

2007-08-14 Thread Peter Otten
[EMAIL PROTECTED] wrote: i have a question. when i run Interactive Interpreter in linux command promt,how can i move the cursor. for example,when i enter a string,i often enter the quotation mark first,and the move the cursor inside the mark to enter the string,in windows,it is ok.but

Re: Module imports during object instantiation

2007-08-14 Thread Bruno Desthuilliers
Ritesh Raj Sarraf a écrit : Bruno Desthuilliers wrote: Ritesh Raj Sarraf a écrit : The initializer will be called *each time* you instanciate the class. And nothing prevents client code from calling it explicitelly as many times as it wants - ok, this would be rather strange, but this is

about negative polar plots

2007-08-14 Thread yadin
hi am doing a polar plot of the radiation pattern of an antenna. the polar plots represents the value of the power in dB's and the dB go from -40dB to 0dB as the angle theta changes from 0 to 2*pi rads the polar plot in python goes with positive values how can i solve this problem rough example

about negative polar plots not defined in python not even matlab

2007-08-14 Thread yadin
high i think everybody has seen dB radiation pattern plots... well those are done with negative polar plots ...the values of the magnitude in the axes are NEGATIVE values... but i can find a polar plot command that those negative plots not in python not even in matlab the polar plots represents

Re: Module imports during object instantiation

2007-08-14 Thread Bruno Desthuilliers
Ritesh Raj Sarraf a écrit : Bruno Desthuilliers wrote: Ritesh Raj Sarraf a écrit : if lock is None or lock != 1: self.DispLock = False else: self.DispLock = threading.Lock() self.lock = True if os.name == 'posix':

Re: about negative polar plots

2007-08-14 Thread Erik Max Francis
yadin wrote: hi am doing a polar plot of the radiation pattern of an antenna. the polar plots represents the value of the power in dB's and the dB go from -40dB to 0dB as the angle theta changes from 0 to 2*pi rads the polar plot in python goes with positive values how can i solve this

Re: about negative polar plots not defined in python not even matlab

2007-08-14 Thread Robin Becker
. polar(power,theta) title.? how can i show the step on the polar plot plot(-40, -30,-20,-10,0) I think you need to consider why you want to plot negative values. The decibel scales are actually logarithmic ie all power is actually positive. Zero power corresponds to

Re: Eclipse/PyDev question

2007-08-14 Thread king kikapu
Fabio, thanks for the reply! Anyway, i saw that i cannot import anything if i use Source Folders in Eclipse/PyDev. The only way i can accomplish that is by using PyDev Packages. Thus, i can import whatever i want ant intellisense is working great! I just cannot understand the usefulness of PyDev

Re: about negative polar plots

2007-08-14 Thread special_dragonfly
Erik Max Francis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] yadin wrote: hi am doing a polar plot of the radiation pattern of an antenna. the polar plots represents the value of the power in dB's and the dB go from -40dB to 0dB as the angle theta changes from 0 to 2*pi rads

Re: decorators - more than just syntactic sugar

2007-08-14 Thread BJörn Lindqvist
On 8/13/07, Bjoern Schliessmann [EMAIL PROTECTED] wrote: BJörn Lindqvist wrote: unpedagogically not separated from ordinary functions. Decorators _are_ ordinary functions. Remember the syntactic sugar in this thread? Remember also that syntactic sugar is important. Case in point, the OP

[half-off] LAMA - how to I use the news server with thunderbird

2007-08-14 Thread durumdara
Hi! Is anyone knows about an NNTP servers that containing newsgroups about these lists: - python win32 (python-win32) - mod_python - gimp-python - gimp I wanna set thes nntp servers in thunderbird so I need correct addresses. Thanks for your help: dd --

Re: [half-off] LAMA - how to I use the news server with thunderbird

2007-08-14 Thread Laurent Pointal
durumdara a écrit : Hi! Is anyone knows about an NNTP servers that containing newsgroups about these lists: - python win32 (python-win32) - mod_python - gimp-python - gimp I wanna set thes nntp servers in thunderbird so I need correct addresses. Thanks for your help:

Re: Module imports during object instantiation

2007-08-14 Thread Bruno Desthuilliers
Ritesh Raj Sarraf a écrit : Steve Holden wrote: (snip) What's leading you to conclude the import isn't being executed? You realise, I trust, that the module's code will only be executed on the first call to __init__()? Well. Putting it in a try inside __init__() doesn't do anything.

ctypes, windll question

2007-08-14 Thread Tzury
I followed the tutorial about ctypes and I still cannot figure out how to call a method of a calss within the dll. For example: a dll named 'foo' contain a class named 'bar' which expose a method named 'baz'. if I either do: mydll = windll.foo mycls = mydll.bar or mycls = windll.foo.bar or

Re: IDLE path browser not recognizing my PYTHONPATH

2007-08-14 Thread Martin v. Löwis
I set PYTHONPATH to /home/me/bin in bash.bashrc, however the IDLE path browser is not recognizing this. Not sure why. Grateful for any insight. The file bash.bashrc has no relevance. If you meant to set the variable every time you start bash, put it into .bashrc, in your home directory. If

ctypes windll question

2007-08-14 Thread Tzury
I followed the tutorial about ctypes and I still cannot figure out how to call a method of a calss within the dll. For example: a dll named 'foo' contain a class named 'bar' which expose a method named 'baz'. if I either do: mydll = windll.foo mycls = mydll.bar or mycls = windll.foo.bar or

Re: Jython - variables are stored somehow

2007-08-14 Thread nmin
works perfect ... thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: Jython - problem import os

2007-08-14 Thread nmin
Thats it ... Additionally I had to set the python path with sys.path.append to the Lib folder .. and now it works perfect. thanks a lot Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Assignments and Variable Substitution

2007-08-14 Thread Ali
On Aug 14, 12:45 am, Steve Holden [EMAIL PROTECTED] wrote: Evan Klitzke wrote: On 8/13/07, brad [EMAIL PROTECTED] wrote: I'd like to do something like this: var = '123' %s = [], %var And why would you want a variable whose name is '123'? ... and thus continues the search for private

python MS Office

2007-08-14 Thread Michael S
http://msherman77.blogspot.com/2007/08/python-com.html -- http://mail.python.org/mailman/listinfo/python-list

Fast kNN from python

2007-08-14 Thread Janto Dreijer
Hi! I am looking for a Python implementation or bindings to a library that can quickly find k-Nearest Neighbors given an arbitrary distance metric between objects. Specifically, I have an edit distance between objects that is written in Python. I haven't looked at the methods in detail but I

Re: Assignments and Variable Substitution

2007-08-14 Thread Bruno Desthuilliers
Ali a écrit : On Aug 14, 12:45 am, Steve Holden [EMAIL PROTECTED] wrote: Evan Klitzke wrote: On 8/13/07, brad [EMAIL PROTECTED] wrote: I'd like to do something like this: var = '123' %s = [], %var And why would you want a variable whose name is '123'? ... and thus continues the search

Re: Best programs written completly in Python

2007-08-14 Thread Skip Montanaro
On Aug 5, 5:14 am, Franz Steinhäusler [EMAIL PROTECTED] wrote: Hello NG, wWhat are the best programs in your opinion, written entirly in pyhton, divided into categories like: a) Games b) Utilities/System c) Office d) Web/Newsreader/Mail/Browser ... Not mentioned so far, here or on the

Re: how to move cursor in Interactive Interpreter

2007-08-14 Thread yan . python
On 8 14 , 2 44 , Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: i have a question. when i run Interactive Interpreter in linux command promt,how can i move the cursor. for example,when i enter a string,i often enter the quotation mark first,and the move the cursor

Re: Module imports during object instantiation

2007-08-14 Thread Ritesh Raj Sarraf
Bruno Desthuilliers wrote: What's leading you to conclude the import isn't being executed? You realise, I trust, that the module's code will only be executed on the first call to __init__()? Well. Putting it in a try inside __init__() doesn't do anything. This would be highly suprising.

Re: ctypes windll question

2007-08-14 Thread Tzury
I discovered pywin32-210.win32-py2.5 package which does all the work for me. Open Software world is a great place to live by On Aug 14, 12:45 pm, Tzury [EMAIL PROTECTED] wrote: I followed the tutorial about ctypes and I still cannot figure out how to call a method of a calss within the

Re: Module imports during object instantiation

2007-08-14 Thread Neil Cerutti
On 2007-08-14, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: Bruno Desthuilliers wrote: What's leading you to conclude the import isn't being executed? You realise, I trust, that the module's code will only be executed on the first call to __init__()? Well. Putting it in a try inside

Opinions about this new Python book?

2007-08-14 Thread Dick Moores
I'd appreciate opinions about this new Python book. Title: Python Power!: The Comprehensive Guide Author: Matt Telles Publisher: Course Technology Pub. Date: Jul 27, 2007 Edition: 1st edition Binding: Paperback Pages: 508 ISBN: 1598631586 List Price: 34.99 USD The book on the publisher's

Re: Drawing a graph

2007-08-14 Thread Larry Bates
Ghirai wrote: Hello list, I need to draw a graph, 2 axes, 2D, nothing fancy. One of the axes is time, the other one is a series of integers. I don't care much about the output format. Are there any specialized libraries for this, or should i use PIL? Thanks. ReportLab graphics

Re: chmod g+ Equivalent

2007-08-14 Thread milan_sanremo
On Aug 13, 8:06 pm, Steve Holden [EMAIL PROTECTED] wrote: milan_sanremo wrote: I've read the documentation on os.chmod() and can implement all the standard commands, but what is the syntax for the equivalent of chmod g + to set the group id? I assume when you say to set the group id you

LEGB rule, totally confused ...

2007-08-14 Thread stef mientki
hello, I've thought many times I finally understood the import / namespace rules, but again I'm totally lost :-( This is my library file # Module lib_test.py X = 1 def Init(): global X X = 3 print 'Init', X def Run (): print X

Script to copy database

2007-08-14 Thread Tony
I'm new at this and would like to know how set up a script to copy a database from a local computer to a network at a certain time everyday. Should be simple enough, but, as of now I am unfamiliar with how to do this. Would this be done by writing a script and setting up a scheduled task to

Re: JPype - passing to Java main

2007-08-14 Thread unlikeablePorpoise
Try this: com.JPypeTest.main(arg) Ian Thanks for your suggestion, but it doesn't work (produces an error). Does anybody else have any ideas? Thanks, Sarah -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython before MainLoop

2007-08-14 Thread Chris Mellon
On 8/13/07, [david] [EMAIL PROTECTED] wrote: Well yes, I have tried this app with native windows, and I know how to do it. I don't believe you. If you meant I copied something that does this off of code project, that I'll believe. But if all wxPython can offer is a poor imitation of MFC,

Re: Opinions about this new Python book?

2007-08-14 Thread kyosohma
On Aug 14, 7:05 am, Dick Moores [EMAIL PROTECTED] wrote: I'd appreciate opinions about this new Python book. Title: Python Power!: The Comprehensive Guide Author: Matt Telles Publisher: Course Technology Pub. Date: Jul 27, 2007 Edition: 1st edition Binding: Paperback Pages: 508

Class problems.

2007-08-14 Thread special_dragonfly
Hello, I'm having problems retrieving data I think I've put into my program. I have a class and a function. I'm reading in from a personally made text file of the data needed for the class. The FieldsDictionary needs to be accesable outside the function, but my problem is this: the print

Re: JPype - passing to Java main

2007-08-14 Thread Laurent Pointal
[EMAIL PROTECTED] a écrit : Try this: com.JPypeTest.main(arg) Ian Thanks for your suggestion, but it doesn't work (produces an error). This is where you should have copy/pasted the error. ;-) Does anybody else have any ideas? Sorry, no. --

Re: Icons for GUI development

2007-08-14 Thread Uwe Grauer
Benjamin wrote: I'm developing a mail client. Since GUI are usually improved with some icons, I'm looking for some. Because I'm not a very gifted artist I'm searching for a library of GPL or public domain icons. Any suggestions? http://tango.freedesktop.org/Tango_Icon_Library --

Re: Fast kNN from python

2007-08-14 Thread Tim Churches
Janto Dreijer wrote: I am looking for a Python implementation or bindings to a library that can quickly find k-Nearest Neighbors given an arbitrary distance metric between objects. Specifically, I have an edit distance between objects that is written in Python. Orange? See

Re: Script to copy database

2007-08-14 Thread Laurent Pointal
Tony a écrit : I'm new at this and would like to know how set up a script to copy a database from a local computer to a network at a certain time everyday. Should be simple enough, but, as of now I am unfamiliar with how to do this. Would this be done by writing a script and setting up a

Re: Class problems.

2007-08-14 Thread special_dragonfly
Just ignore this, I was being an idiot... special_dragonfly [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I'm having problems retrieving data I think I've put into my program. I have a class and a function. I'm reading in from a personally made text file of the data

Re: LEGB rule, totally confused ...

2007-08-14 Thread Diez B. Roggisch
stef mientki wrote: hello, I've thought many times I finally understood the import / namespace rules, but again I'm totally lost :-( This is my library file # Module lib_test.py X = 1 def Init(): global X X = 3 print 'Init', X def Run

Re: Assignments and Variable Substitution

2007-08-14 Thread brad
Steve Holden wrote: Evan Klitzke wrote: On 8/13/07, brad [EMAIL PROTECTED] wrote: I'd like to do something like this: var = '123' %s = [], %var So that, in the end, var is '123' and an empty list is named '123' as well. The list assignments are created during a loop. You can't assign a

Re: LEGB rule, totally confused ...

2007-08-14 Thread Laurent Pointal
stef mientki a écrit : hello, I've thought many times I finally understood the import / namespace rules, but again I'm totally lost :-( This is my library file # Module lib_test.py X = 1 def Init(): global X X = 3 print 'Init', X def Run ():

Re: JPype - passing to Java main

2007-08-14 Thread unlikeablePorpoise
Good point Laurent. Here is the error produced when I try to access main() using 'com.JPypeTest.main(arg)' The original code is pasted at the top of this thread. I only added 'com.JPypeTest.main(arg)' which causes the error below -ERROR_- File tester.py, line 10, in

Re: how to move cursor in Interactive Interpreter

2007-08-14 Thread Peter Otten
[EMAIL PROTECTED] wrote: what am i supposed to do to install the module GNU readline correctly then? by the way,my linux is Mandriva 10 Use the package manager of your distribution to install the readline development package -- after some struggle with Mandriva's website I came to suppose

Re: Class problems.

2007-08-14 Thread Diez B. Roggisch
special_dragonfly wrote: Hello, I'm having problems retrieving data I think I've put into my program. I have a class and a function. I'm reading in from a personally made text file of the data needed for the class. The FieldsDictionary needs to be accesable outside the function, but my

Re: LEGB rule, totally confused ...

2007-08-14 Thread Neil Cerutti
On 2007-08-14, stef mientki [EMAIL PROTECTED] wrote: I've thought many times I finally understood the import / namespace rules, but again I'm totally lost :-( This is my library file # Module lib_test.py X = 1 def Init(): global X X = 3 print

Re: Script to copy database

2007-08-14 Thread Tony
Thanks Laurent. That was very helpful. Pretty easy too. Thanks again for your help. Tony Laurent Pointal [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Tony a écrit : I'm new at this and would like to know how set up a script to copy a database from a local computer to a

Re: Fast kNN from python

2007-08-14 Thread Janto Dreijer
On Aug 14, 3:11 pm, Tim Churches [EMAIL PROTECTED] wrote: Janto Dreijer wrote: I am looking for a Python implementation or bindings to a library that can quickly find k-Nearest Neighbors given an arbitrary distance metric between objects. Specifically, I have an edit distance between

Question about FutureWarning

2007-08-14 Thread Steven W. Orr
I have module M1 which has the following line in it: StartTime = safe_dict_get ( dic, 'starttime', 0x ) It gets imported by modules M2 and M3. And finally, M4 imports both M2 and M3. M4 |\M3 | |\M1 |\M2 | |\M1 I'm building a .deb file which means I have to compile the

Re: Module imports during object instantiation

2007-08-14 Thread Ritesh Raj Sarraf
Neil Cerutti wrote: If you want an import inside an __init__ to run, you must call the __init__ function that contains it. Doesn't __init__ get called automatically ? I thought __init__ was required to be called explicitly only when you were doing inheritance and wanted to pass separate values

Re: (sort of) deterministic timing in Python

2007-08-14 Thread Hendrik van Rooyen
John Fisher jo.cast.net wrote: import time period_time = TIME_CONSTANT # The time of a period in seconds - 0.001 is a millisec mark start time start_time = time.time() start event event finishes event_time = time.time() - start_time wait_time = period_time-event_time count time

Re: Script to copy database

2007-08-14 Thread brad
Laurent Pointal wrote: As you wrote about c: and f:, I imagine you are working under Windows. IMHO you dont need Python for that. Unless you need error handling, reporting, etc. Bat scripts only go so far. -- http://mail.python.org/mailman/listinfo/python-list

Re: Module imports during object instantiation

2007-08-14 Thread Neil Cerutti
On 2007-08-14, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote: Neil Cerutti wrote: If you want an import inside an __init__ to run, you must call the __init__ function that contains it. Doesn't __init__ get called automatically ? It gets called automatically when you construct an instance of the

Re: how to move cursor in Interactive Interpreter

2007-08-14 Thread yan . python
On 8 14 , 9 20 , Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: what am i supposed to do to install the module GNU readline correctly then? by the way,my linux is Mandriva 10 Use the package manager of your distribution to install the readline development package --

Re: Icons for GUI development

2007-08-14 Thread Jason
On Aug 13, 8:22 pm, Benjamin [EMAIL PROTECTED] wrote: I'm developing a mail client. Since GUI are usually improved with some icons, I'm looking for some. Because I'm not a very gifted artist I'm searching for a library of GPL or public domain icons. Any suggestions? Try out the Silk icon set,

Re: Script to copy database

2007-08-14 Thread kyosohma
On Aug 14, 7:30 am, Tony [EMAIL PROTECTED] wrote: I'm new at this and would like to know how set up a script to copy a database from a local computer to a network at a certain time everyday. Should be simple enough, but, as of now I am unfamiliar with how to do this. Would this be done by

Callback functions with httplib.HTTPSConnection

2007-08-14 Thread David Morris
Is there a way to give a progress or status message while a file it uploading using httplib.HTTPSConnection? Here is some sample code that I would like to add a progress message to when run from the commandline: server = httplib.HTTPSConnection(upload_host) server.request('POST', upload_uri,

Re: Python script for mobile platforms -- suggested?

2007-08-14 Thread Robert Dailey
Hi Jay, I apologize for not having been detailed enough. Right now I'm using a C++ library known as TinyXML to parse my XML files. When a menu is to be displayed, the XML is parsed and the appropriate images, text, etc that will display on the menu is loaded based on the data in that XML. Note

Re: Opinions about this new Python book?

2007-08-14 Thread Dick Moores
At 05:57 AM 8/14/2007, [EMAIL PROTECTED] wrote: On Aug 14, 7:05 am, Dick Moores [EMAIL PROTECTED] wrote: I'd appreciate opinions about this new Python book. Title: Python Power!: The Comprehensive Guide Author: Matt Telles Publisher: Course Technology Pub. Date: Jul 27, 2007

module: zipfile.writestr - line endings issue

2007-08-14 Thread towers
Hi I'm probably doing something stupid but I've run into a problem whereby I'm trying to add a csv file to a zip archive - see example code below. The csv just has several rows with carriage return line feeds (CRLF). However after adding it to an archive and then decompressing the line endings

negative values on polar plot (decibels polar plots )

2007-08-14 Thread yadin
hi every one can you please can you help me to fix these polar plot in db's so that the center is at the minimun negative number in voltagedb about [-50] and the maximun is at zero how can i see values on the axies like showing that the axes start at -40 -30 .0 than you import wx import os

Simple python iteration question

2007-08-14 Thread Bryan
Hi, I just started with python, and have a for loop question In c++ (or a number of other languages) I can do this: for (int i=0, j=0; i i_len, j j_len; ++i, ++j) {} If I have this in python: l = ['a', 'b', 'c'] I want to get the value and also an iterator: for i,v in len(l), l:

pure python gaussian blur

2007-08-14 Thread Gerdus van Zyl
Does anyone have a relatively fast gaussian blur implemented in pure python? Below is my attempt but it takes 2.9 seconds for a 320x240 image. Image comes from byte string: self.array = array.array('B',srcstring). Would some sort of matrix multiplication be faster? I don't have experience in that.

Re: Simple python iteration question

2007-08-14 Thread [EMAIL PROTECTED]
On Aug 14, 10:22 am, Bryan [EMAIL PROTECTED] wrote: Hi, I just started with python, and have a for loop question In c++ (or a number of other languages) I can do this: for (int i=0, j=0; i i_len, j j_len; ++i, ++j) {} If I have this in python: l = ['a', 'b', 'c'] I want to get the

Re: Simple python iteration question

2007-08-14 Thread Lawrence Oluyede
Bryan [EMAIL PROTECTED] wrote: How do I do this? for i, item in enumerate(l): print i, item -- Lawrence, oluyede.org - neropercaso.it It is difficult to get a man to understand something when his salary depends on not understanding it - Upton Sinclair --

Re: Simple python iteration question

2007-08-14 Thread Will Maier
On Tue, Aug 14, 2007 at 12:22:04PM -0400, Bryan wrote: I just started with python, and have a for loop question In c++ (or a number of other languages) I can do this: for (int i=0, j=0; i i_len, j j_len; ++i, ++j) {} If I have this in python: l = ['a', 'b', 'c'] I want to get the

Re: Simple python iteration question

2007-08-14 Thread [EMAIL PROTECTED]
On Aug 14, 11:27 am, [EMAIL PROTECTED] (Lawrence Oluyede) wrote: Bryan [EMAIL PROTECTED] wrote: How do I do this? for i, item in enumerate(l): print i, item ^^ That is the `most-correct` answer. But because you're new, I'll take this time to introduce you to help(), just in case

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
On 8/14/07, Bryan [EMAIL PROTECTED] wrote: Hi, I just started with python, and have a for loop question In c++ (or a number of other languages) I can do this: for (int i=0, j=0; i i_len, j j_len; ++i, ++j) {} If I have this in python: l = ['a', 'b', 'c'] I want to get the value and

Re: Simple python iteration question

2007-08-14 Thread i3dmaster
or use its builtin enumerate function: for i, j in enumerate(list): print i, j --Jim On Aug 14, 2007, at 9:26 AM, [EMAIL PROTECTED] wrote: On Aug 14, 10:22 am, Bryan [EMAIL PROTECTED] wrote: Hi, I just started with python, and have a for loop question In c++ (or a number of other

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
snip this will get index and item at index, for i in range(0, len(l)): print i print l[i] -- http://mail.python.org/mailman/listinfo/python-list Enumerate is better here -- it provides the same result and that's what it's for. However, if you do use range, the zero is

Re: LEGB rule, totally confused ...

2007-08-14 Thread Sion Arrowsmith
stef mientki [EMAIL PROTECTED] wrote: def Run (): print X === UnboundLocalError: local variable 'X' referenced before assignment X = X + 1 Why do I get the error ? Printing isn't assigning anything or am I missing something. Now if I remove X = X + 1 I

Re: module: zipfile.writestr - line endings issue

2007-08-14 Thread [EMAIL PROTECTED]
On Aug 14, 11:04 am, towers [EMAIL PROTECTED] wrote: Hi I'm probably doing something stupid but I've run into a problem whereby I'm trying to add a csv file to a zip archive - see example code below. The csv just has several rows with carriage return line feeds (CRLF). However after

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
snip Use the enumerate() builtin. l = ['a', 'b', 'c'] for i, v in enumerate(l): ... print i, v ... 0 a 1 b 2 c -- Just for my own sanity: Isn't this the third response advocating the use of enumerate()? Did the other responses not get through, or was

Re: Opinions about this new Python book?

2007-08-14 Thread James Matthews
i got to say that the best python book i bought was Core Python Programming (2nd) by Wesly Chun! Aside for all the spelling mistakes and syntax errors that there are i feel that the book really explained the language well for someone coming from another programming language! On 8/14/07, Dick

pil_usm for python 2.5?

2007-08-14 Thread Dieter Vanderelst
Hi list, Does anybody have a version of pil_usm (module for gaussian blurring) that is compiled for Python 2.5? Regards, Dieter -- Dieter Vanderelst [EMAIL PROTECTED] Department of Industrial Design Designed Intelligence -- Dieter Vanderelst [EMAIL PROTECTED] --

Re: pure python gaussian blur

2007-08-14 Thread Patrick Doyle
On 8/14/07, Gerdus van Zyl [EMAIL PROTECTED] wrote: Does anyone have a relatively fast gaussian blur implemented in pure python? Below is my attempt but it takes 2.9 seconds for a 320x240 image. Image comes from byte string: self.array = array.array('B',srcstring). Would some sort of matrix

Re: module: zipfile.writestr - line endings issue

2007-08-14 Thread towers
Thanks - your code works for me also. But I still get the issue when I read the file directly and add it to the archive. Say if I: 1. Use the test.csv file created with your code - currently the line endings look good (viewed in notepad on Win XP) 2. Run the following code: # begin code import

Re: LEGB rule, totally confused ...

2007-08-14 Thread stef mientki
Sion Arrowsmith wrote: stef mientki [EMAIL PROTECTED] wrote: def Run (): print X === UnboundLocalError: local variable 'X' referenced before assignment X = X + 1 Why do I get the error ? Printing isn't assigning anything or am I missing something.

Re: Opinions about this new Python book?

2007-08-14 Thread Shawn Milochik
Yes, please post back to the list. I saw this book on Amazon, but there's no table of contents listed, nor is there one on the publisher's site. Thanks, Shawn On 8/14/07, James Matthews [EMAIL PROTECTED] wrote: i got to say that the best python book i bought was Core Python Programming

Re: (Re)announcing APL 2007

2007-08-14 Thread Bob Armstrong
On Aug 6, 7:20 am, Paul Mansour [EMAIL PROTECTED] wrote: APL2007 Roll Call: Is anyone going to this? I'm thinking of going also , setting up some arrangement to provide an introductory tutorial to my free and open 4th.CoSy . My website is transiting between hosts so I don't recommend even

Re: JPype - passing to Java main

2007-08-14 Thread Alan Kennedy
-ERROR_- File tester.py, line 10, in module com.JPypeTest.main(arg) RuntimeError: No matching overloads found. at src/native/common/ jp_method.cpp:121 --END ERROR- I haven't used jpype, but the signature for java main functions is public

curses library

2007-08-14 Thread Ghirai
Hello list, I need to write a console application. Are there any wrappers around curses/ncurses? Or any other similar libraries? Thanks. -- Regards, Ghirai. -- http://mail.python.org/mailman/listinfo/python-list

Re: curses library

2007-08-14 Thread Neil Cerutti
On 2007-08-14, Ghirai [EMAIL PROTECTED] wrote: I need to write a console application. Are there any wrappers around curses/ncurses? Or any other similar libraries? The answer depends on your chosen platform. Python hasn't got a cross-platform console library as one of its included batteries.

Re: Opinions about this new Python book?

2007-08-14 Thread kyosohma
On Aug 14, 12:46 pm, Shawn Milochik [EMAIL PROTECTED] wrote: Yes, please post back to the list. I saw this book on Amazon, but there's no table of contents listed, nor is there one on the publisher's site. Thanks, Shawn On 8/14/07, James Matthews [EMAIL PROTECTED] wrote: i got to say

Re: Fast kNN from python

2007-08-14 Thread Miki
Hello, I am looking for a Python implementation or bindings to a library that can quickly find k-Nearest Neighbors given an arbitrary distance metric between objects. Specifically, I have an edit distance between objects that is written in Python. First Google search for k-Nearest Neighbors

Re: curses library

2007-08-14 Thread Ghirai
On Tue, 14 Aug 2007 18:27:16 GMT Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-14, Ghirai [EMAIL PROTECTED] wrote: I need to write a console application. Are there any wrappers around curses/ncurses? Or any other similar libraries? The answer depends on your chosen platform. Python

Re: curses library

2007-08-14 Thread Shawn Milochik
You should try Google -- you'll get results faster: http://www.amk.ca/python/howto/curses/ http://docs.python.org/lib/module-curses.html On 8/14/07, Ghirai [EMAIL PROTECTED] wrote: Hello list, I need to write a console application. Are there any wrappers around curses/ncurses? Or any

post xml payload with urllib

2007-08-14 Thread brad
Has anyone sent an xml payload via post using urllib? I'd like to do something like this: logon_request = LoginRequest passwordthe_password/password userthe_user/user /LoginRequest logon = urllib.urlopen(https://127.0.0.1/api/version/xml;, logon_request) print logon.read() logon.close()

try/finally exceptions dying

2007-08-14 Thread stephen . y4ng
Hello all, In order to churn through a whole bunch of data sets (some good, some bad..) and get all the errors at the end, (the data will be updated to make it all good later on) I implemented a try/finally block with a higher level handler to catch errors before they propagate to the default

Re: post xml payload with urllib

2007-08-14 Thread mirandacascade
On Aug 14, 11:57 am, brad [EMAIL PROTECTED] wrote: Has anyone sent an xml payload via post using urllib? Haven't used urllib, but have used urllib2 to do a POST. Might something like this work... import urllib2 logon_request = LoginRequest passwordthe_password/password

Re: Fast kNN from python

2007-08-14 Thread Sean Davis
On Aug 14, 6:16 am, Janto Dreijer [EMAIL PROTECTED] wrote: Hi! I am looking for a Python implementation or bindings to a library that can quickly find k-Nearest Neighbors given an arbitrary distance metric between objects. Specifically, I have an edit distance between objects that is written

Re: curses library

2007-08-14 Thread Jean-Paul Calderone
On Tue, 14 Aug 2007 21:45:51 +0300, Ghirai [EMAIL PROTECTED] wrote: On Tue, 14 Aug 2007 18:27:16 GMT Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-08-14, Ghirai [EMAIL PROTECTED] wrote: I need to write a console application. Are there any wrappers around curses/ncurses? Or any other

Form-Through-Script Nightmare

2007-08-14 Thread tonylabarbara
Hi; I originally submitted this to the Zope list, but after no replies and realizing it's probably better suited for the python list, I'm submitting it here. I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered

  1   2   >