Re: Zipping Files to user defined Directory

2006-07-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, OriginalBrownster wrote: > I'm very new to python, and I have been using the TurboGears Framework > to use python to power my application. > > […] > > my problems is that when I want to download that file from the server I > want to zip the files selected. but how does a

Re: a print bug?

2006-07-27 Thread Summercoolness
Steve Holden wrote: > You obviously haven't yet passed your floating-point number proficiency > test yet. Please restrict yourself to integers until you understand the > difficulties that inaccuracies in floating-point can create ;-) hm, actually, i understand the limitation of floating point. but

Re: War chest for writing web apps in Python?

2006-07-27 Thread faulkner
cygwin http://www.cygwin.com/ try a few IDEs out to see which fits you best. IDLE ships with python, and isn't significantly objectively worse than any other python IDE, afaik. GUI designers aren't necessary because there's usually so little boilerplate code in any python toolkit, but, again, whate

War chest for writing web apps in Python?

2006-07-27 Thread Vincent Delporte
Hello I'm thinking of using Python to build the prototype for a business web appplication. The development and test machine is XP, while ultimate deployment will be on a shared Unix web host. What would you recommend I get, besides the Python engine itself? Good IDE (Kodomo?) ? Some kind of GUI d

RE: Writting to file from file and printing using python

2006-07-27 Thread atanas Cosmas Nkelame
Hi,I have  a task to write a program that will do the following.1. Run from the command line2. Get data from a text file (say data.txt) in the following format     111:  peter  edward [EMAIL PROTECTED]  112:  John  sykes        [EMAIL PROTECTED]

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Paul McGuire
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello Chaos, > > Then of course if you do the whole thing many times you could just > pre-generate the indices as in: > all_indices=[] > for i in xrange(thisHeight): > for j in xrange(thisWidth): > all_indices.a

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Paul McGuire
"Chaos" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > myCol = (0.3 * image.GetRed(thisX, thisY)) + (0.59 * > image.GetGreen(thisX, thisY)) + (0.11 * image.GetBlue(thisX, thisY)) > if myCol < darkestCol: >darkestCol = myCol >possX = thisX >possY = thisY > Psyco may b

non-blocking PIPE read on Windows

2006-07-27 Thread placid
Hi all, I have been looking into non-blocking read (readline) operations on PIPES on windows XP and there seems to be no way of doing this. Ive read that you could use a Thread to read from the pipe, but if you still use readline() wouldnt the Thread block too? What i need to do is, create a proc

Re: Need a compelling argument to use Django instead of Rails

2006-07-27 Thread Roman Susi
Ben Sizer wrote: > Ray wrote: > >>Just that it's a big, huge, humongous pity to see Python keeps missing >>the big thing over and over again. Last time when biotechnology was >>hot, which language became The Language? Perl. Now simple web app is >>hot? It's Ruby. > > > The problem is that Python

Re: SocketServer and timers

2006-07-27 Thread bryanjugglercryptographer
alf wrote: > I have one thread app using SocketServer and use server_forever() as a > main loop. All works fine, but now I need certain timer checking let's > say every 1 second something and stopping the main loop. So questions are: > -how to stop serve_forever Override serve_forever() and

Re: Why XP can not run Python after being setting the PATH?

2006-07-27 Thread Ray
By any chance the command window hasn't been restarted after you've changed the PATH? Strange that looks OK. If you do echo %PATH% what does it tell you, is Python there? Cheers Ray Daniel Mark wrote: > Hello all: > > I have set the PATH for Python as follows: > > My Computer->Properties->Advan

Why XP can not run Python after being setting the PATH?

2006-07-27 Thread Daniel Mark
Hello all: I have set the PATH for Python as follows: My Computer->Properties->Advanced->Environment Variables->System Variables->Path ...; C:\Program Files\Python24; Then I try to run python under command line C:\>python C:\>python.exe I got nothing:) It works iff I run as follows: C:\>"P

Re: HERE I BUILT A QUICK MATRIX TOOOK 5 MINS

2006-07-27 Thread Paul McGuire
> ...USING A INFINITE MAGENTIC > FIELD!!! I have a vision of a sweeping magenta fabric rippling through the cosmos. Perhaps a mauvic, cyanic, or even aubergenic field would be more stylish. -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: a print bug?

2006-07-27 Thread Summercoolness
Duncan Booth wrote: > But you wouldn't complain about this would you? > > >>> print "%10.4f" % 1.23445 > 1.2345 > >>> print "%10.3f" % 1.23445 > 1.234 > > A value which is slightly than 1.2345 prints to 4 decimal places as 1.2345 > and to 3 decimal places as 1.234. > > That's all that hap

Re: Threads vs Processes

2006-07-27 Thread Nick Vatamaniuc
It seems that both ways are here to stay. If one was so much inferior and problem-prone, we won't be talking about it now, it would have been forgotten on the same shelf with a stack of punch cards. The rule of thumb is 'the right tool for the right job.' Threading model is very useful for long C

Re: splitting words with brackets

2006-07-27 Thread Tim Chase
>> Hunh! I thought pyparsing was included with Debian. >> (http://packages.debian.org/stable/source/pyparsing) Yes, it's available. Laziness is the main factor here...however, it's simply an "apt-get install pyparsing" away. >> And is downloading a package really such a hardship? >> What, a

Re: locked file

2006-07-27 Thread Kirt
By locked files i mean Outlook PST file while Outlook has it open Simon Forman wrote: > Kirt wrote: > > i have a code that backsup file from src to dest. > > Now if some of the files are locked , i need to skip those files.. > > I was trying to use fctl module but it can be used only in unix i >

SocketServer and timers

2006-07-27 Thread alf
Hi, I have one thread app using SocketServer and use server_forever() as a main loop. All works fine, but now I need certain timer checking let's say every 1 second something and stopping the main loop. So questions are: -how to stop serve_forever -how to implement timers thx, a

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Chaos
Simon Forman wrote: > Chaos wrote: > > As my first attempt to loop through every pixel of an image, I used > > > > for thisY in range(0, thisHeight): > > for thisX in range(0, thisWidth): > > #Actions here for Pixel thisX, thisY > > > > But it takes 450-1000 m

Zipping Files to user defined Directory

2006-07-27 Thread OriginalBrownster
Hi There. I'm very new to python, and I have been using the TurboGears Framework to use python to power my application. I have a class which handles the upload of a file to a directory called "uploads", which is hosted on a server. my problems is that when I want to download that file from the s

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Casey Hawthorne
Have you tried PIL? (Python Imaging Library) "Chaos" <[EMAIL PROTECTED]> wrote: >As my first attempt to loop through every pixel of an image, I used > >for thisY in range(0, thisHeight): >for thisX in range(0, thisWidth): > #Actions here for Pixel thisX, thisY

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Simon Forman
Chaos wrote: > As my first attempt to loop through every pixel of an image, I used > > for thisY in range(0, thisHeight): > for thisX in range(0, thisWidth): > #Actions here for Pixel thisX, thisY > > But it takes 450-1000 milliseconds > > I want speeds less th

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Chaos
Chaos wrote: > John Machin wrote: > > Chaos wrote: > > > As my first attempt to loop through every pixel of an image, I used > > > > > > for thisY in range(0, thisHeight): > > > for thisX in range(0, thisWidth): > > > #Actions here for Pixel thisX, thisY > > >

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Nick Vatamaniuc
Hello Chaos, Whatever you do in "#Actions here ..." might be expressed nicely as a ufunction for numeric. Then you might be able to convert the expression to a numeric expression. Check out numpy/scipy. In general, if thisHeight, thisWidth are large use xrange not range. range() generates a list

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Chaos
John Machin wrote: > Chaos wrote: > > As my first attempt to loop through every pixel of an image, I used > > > > for thisY in range(0, thisHeight): > > for thisX in range(0, thisWidth): > > #Actions here for Pixel thisX, thisY > > OT: you don't need the 0 in

Re: HERE I BUILT A QUICK MATRIX TOOOK 5 MINS

2006-07-27 Thread Grant Edwards
On 2006-07-28, switzerland qunatium computer <[EMAIL PROTECTED]> wrote: > Optical Quantum computing Information encoded in a laser moves faster > than time! So if someone triangled 3 satelight in orbit. Someone could: You don't, by any chance, know Ludwig Plutonium, do you? -- Grant Edwards

HERE I BUILT A QUICK MATRIX TOOOK 5 MINS

2006-07-27 Thread switzerland qunatium computer
HERE I BUILT A QUICK MATRIX TOOOK 5 MINS Body: HERE I BUILD ONE FOR YOU 1.http://en.wikipedia.org/wiki/Real-time_computing 2.http://en.wikipedia.org/wiki/Quantum_computing NOW ALL YOU NEED AS ARTIFICAIL INTELLGENCE PYTHON LISP OR PROLONG AND ... Artificial General Intelligence (AGI) to dist

Re: How to force a thread to stop

2006-07-27 Thread bryanjugglercryptographer
Paul Rubin wrote: > Actually I don't understand the need for SSH. Who are you and what have you done with the real Paul Rubin? > This is traffic over a > LAN, right? Is all of the LAN traffic encrypted? That's unusual; SSH > is normally used to secure connections over the internet, but the > l

Re: Threads vs Processes

2006-07-27 Thread bryanjugglercryptographer
mark wrote: > The debate should not be about "threads vs processes", it should be > about "threads vs events". We are so lucky as to have both debates. > Dr. John Ousterhout (creator of Tcl, > Professor of Comp Sci at UC Berkeley, etc), started a famous debate > about this 10 years ago with the f

Re: Fastest Way To Loop Through Every Pixel

2006-07-27 Thread John Machin
Chaos wrote: > As my first attempt to loop through every pixel of an image, I used > > for thisY in range(0, thisHeight): > for thisX in range(0, thisWidth): > #Actions here for Pixel thisX, thisY OT: you don't need the 0 in the range call. Taking it out does

Fastest Way To Loop Through Every Pixel

2006-07-27 Thread Chaos
As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes 450-1000 milliseconds I want speeds less than 10 milliseconds I have t

Re: MySql

2006-07-27 Thread John Machin
[EMAIL PROTECTED] wrote: > > Thanks for the thumping, will try harder next time. > _ > > Thanks for commit comment i think that whats i need. > _ > > I think you should support people rather than pay

Re: Nested function scope problem

2006-07-27 Thread Gerhard Fiedler
On 2006-07-27 17:10:55, Bruno Desthuilliers wrote: >> Isn't being on the LHS the only way to write to a non-mutable object? > > You *don't* "write to a non-mutable object". You rebind the name to > another object (mutable or not, that's not the problem). Ok, sloppy writing (sloppy thinking, or

Re: micro authoritative dns server

2006-07-27 Thread Jack
No, it's very low level :) Please post back if you find a good solution (or have built something that you want to open source :) > Well, thanks, but I think it's so few for beginning. ,-( > Is it not any high-level DNS class? E!!! > > Regards, > Xan. > > Jack wrote: >> I was looking for s

Re: How to find difference in years between two dates?

2006-07-27 Thread John Machin
thebjorn wrote: > John Machin wrote: > > thebjorn wrote: > [...] > > > You give a good argument that the concept of a month is fuzzy > > > > Sorry, I can't imagine where you got "fuzzy" from. Perhaps you mean > > some other word. The concept is capable of being expressed precisely. > > and the se

can anybody explain this range() speedup (with psyco)

2006-07-27 Thread [EMAIL PROTECTED]
i am doing the problems at http://www.mathschallenge.net/index.php?section=project one problem involved finding factors, i used def divisors(n): divisors = set([1]) for i in range(1, math.ceil(n ** 0.5)+1): if n % i == 0: divisors.add(i) divisors.add(n/i)

Re: Threads vs Processes

2006-07-27 Thread mark
On Wed, 26 Jul 2006 10:54:48 -0700, Carl J. Van Arsdall wrote: > Alright, based a on discussion on this mailing list, I've started to > wonder, why use threads vs processes. The debate should not be about "threads vs processes", it should be about "threads vs events". Dr. John Ousterhout (creator

Re: Urllib.encode() - How does it Treat a List?

2006-07-27 Thread Gregory Piñero
Ok, nevermind, I figured it it, see below On 7/27/06, Gregory Piñero <[EMAIL PROTECTED]> wrote: > Hi Wise Python Folk, > > Here's my code: > >>> p={'type':'bar','title':'Gregs Chart 1','values':[1,2,3],'labels':[1,2,3]} > >>> urllib.urlencode(p) I simply should have said: urllib.urlencode(query=p

Re: update a window with tkinter ...

2006-07-27 Thread John McMonagle
On Thu, 2006-07-27 at 19:56 +0200, Laurent Hermann wrote: > Hi I'm new on this list so let me say hello to everybody. > > > I have a little problem with tkinter but I could not find the solution > on the net so I ask it here... > > > The thing I want to do is simple but I cannot, I would like t

Urllib.encode() - How does it Treat a List?

2006-07-27 Thread Gregory Piñero
Hi Wise Python Folk, Here's my code: >>> p={'type':'bar','title':'Gregs Chart 1','values':[1,2,3],'labels':[1,2,3]} >>> urllib.urlencode(p) 'values=%5B1%2C+2%2C+3%5D&labels=%5B1%2C+2%2C+3%5D&type=bar&title=Gregs+Chart+1' Now I just can't figure out what it's giving me for say values? What is tha

update a window with tkinter ...

2006-07-27 Thread Laurent Hermann
Hi I'm new on this list so let me say hello to everybody.I have a little problem with tkinter but I could not find the solution on the net so I ask it here...The thing I want to do is simple but I cannot, I would like to have a tkinter window that update itself during the program is running, I crea

Re: how best to check a value? (if/else or try/except?)

2006-07-27 Thread John McMonagle
On Thu, 2006-07-27 at 20:44 +, John Salerno wrote: > My code is below. The main focus would be on the OnStart method. I want > to make sure that a positive integer is entered in the input box. At > first I tried an if/else clause, then switched to try/except. Neither is > perfect yet, but I

Re: ImportError: libclntsh.so.10.1: cannot open shared object file: Permission denied

2006-07-27 Thread dccarson
I have a similar question (importing cx_Oracle, but not related to cron). I would like to use solution #2 below and it does not work. If I set LD_LIBRARY_PATH before running python, it works. If I try to set it via os.environ, it does not work. I have tried this in an interactive Python shell.

Re: using names before they're defined

2006-07-27 Thread davehowey
> > Hiya, you might be interested in this alternative config parsing > > program: > > http://www.voidspace.org.uk/python/configobj.html > > Yes, I know it. But I don't like it. Either a simple ini file do the > trick, or I need a full blown app-specific DSL - which can be as simple > as a Python f

Re: New release of Diet Python (0.2 Beta)!!!

2006-07-27 Thread Istvan Albert
The Eternal Squire wrote: > A developer's installation of PSF, including Pywin, WxPython, Numpy, > Scipy I believe can run up to 300 MB, no? you're missing the point, no one forces you to install all these, also it is very unlikely that someone would have these unless they needed them. -- http:

Re: Intermittent "permission denied" errors when using os.rename and a recently deleted path??

2006-07-27 Thread Russell Warren
> Does it actually tell you the target is the problem? I see an > "OSError: [Errno 17] File exists" for that case, not a permission error. > A permission error could occur, for example, if GDS has the source open > or locked when you call os.rename. No it doesn't tell me the target is the issu

Re: Process files in order

2006-07-27 Thread bearophileHUGS
A possibility: import os _, _, file_names = os.walk("").next() print sorted(file_names, key=lambda fn: os.stat(fn)[8]) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

class variables

2006-07-27 Thread Andre Meyer
Hi allI am trying to understand the magic of Python's class variables and tried the following code (see below).Just out of curiosity, I tried to define a property that provides access to a seemingly instancae variable which is in fact a class variable. All seems to work fine (case 4), but when a cu

class variables

2006-07-27 Thread Andre Meyer
Hi allI am trying to understand the magic of Python's class variables and tried the following code (see below).Just out of curiosity, I tried to define a property that provides access to a seemingly instancae variable which is in fact a class variable. All seems to work fine (case 4), but when a cu

Re: how best to check a value? (if/else or try/except?)

2006-07-27 Thread Nick Vatamaniuc
John, The way I do it is, is I ask myself 'is there a more common (basic) base between the code paths or do they both have about a 50/50 chance on average?' or 'will one code path be taken during an error and the other one during the normal processing?'. If there is a clear single common/usual/b

Re: Process files in order

2006-07-27 Thread Bruno Desthuilliers
Khoa Nguyen a écrit : > Hi, > > I have a requirement to process all files in a directory in > chronological order. Access time, modification time ? Ascending, descending ?-) > The os.listdir() function, however, lists the > files in random order. Is there a similar function in Python that > allo

Re: pysqlite2 fetching from select different than pysqlite?

2006-07-27 Thread schwehr
Dennis Lee Bieber wrote: > cursor.description -- after an .execute() has selected data. Thanks Dennis, The desciription works, but gives some funky results, but with python it is not a big deal. cu.description (('activity_id', None, None, None, None, None, None), ('case_id', None, None

Re: How do you implement this Python idiom in C++

2006-07-27 Thread alainpoint
Noah Roberts wrote: > What happens if you print Parent.getcount() now? You still get 2 since there is no new instance of Parent that was created. Alain -- http://mail.python.org/mailman/listinfo/python-list

Re: New release of Diet Python (0.2 Beta)!!!

2006-07-27 Thread Georg Brandl
The Eternal Squire wrote: > A developer's installation of PSF, including Pywin, WxPython, Numpy, > Scipy I believe can run up to 300 MB, no? > > Otherwise, I'll put up a different percentage. Well, if you refer to a Python installation including all these packages (anyway, I don't think it would

how best to check a value? (if/else or try/except?)

2006-07-27 Thread John Salerno
My code is below. The main focus would be on the OnStart method. I want to make sure that a positive integer is entered in the input box. At first I tried an if/else clause, then switched to try/except. Neither is perfect yet, but I was wondering which I should try for in the first place. I fig

Re: Process files in order

2006-07-27 Thread Mike Kent
How about using os.listdir to build a list of filenames, then sorting them by modification time (via os.stat)? -- http://mail.python.org/mailman/listinfo/python-list

Re: New release of Diet Python (0.2 Beta)!!!

2006-07-27 Thread The Eternal Squire
A developer's installation of PSF, including Pywin, WxPython, Numpy, Scipy I believe can run up to 300 MB, no? Otherwise, I'll put up a different percentage. Georg Brandl wrote: > The Eternal Squire wrote: > > > Diet Python is a flavor of Python with allegro, multiarray, umath, > > calldll, npstr

Re: Process files in order

2006-07-27 Thread Yu-Xi Lim
Khoa Nguyen wrote: > I have a requirement to process all files in a directory in > chronological order. The os.listdir() function, however, lists the > files in random order. Is there a similar function in Python that > allows me to specify the listing order (like ls -t for example)? There is no s

Re: How do you implement this Python idiom in C++

2006-07-27 Thread Noah Roberts
[EMAIL PROTECTED] wrote: > Rob Williscroft wrote: > > > If this is more than idle curiosity I strongly suggest you post > > a version of the python code you need to translate to C++. > > For the moment this is just healthy curiosity but i will still post the > code i would like to see translated:

Re: help: output arrays into file as column

2006-07-27 Thread Bruno Desthuilliers
bei a écrit : Please don't top-post > Hi,Simon, > > Thanks for your reply.It's very helpful :) > But I am sorry for my given example.Actually, my data in the arrays are > all float point datas.And I use integer in the example.The code is like > this. > ("x,v,...,h" are floating point number arra

Re: Changing a value for each folder while traversing a file system

2006-07-27 Thread Peter Otten
PipedreamerGrey wrote: > That seems logical, but the syntax doesn't work. I keep getting the > error: > 'module object' has no attribute 'dirname' os.dirname() was a typo, try os.path.dirname(). Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Path

2006-07-27 Thread diffuser78
In my .basrc file I commented the line of ActivePyton and after reboot everything is fine now. I can use Python 2.4.3 even on console and SPE both. thanks [EMAIL PROTECTED] wrote: > I have two python 2.4s on my Ubuntu Linux box. One is Python 2.4.2 and > other is Python 2.4.3. I use SPE as an

Re: Nested function scope problem

2006-07-27 Thread Bruno Desthuilliers
Gerhard Fiedler a écrit : > On 2006-07-27 14:15:34, Dennis Lee Bieber wrote: > > >>>In a language like C the name doesn't hold anything either. The name is >>>just a way for refering to a memory space which will hold something. >>> >> >> Except for one difference... In C (and most other lan

Re: How do you implement this Python idiom in C++

2006-07-27 Thread alainpoint
Rob Williscroft wrote: > If this is more than idle curiosity I strongly suggest you post > a version of the python code you need to translate to C++. For the moment this is just healthy curiosity but i will still post the code i would like to see translated: class Parent: count=0

Re: Automate Mozilla Firefox

2006-07-27 Thread John J. Lee
"Paul Boddie" <[EMAIL PROTECTED]> writes: [...] > Well, PyXPCOM didn't support out-of-process automation last time I > checked, and I haven't read anything on the PyXPCOM list [1] that would > suggest otherwise. Meanwhile, there is support for automation of [...] http://groups.google.co.uk/group/m

Re: New release of Diet Python (0.2 Beta)!!!

2006-07-27 Thread Georg Brandl
The Eternal Squire wrote: > Diet Python is a flavor of Python with allegro, multiarray, umath, > calldll, npstruct and curses builtin, all else nonessential to language > > ripped out. Total size < 3MB, 1% of PSF Python. Diet Python helps keep > clients thin :) Erm... Which "PSF Python" are you

Re: Nested function scope problem

2006-07-27 Thread Bruno Desthuilliers
Gerhard Fiedler a écrit : > On 2006-07-25 13:33:40, Dennis Lee Bieber wrote: > > >>>Surprising for me are actually two things: 1- the fact itself, and 2- that >>>term "binding", and that whatever it means (I'll have to read more on that, >>>now that I know the term) is different for read-only and

Re: Simulate input to another program

2006-07-27 Thread Antoon Pardon
On 2006-07-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So there is no easy built in way to do this? Depends on what you mean by easy. A look at the pty module may help. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested function scope problem

2006-07-27 Thread Bruno Desthuilliers
Gerhard Fiedler a écrit : > On 2006-07-27 13:44:29, Bruno Desthuilliers wrote: > > >>What bother me with the "hold" term is that I understand it as meaning >>that the name is some kind of container by itself - which it is not. >>Consider the following: >> >>d = dict() >>d['name'] = 'parrot' >> >>

Re: How to force a thread to stop

2006-07-27 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: > > Whether this solves the questioner's problems remains to be seen, but > > issues of handling SSH-based communications streams do seem to be > > addressed. > > Actually I don't understand the need for SSH. This is traffic over a > LA

Process files in order

2006-07-27 Thread Khoa Nguyen
Hi, I have a requirement to process all files in a directory in chronological order. The os.listdir() function, however, lists the files in random order. Is there a similar function in Python that allows me to specify the listing order (like ls -t for example)? Thanks, Khoa -- http://mail.python

Re: Python Path

2006-07-27 Thread John Salerno
[EMAIL PROTECTED] wrote: > I want to get rid of ActivePython which I happend to install because I > was trying to Test the IDE by ActiveState and I think this version of > Python was installed by it. > > I am happy using Python 2.4.3 but there is not way I am being able to > use it on console.

Re: Nested function scope problem

2006-07-27 Thread Bruno Desthuilliers
Antoon Pardon a écrit : > On 2006-07-27, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: >> >>>On 2006-07-27, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >>> >> >>(snip) >> >>It can only take you so far. Now it's time you know the truth: there are >>*no* 'variabl

Re: Threads vs Processes

2006-07-27 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > Carl J. Van Arsdall wrote: > [...] > >> I actually do use pickle (not for this, but for other things), could you >> elaborate on the safety issue? >> > > >From http://docs.python.org/lib/node63.html : > > Warning: The pickle module is not intended to be secure

Re: How to force a thread to stop

2006-07-27 Thread Carl J. Van Arsdall
Paul Rubin wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: > >> Whether this solves the questioner's problems remains to be seen, but >> issues of handling SSH-based communications streams do seem to be >> addressed. >> > > Actually I don't understand the need for SSH. This is traffic o

Re: Nested function scope problem

2006-07-27 Thread Gerhard Fiedler
On 2006-07-27 14:15:34, Dennis Lee Bieber wrote: >> In a language like C the name doesn't hold anything either. The name is >> just a way for refering to a memory space which will hold something. >> > Except for one difference... In C (and most other languages) that > memory space is FIXED

Python Path

2006-07-27 Thread diffuser78
I have two python 2.4s on my Ubuntu Linux box. One is Python 2.4.2 and other is Python 2.4.3. I use SPE as an IDE for coding. I have written a small app in wxPython. If I run it from SPE it just works fine, but if I run it from console it gives me import wx eror. Following is the log which you mi

Re: How to force a thread to stop

2006-07-27 Thread Paul Rubin
"Paul Boddie" <[EMAIL PROTECTED]> writes: > Whether this solves the questioner's problems remains to be seen, but > issues of handling SSH-based communications streams do seem to be > addressed. Actually I don't understand the need for SSH. This is traffic over a LAN, right? Is all of the LAN tr

Re: Threads vs Processes

2006-07-27 Thread bryanjugglercryptographer
Carl J. Van Arsdall wrote: [...] > I actually do use pickle (not for this, but for other things), could you > elaborate on the safety issue? >From http://docs.python.org/lib/node63.html : Warning: The pickle module is not intended to be secure against erroneous or maliciously constructed

Re: Simulate input to another program

2006-07-27 Thread 31337one
So there is no easy built in way to do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: help: output arrays into file as column

2006-07-27 Thread bei
Hi,Simon, Thanks for your reply.It's very helpful :) But I am sorry for my given example.Actually, my data in the arrays are all float point datas.And I use integer in the example.The code is like this. ("x,v,...,h" are floating point number arrays) pos=str(x) vel=str(v) ene=str(u) den=str(rho) p

Re: Simulate input to another program

2006-07-27 Thread TeCh
[EMAIL PROTECTED] wrote: > I am using a python script as a way to test another program that I have > written in C++. The program cannot be altered. It needs to stay the way > it is. > > I need to simulate a few keystrokes to the application while it is > running. The application uses number keys

Simulate input to another program

2006-07-27 Thread 31337one
Hello everyone, I am using a python script as a way to test another program that I have written in C++. The program cannot be altered. It needs to stay the way it is. I need to simulate a few keystrokes to the application while it is running. The application uses number keys and y and n to naviga

Re: How to find difference in years between two dates?

2006-07-27 Thread thebjorn
Bruno Desthuilliers wrote: > Which conversion ? How do you get the data ? as a datetime object ? as a > (y,m,d) tuple ? as a "y-m-d" string ? Else ? All input routines, whether they're from a web-form, database, command line, or anywhere else, only produce objects from the datetime module for cale

Re: Threads vs Processes

2006-07-27 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > Carl J. Van Arsdall wrote: > >> Ah, alright, I think I understand, so threading works well for sharing >> python objects. Would a scenario for this be something like a a job >> queue (say Queue.Queue) for example. This is a situation in which each >> process/thread n

Re: Nested function scope problem

2006-07-27 Thread Antoon Pardon
On 2006-07-27, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 27 Jul 2006 14:11:35 GMT, Antoon Pardon <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> In a language like C the name doesn't hold anything either. >> The name is just a way for refering to a memory space whic

Re: help: output arrays into file as column

2006-07-27 Thread Simon Forman
bei wrote: > Hi, > > I am trying to write several arrays into one file, with one arrays in > one column. Each array (column) is seperated by space. > ie. a=[1,2,3, 4] b=[5,6,7,8] c=[9,10,11,12] > 1 5 9 > 2 6 10 > 3 7 11 > 4 8 12 > > Now I use the function file.writelines(a), file.writelines

Re: import question on wx ?

2006-07-27 Thread Rob Williscroft
wrote in news:[EMAIL PROTECTED] in comp.lang.python: > > I think what you say makes perfect sense > > I am using 2.4.2 python (I typed pthon -V on console to get) > > How can I find what my SPE editor is using ? > Wherever you can run python you can find the version by running the following

Re: import question on wx ?

2006-07-27 Thread diffuser78
That right..on my console it shows python 2.4.2 and on SPE it shows 2.4.3. The wxPython is working fine in SPE i.e with Python 2.4.3. How can I make sure that when I type python on console I get the 2.4.3 ? Every help is greatly appreciated. Thanks John Salerno wrote: > [EMAIL PROTECTED] wrote

Re: Nested function scope problem

2006-07-27 Thread Antoon Pardon
On 2006-07-27, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> On 2006-07-27, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >> > (snip) >It can only take you so far. Now it's time you know the truth: there are >*no* 'variables' in Python (hence the term 'binding')

RE: How do you implement this Python idiom in C++

2006-07-27 Thread Ames Andreas
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] g] On Behalf Of [EMAIL PROTECTED] > Sent: Thursday, July 27, 2006 5:51 PM > Subject: How do you implement this Python idiom in C++ > > I am no C++ expert but i guess there might be some in the Python and > C++ news

Re: iter(callable, sentinel)

2006-07-27 Thread Simon Forman
Will McGugan wrote: > Hi, > > I've been using Python for years, but I recently encountered something > in the docs I wasnt familar with. That is, using two arguements for > iter(). Could someone elaborate on the docs and maybe show a typical use > case for it? > > > Thanks, > > Will McGugan > > --

Re: Threads vs Processes

2006-07-27 Thread Grant Edwards
On 2006-07-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> If you're sharing things, I would thread. I would not want to >> pay the expense of a process. > > This is generally a false cost. There are very few > applications where thread/process startup time is at all a > fast path, Even if i

Re: Threads vs Processes

2006-07-27 Thread bryanjugglercryptographer
Carl J. Van Arsdall wrote: > Ah, alright, I think I understand, so threading works well for sharing > python objects. Would a scenario for this be something like a a job > queue (say Queue.Queue) for example. This is a situation in which each > process/thread needs access to the Queue to get the

Re: Nested function scope problem

2006-07-27 Thread Gerhard Fiedler
On 2006-07-27 13:44:29, Bruno Desthuilliers wrote: > What bother me with the "hold" term is that I understand it as meaning > that the name is some kind of container by itself - which it is not. > Consider the following: > > d = dict() > d['name'] = 'parrot' > > Would you say that the string "na

Re: How do you implement this Python idiom in C++

2006-07-27 Thread Rob Williscroft
wrote in news:[EMAIL PROTECTED] in comp.lang.python: > #include > using namespace std; > > // A base class that provides counting > template class Counted { > static int count; > }; > > template int Counted::count = 0; > > // Curious class definitions > class CountedClass : public Counted

help: output arrays into file as column

2006-07-27 Thread bei
Hi, I am trying to write several arrays into one file, with one arrays in one column. Each array (column) is seperated by space. ie. a=[1,2,3, 4] b=[5,6,7,8] c=[9,10,11,12] 1 5 9 2 6 10 3 7 11 4 8 12 Now I use the function file.writelines(a), file.writelines(b), file.writelines(c). And th

Re: iter(callable, sentinel)

2006-07-27 Thread Simon Forman
Will McGugan wrote: > Hi, > > I've been using Python for years, but I recently encountered something > in the docs I wasnt familar with. That is, using two arguements for > iter(). Could someone elaborate on the docs and maybe show a typical use > case for it? > > > Thanks, > > Will McGugan > > --

New release of Diet Python (0.2 Beta)!!!

2006-07-27 Thread The Eternal Squire
What's new in this release? Release 0.2 has a reworked Python module interface to the _alpymodule. I believe it to be much more 'pythonic'. There's a lot less code to write just in order to make a simple example work. See the examples! I've dropped in th

Re: iter(callable, sentinel)

2006-07-27 Thread Simon Forman
Will McGugan wrote: > Hi, > > I've been using Python for years, but I recently encountered something > in the docs I wasnt familar with. That is, using two arguements for > iter(). Could someone elaborate on the docs and maybe show a typical use > case for it? > > > Thanks, > > Will McGugan > > --

  1   2   3   >