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, b

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 exa

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 th

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 =

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 -infin

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 "P

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

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 poin

[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 -- http://mail.python.o

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 yo

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 an

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 myc

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 directo

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 myc

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 sea

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 th

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

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

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

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 b

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 i

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 gra

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 gro

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 ru

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

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:

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 FieldsD

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. -- http://mail.python.org/mailma

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 -- http://m

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 http://www.ail

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 da

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

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 lo

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 > >

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, i

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 p

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 >

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 t

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" > >

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 modu

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 value

Re: (sort of) deterministic timing in Python

2007-08-14 Thread Hendrik van Rooyen
"John Fisher" 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 until next

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 instan

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 pac

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 s

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

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, body

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 tha

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

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 f

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: pri

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

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 -- http://mail.python.org/mailm

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

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 ca

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 t

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

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
> 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 unne

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 =

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 a

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
> 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 thro

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 Moo

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] -- http://mail.python.org

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 matr

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 mi

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 lo

Re: JPype - passing to Java main

2007-08-14 Thread Alan Kennedy
> -ERROR_- > File "tester.py", line 10, in > 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 batter

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: > > >

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 Neigh

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 pl

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? >

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 = """ "the_password" "the_user" """ logon = urllib.urlopen("https://127.0.0.1/api/version/xml";, logon_request) print logon.read() logon.close() 127.0.0.1 expects xml via a https connec

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 hand

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 = """ "the_password" "the_user" """ req = urllib2.Reques

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 i

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?

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 accordi

Re: module: zipfile.writestr - line endings issue

2007-08-14 Thread Paul Carter
On Aug 14, 1:32 pm, towers <[EMAIL PROTECTED]> wrote: > 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 i

Re: chmod g+ Equivalent

2007-08-14 Thread Bjoern Schliessmann
milan_sanremo wrote: > The group ownership is set by chown, Yes -- by storing a group's gid (group ID) in the file metadata. The group ID is an int from /etc/group. > but the group id (setgid bit) is set by chmod. "group id" is not "setgid bit". The "setgid bit" is one bit in the file metadata

Re: import * is not allowed ??

2007-08-14 Thread O.R.Senthil Kumaran
* stef mientki <[EMAIL PROTECTED]> [2007-08-14 02:14:04]: > import * is not allowed in function 'JAL_MAIN_RUN' because it contains > a nested function with free variables (JAL_simulation_file.py, line 22) > What is the actual error message you are getting? Can you paste the stack trace or a li

Re: wxPython before MainLoop

2007-08-14 Thread Bjoern Schliessmann
[david] wrote: > Well yes, I have tried this app with native windows, > and I know how to do it. Then I wonder why you complained about concurrency problems (solved by using a worker thread, or using wx.Yield) in the first place. Windows has the same solutions, just as about every GUI framework.

Re: wxPython before MainLoop

2007-08-14 Thread Bjoern Schliessmann
[david] wrote: > Steve, it wasn't me that raised the comparison > with MFC. If you don't think that's a helpful > comparison, why not reply to that post instead? It _was_ a comparison, saying that they follow similar principles. You twisted this comparison by saying wxPython was an imitation of MF

Re: try/finally exceptions dying

2007-08-14 Thread Matt McCredie
> I thought finally always propagated the > exception all the way up the stack until it was handled. Finally will propagate the exception up, unless another exception occurs within the finally block. Since there is not (yet: http://www.python.org/dev/peps/pep-3134/) exception chaining in Python, o

  1   2   >