Re: FM synthesis using Numpy

2007-08-14 Thread Terry Reedy
"Joost Molenaar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'm trying to build a simple FM synthesizer in Python. As a beginner, | I take 'FM synthesizer' to | mean: "using a sine wave to control the frequency of another sine wave." If you don't get an answer here, try the nu

Re: make images with python

2007-08-14 Thread Lawrence Oluyede
stefano <[EMAIL PROTECTED]> wrote: > I need make some images using python but i'm lost :P -- 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 -

make images with python

2007-08-14 Thread stefano
I need make some images using python but i'm lost :P i need some module to make .png (with drawline, drawcircle, drawpoint etc etc etc ) like gd for php :P thants :D -- http://mail.python.org/mailman/listinfo/python-list

creating and appending to a dictionary of a list of lists

2007-08-14 Thread pyscottishguy
Hey, I started with this: factByClass = {} def update(key, x0, x1, x2, x3): x = factByClass.setdefault(key, [ [], [], [], [] ]) x[0].append(x0) x[1].append(x1) x[2].append(x2) x[3].append(x3) update('one', 1, 2, 3, 4) update('one', 5, 6, 7, 8) update('two', 9, 10, 11, 12) p

Re: accessing keys in dict

2007-08-14 Thread James Stroud
james_027 wrote: > hi, > > a_dict = {'name':'apple', 'color':'red', 'texture':'smooth', > 'shape':'sphere'} > > is there any difference between .. > > for key in a_dict: > > from > > for key in a_dict.keys(): > > > which is more preferred? Use the first. any difference in performance? It

accessing keys in dict

2007-08-14 Thread james_027
hi, a_dict = {'name':'apple', 'color':'red', 'texture':'smooth', 'shape':'sphere'} is there any difference between .. for key in a_dict: from for key in a_dict.keys(): which is more preferred? any difference in performance? THanks james -- http://mail.python.org/mailman/listinfo/python-li

Re: buggie in else syntax ?

2007-08-14 Thread Steve Holden
stef mientki wrote: > hello, > > I've the idea that the "else" syntax is not always handled correctly, > or I'm overlooking something. > [...] When faced with a choice between an error in a basic piece of Python and a misunderstanding on your part, Occam's razor would suggest you are failing t

Re: Retry: Question about FutureWarning

2007-08-14 Thread Erik Max Francis
Steven W. Orr wrote: > M1.py:268: FutureWarning: hex/oct constants > sys.maxint will > return positive values in Python 2.4 and up >StartTime = safe_dict_get ( dic, 'starttime', 0x ) ... > import warnings > warnings.filterwarnings('ignore', category=FutureWarning) > > My que

Retry: Question about FutureWarning

2007-08-14 Thread Steven W. Orr
I'm trying again, since no response indicates that I'm not providing enough info. 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. So the idea is t

Re: What order does info get returned in by os.listdir()

2007-08-14 Thread Steve Holden
Zentrader wrote: > On Aug 14, 1:52 pm, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: >> What order does info get returned in by os.listdir() ? >> >> I'm just starting to write python code, on an Win XP Pro machine. I've got >> various directories which, when I look at them in Win XP, sorted by name

Re: What order does info get returned in by os.listdir()

2007-08-14 Thread Miles
On 8/14/07, Zentrader wrote: > On Aug 14, 1:52 pm, Jeremy C B Nicoll wrote: > > When I use os.listdir() to return that list of leaf values, I do seem to get > > them in alphabetical order, A before B before C etc, but the ~-prefixed ones > > are returned after the Z-prefixed files rather than befor

Re: Python script for mobile platforms -- suggested?

2007-08-14 Thread Jay Loden
Robert Dailey wrote: > 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

FM synthesis using Numpy

2007-08-14 Thread Joost Molenaar
Hello fellow Python coders, I'm trying to build a simple FM synthesizer in Python. As a beginner, I take 'FM synthesizer' to mean: "using a sine wave to control the frequency of another sine wave." I tried to generate a tone of 1000 Hz that deviates 15 Hz six times a second. The start of the resu

Re: buggie in else syntax ?

2007-08-14 Thread Thomas Jollans
On Tuesday 14 August 2007, stef mientki wrote: > hello, > > I've the idea that the "else" syntax is not always handled correctly, > or I'm overlooking something. > > This pieces of code are automatic translation from another language, > sometimes it works, sometimes it doesn't ??? > > This piece of

ooh-yes

2007-08-14 Thread [EMAIL PROTECTED]
http://Theologos.kokkonis.googlepages.com/ http://kokonis.aygoystinos.googlepages.com/ -- http://mail.python.org/mailman/listinfo/python-list

ooh-yes

2007-08-14 Thread [EMAIL PROTECTED]
http://Theologos.kokkonis.googlepages.com/ http://kokonis.aygoystinos.googlepages.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: chmod g+ Equivalent

2007-08-14 Thread Steve Holden
milan_sanremo wrote: > 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

Re: LEGB rule, totally confused ...

2007-08-14 Thread Diez B. Roggisch
> Thanks guys, I beginning to see the light again, > and if X is mutual the story is completely different, > I still have to get used to these differences. That's supposed to be "mutable", not "mutual". Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE path browser not recognizing my PYTHONPATH

2007-08-14 Thread Zentrader
On Aug 14, 2:30 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > 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 > vari

Re: What order does info get returned in by os.listdir()

2007-08-14 Thread Zentrader
On Aug 14, 1:52 pm, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > What order does info get returned in by os.listdir() ? > > I'm just starting to write python code, on an Win XP Pro machine. I've got > various directories which, when I look at them in Win XP, sorted by name, I > see in order, eg:

Re: What order does info get returned in by os.listdir()

2007-08-14 Thread Zentrader
On Aug 14, 1:52 pm, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > What order does info get returned in by os.listdir() ? > > I'm just starting to write python code, on an Win XP Pro machine. I've got > various directories which, when I look at them in Win XP, sorted by name, I > see in order, eg:

Re: A dumb question about a class

2007-08-14 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Also, does anyone know if there is some magic that makes > i in some_set > loads faster than > i in some_list It's not magic, per se. It's really part of the definition of the data type. Lists are ordered, and are slow when checking containment. Sets are unordered and

Re: A dumb question about a class

2007-08-14 Thread [EMAIL PROTECTED]
On Aug 13, 3:30 am, Steven Bethard <[EMAIL PROTECTED]> wrote: > Dick Moores wrote: > > At 03:35 PM 8/12/2007, Steven Bethard wrote: > >> Note that if you just want to iterate over all the primes, there's no > >> need for the class at all. Simply write:: > > >> forprimein iter_primes(): > > >

Tuned cars

2007-08-14 Thread airconditi
Cool cars, tuning & styling, here you can find many tuned cars with tons of pictures!!! http://tuning-styling.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Air conditioners for cars

2007-08-14 Thread knjaz
Everything you need to know about car air conditioners... http://car-air-conditioning.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: buggie in else syntax ?

2007-08-14 Thread James Stroud
stef mientki wrote: > hello, > > I've the idea that the "else" syntax is not always handled correctly, > or I'm overlooking something. > > This pieces of code are automatic translation from another language, > sometimes it works, sometimes it doesn't ??? > > This piece of code works nice: > >

buggie in else syntax ?

2007-08-14 Thread stef mientki
hello, I've the idea that the "else" syntax is not always handled correctly, or I'm overlooking something. This pieces of code are automatic translation from another language, sometimes it works, sometimes it doesn't ??? This piece of code works nice: a = 2 def JSM (line_nr):

What order does info get returned in by os.listdir()

2007-08-14 Thread Jeremy C B Nicoll
What order does info get returned in by os.listdir() ? I'm just starting to write python code, on an Win XP Pro machine. I've got various directories which, when I look at them in Win XP, sorted by name, I see in order, eg: ~prefixed file .txt A.txt B.txt ... Z.txt ie, XP seems

Re: Fast kNN from python

2007-08-14 Thread Janto Dreijer
On Aug 14, 8:44 pm, Miki <[EMAIL PROTECTED]> wrote: > 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

Re: Metaclass v.s. Property function.

2007-08-14 Thread Jens Thiede
On Aug 11, 6:06 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > Jens Thiede <[EMAIL PROTECTED]> wrote: > > I don't like the property function, usable in the new-style classes, > > because having to remember to manage a list of "foo = property(...)" > > assignments just plain sucks, so I wrote a metac

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

  1   2   >