Re: advice needed for lazy evaluation mechanism

2009-11-11 Thread Dieter Maurer
Steven D'Aprano writes on 10 Nov 2009 19:11:07 GMT: > ... > > So I am trying to restructure it using lazy evaluation. > > Oh great, avoiding confusion with something even more confusing. Lazy evaluation may be confusing if it is misused. But, it may be very clear and powerful if used appropriat

Create video with text?

2009-11-11 Thread AK
Hi, what would be the best python package (or a framework that can be scripted in python) that can make a video with text moving around, jumping, zooming in/out and various other text effects? See the following link for an example: -- http://mail.py

Re: Python & Go

2009-11-11 Thread Mensanator
On Nov 12, 12:44�am, geremy condra wrote: > On Thu, Nov 12, 2009 at 12:27 AM, Mensanator wrote: > > On Nov 11, 9:56�pm, geremy condra wrote: > >> On Wed, Nov 11, 2009 at 9:00 PM, Mensanator wrote: > >> > On Nov 11, 6:53�pm, kj wrote: > >> >> I'm just learning about Google's latest: the GO (Go?

Re: Python & Go

2009-11-11 Thread Vincent Manis
On 2009-11-11, at 21:27, Mensanator wrote: >> Go doesn't support inheritance, so C++ is pretty much out. C >> is a lot closer, but still not all that close. OK, if that's the case (I haven't read the Go documents), then Go is nothing like Python, no matter how many or few semicolons there are in

Re: Python & Go

2009-11-11 Thread geremy condra
On Thu, Nov 12, 2009 at 12:27 AM, Mensanator wrote: > On Nov 11, 9:56 pm, geremy condra wrote: >> On Wed, Nov 11, 2009 at 9:00 PM, Mensanator wrote: >> > On Nov 11, 6:53 pm, kj wrote: >> >> I'm just learning about Google's latest: the GO (Go?) language. >> >> (e.g.http://golang.orgorhttp://www.

starting with python 3.1 vs 3.2, and "test_telnetlib"

2009-11-11 Thread Robert P. J. Day
a couple short questions. on my primary linux distro -- fedora -- python 2.x is going to be around for quite some time, but if some folks want to *start* programming in python, it seems reasonable to just co-install python 3.x and let them cut their teeth on that, invoking it with "python3". d

Re: Why Error is derived from EnvironmentError in shutil.py?

2009-11-11 Thread alex23
On Nov 12, 2:46 pm, Peng Yu wrote: > I see Error is derived from EnvironmentError in shutil.py. > > class Error(EnvironmentError): >     pass > > I'm wondering why EnvironmentError can not be raised directly. Why > Error is raised instead? This way you can explicitly trap on shutil.Error and not

Re: Python & Go

2009-11-11 Thread Mensanator
On Nov 11, 9:56 pm, geremy condra wrote: > On Wed, Nov 11, 2009 at 9:00 PM, Mensanator wrote: > > On Nov 11, 6:53 pm, kj wrote: > >> I'm just learning about Google's latest: the GO (Go?) language. > >> (e.g.http://golang.orgorhttp://www.youtube.com/watch?v=rKnDgT73v8s). > >> There are some disti

Re: New syntax for blocks

2009-11-11 Thread r
On Nov 11, 9:04 pm, Carl Banks wrote: (Carl's reply to Steven's comments...) > Well I don't just want to call a method, so I can't take that advice. > Some actions will do more than just to call a method. And I don't > want to scroll up or down ten screens to see what the actions > associated wi

Re: using inspect

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 18:15:22 -0800, Ethan Furman wrote: > Greetings! > > How wise is it to base code on inspect? Specifically on things like > live frames on the stack and whatnot. It occurs to me that this is > leaning towards implementation details, and away from pure, pristine > Python. > >

Re: Why Error is derived from EnvironmentError in shutil.py?

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 22:46:34 -0600, Peng Yu wrote: > I see Error is derived from EnvironmentError in shutil.py. > > class Error(EnvironmentError): > pass > > I'm wondering why EnvironmentError can not be raised directly. Why Error > is raised instead? Probably to do with the personal taste

Re: python simply not scaleable enough for google?

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 16:38:50 -0800, Vincent Manis wrote: > I'm having some trouble understanding this thread. My comments aren't > directed at Terry's or Alain's comments, but at the thread overall. > > 1. The statement `Python is slow' doesn't make any sense to me. Python > is a programming lang

Why Error is derived from EnvironmentError in shutil.py?

2009-11-11 Thread Peng Yu
I see Error is derived from EnvironmentError in shutil.py. class Error(EnvironmentError): pass I'm wondering why EnvironmentError can not be raised directly. Why Error is raised instead? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & Go

2009-11-11 Thread Carl Banks
On Nov 11, 7:56 pm, geremy condra wrote: > On Wed, Nov 11, 2009 at 9:00 PM, Mensanator wrote: > > On Nov 11, 6:53 pm, kj wrote: > >> I'm just learning about Google's latest: the GO (Go?) language. > >> (e.g.http://golang.orgorhttp://www.youtube.com/watch?v=rKnDgT73v8s). > >> There are some disti

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-11 Thread Tim Roberts
Ognjen Bezanov wrote: > >I'm trying to see if there is any way I can make Python share data >between two hosts using DMA transfers over a firewire connection, so >avoiding the need for another layer on top such as IPv4 + Python sockets. > >Thanks to some old python bindings which I updated to py

using inspect

2009-11-11 Thread Ethan Furman
Greetings! How wise is it to base code on inspect? Specifically on things like live frames on the stack and whatnot. It occurs to me that this is leaning towards implementation details, and away from pure, pristine Python. As an example, I have this routine in a module I'm working on: def

Re: Python & Go

2009-11-11 Thread geremy condra
On Wed, Nov 11, 2009 at 9:00 PM, Mensanator wrote: > On Nov 11, 6:53 pm, kj wrote: >> I'm just learning about Google's latest: the GO (Go?) language. >> (e.g.http://golang.orgorhttp://www.youtube.com/watch?v=rKnDgT73v8s). >> There are some distinctly Pythonoid features to the syntax, such >> as "

Re: python parser overridden by pymol

2009-11-11 Thread Dave Angel
Jeremiah wrote: Hello, I'm fairly new to python (version 2.5.4), and am writing a program which uses both pymol (version 1.2r1) and numpy (version 1.3.0) from debian. It appears that when I add pymol to $PYTHONPATH, that parser.expr() is no longer available, and so I am unable to use numpy.lo

Re: python parser overridden by pymol

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 17:41:07 -0800, Jeremiah wrote: > Hello, > > I'm fairly new to python (version 2.5.4), and am writing a program which > uses both pymol (version 1.2r1) and numpy (version 1.3.0) from debian. > > It appears that when I add pymol to $PYTHONPATH, that parser.expr() is > no longe

Re: python parser overridden by pymol

2009-11-11 Thread Robert Kern
Jeremiah wrote: However, a problem arises once $PYTHONPATH includes the pymol directory. To use the pymol api, I add the following to ~/.bashrc: PYMOL_PATH=/usr/lib/pymodules/python2.5/pymol export PYMOL_PATH PYTHONPATH=$PYMOL_PATH export PYTHONPATH Don't change your PYTHONPATH li

Re: python with echo

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 17:24:37 -0800, hong zhang wrote: > List, > > I have a question of python using echo. > > POWER = 14 > return_value = os.system('echo 14 > > /sys/class/net/wlan1/device/tx_power') > > can assign 14 to tx_power > > But > return_value = os.system('echo $POWER > > /sys/class/n

Re: New syntax for blocks

2009-11-11 Thread Carl Banks
On Nov 11, 4:12 pm, Steven D'Aprano wrote: > On Wed, 11 Nov 2009 03:52:45 -0800, Carl Banks wrote: > >> This is where a helper function is good. You want a dispatcher: > > > No I really don't.  I want to be able to see the action performed > > adjacent to the test, and not have to scroll up to dow

Re: python with echo

2009-11-11 Thread MRAB
hong zhang wrote: List, I have a question of python using echo. POWER = 14 return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') can assign 14 to tx_power But return_value = os.system('echo $POWER > /sys/class/net/wlan1/device/tx_power') return_value is 256 not 0. It c

Re: python with echo

2009-11-11 Thread Himanshu
2009/11/12 hong zhang : > List, > > I have a question of python using echo. > > POWER = 14 > return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') > > can assign 14 to tx_power > > But > return_value = os.system('echo $POWER > /sys/class/net/wlan1/device/tx_power') > > return_v

Re: Python & Go

2009-11-11 Thread Mensanator
On Nov 11, 6:53 pm, kj wrote: > I'm just learning about Google's latest: the GO (Go?) language. > (e.g.http://golang.orgorhttp://www.youtube.com/watch?v=rKnDgT73v8s). > There are some distinctly Pythonoid features to the syntax, such > as "import this_or_that", There's more to Python than import

python parser overridden by pymol

2009-11-11 Thread Jeremiah
Hello, I'm fairly new to python (version 2.5.4), and am writing a program which uses both pymol (version 1.2r1) and numpy (version 1.3.0) from debian. It appears that when I add pymol to $PYTHONPATH, that parser.expr() is no longer available, and so I am unable to use numpy.load(). I have looked

python with echo

2009-11-11 Thread hong zhang
List, I have a question of python using echo. POWER = 14 return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') can assign 14 to tx_power But return_value = os.system('echo $POWER > /sys/class/net/wlan1/device/tx_power') return_value is 256 not 0. It cannot assign 14 to tx

Re: installing lxml ?

2009-11-11 Thread 7stud
On Nov 11, 5:59 pm, 7stud wrote: > > 1) Maybe the installation instructions for mac osx should read: > > > Installation Instructions > > > MAC OS X: > We're not sure how mac osx works with easy_install.  Apple's system > installations of libxml and libxslt are pretty bad--and they a

Re: Aborting a read with pySerial

2009-11-11 Thread Aahz
In article <4af50316$0$1610$742ec...@news.sonic.net>, John Nagle wrote: > >I'm using pySerial to read from a serial port. One thread reads from >the port, with no timeout. Another thread handles output and other >tasks. This works fine until I want to shut down the program. I can't >reliably

Re: installing lxml ?

2009-11-11 Thread 7stud
On Nov 11, 1:37 pm, Terry Reedy wrote: > 7stud wrote: > > On Nov 11, 7:37 am, "Diez B. Roggisch" wrote: > >> And third, > >> there are limits to what extend one can anticipate the ineptness of > > Calling you inept was unnecessary, but > > >> others to read. The page you cite from starts with

Python & Go

2009-11-11 Thread kj
I'm just learning about Google's latest: the GO (Go?) language. (e.g. http://golang.org or http://www.youtube.com/watch?v=rKnDgT73v8s). There are some distinctly Pythonoid features to the syntax, such as "import this_or_that", the absence of parentheses at the top of flow control constructs, and

Re: python simply not scaleable enough for google?

2009-11-11 Thread Vincent Manis
On 2009-11-11, at 14:31, Alain Ketterlin wrote: > Terry Reedy writes: > >> I can imagine a day when code compiled from Python is routinely >> time-competitive with hand-written C. > > Have a look at > http://code.google.com/p/unladen-swallow/downloads/detail?name=Unladen_Swallow_PyCon.pdf&can=2&

Re: python simply not scaleable enough for google?

2009-11-11 Thread Peter Chant
Terry Reedy wrote: > I can imagine a day when code compiled from Python is routinely > time-competitive with hand-written C. In my very limited experience it was very informative programming in C for PIC microcontrollers and inspecting the assembly code produced. If I just threw together loops

Re: Most efficient way to "pre-grow" a list?

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 08:13:54 -0800, Francis Carr wrote: > Hmmm. I am trying some algorithms, and timeit reports that a > list.extend variant is fastest... WTH?! Really this seems like it must > be a "bug" in implementing the "[None]*x" idiom. > The straightforward "pythonic" solution is better

Re: New syntax for blocks

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 04:00:09 -0800, Carl Banks wrote: >> as has been posted before and again in a slightly different form in >> Steve's post. > > I'm well aware of it, but I didn't think the proposal deserved to be > called stupid when it was a reasonable solution to a real need, even > though a

Re: pythonw.exe under Windows-7 (Won't run for one admin user)

2009-11-11 Thread Rhodri James
On Wed, 11 Nov 2009 04:51:38 -, SD_V897 wrote: Rhodri James wrote: On Tue, 10 Nov 2009 15:39:46 -, SD_V897 wrote: No, I'm asking you -- or rather your admin user -- to invoke the program that is giving you grief from the command line, i.e. "python myscript.py", and tell me wha

Re: how to create a pip package

2009-11-11 Thread srid
On Nov 10, 8:25 pm, Phlip wrote: > On Nov 10, 3:11 pm, Wolodja Wentland > wrote: > > > The pip requirement file would contain the following line: > > > -e git+git://example.com/repo.git#egg=rep > > > I hope this answers your questions :-D > > Let me ask it like this. What happens when a user type

Re: Can't Write File

2009-11-11 Thread Rhodri James
On Wed, 11 Nov 2009 14:00:44 -, Victor Subervi wrote: 6) you don't indicate which user is executing this script (only root can write to it) Help me on this. All scripts are owned by root. Is it not root that is executing the script? Not unless your server setup is very, very stupid.

Re: How can a module know the module that imported it?

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 21:55:58 +, kj wrote: > With Perl one can set a module-global variable before the module is > loaded. This provides a very handy backdoor during testing. E.g. Any time somebody justifies a features as "a very handy backdoor", a billion voices cry out and then are suddenl

Re: How can a module know the module that imported it?

2009-11-11 Thread Christian Heimes
kj wrote: > Because the problem that gave rise to this question is insignificant. > I would want to know the answer in any case. *Can* it be done in > Python at all? > > OK, if you must know: > > With Perl one can set a module-global variable before the module > is loaded. This provides a very

Re: How can a module know the module that imported it?

2009-11-11 Thread Diez B. Roggisch
Because the problem that gave rise to this question is insignificant. I would want to know the answer in any case. *Can* it be done in Python at all? No. OK, if you must know: With Perl one can set a module-global variable before the module is loaded. This provides a very handy backdoor du

Re: python simply not scaleable enough for google?

2009-11-11 Thread Alain Ketterlin
Terry Reedy writes: > I can imagine a day when code compiled from Python is routinely > time-competitive with hand-written C. Have a look at http://code.google.com/p/unladen-swallow/downloads/detail?name=Unladen_Swallow_PyCon.pdf&can=2&q= Slide 6 is impressive. The bottom of slide/page 22 expla

Re: Threaded import hang in cPickle.dumps

2009-11-11 Thread Christian Heimes
Zac Burns wrote: > Using python 2.6 > > cPickle.dumps has an import which is causing my application to hang. > (figured out by overriding builtin.__import__ with a print and seeing > that this is the last line of code being run. I'm running > cPickle.dumps in a thread, which leads me to believe th

Re: How can a module know the module that imported it?

2009-11-11 Thread Ethan Furman
Aahz wrote: In article , kj wrote: The subject line says it all. You are probably trying to remove a screw with a hammer -- why don't you tell us what you really want to do and we'll come up with a Pythonic solution? Well, I don't know what kj is trying to do, but my project is another

Re: How can a module know the module that imported it?

2009-11-11 Thread kj
In a...@pythoncraft.com (Aahz) writes: >In article , kj wrote: >> >>The subject line says it all. >You are probably trying to remove a screw with a hammer Worse: I'm trying to write Perl using Python! >-- why don't you >tell us what you really want to do and we'll come up with a Pythonic >so

Re: Threaded import hang in cPickle.dumps

2009-11-11 Thread Antoine Pitrou
Le Tue, 10 Nov 2009 10:50:33 -0800, Zac Burns a écrit : > > cPickle.dumps has an import which is causing my application to hang. > (figured out by overriding builtin.__import__ with a print and seeing > that this is the last line of code being run. I'm running cPickle.dumps > in a thread, which le

Re: How can a module know the module that imported it?

2009-11-11 Thread Aahz
In article , kj wrote: > >The subject line says it all. You are probably trying to remove a screw with a hammer -- why don't you tell us what you really want to do and we'll come up with a Pythonic solution? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ [on o

Re: Securing a multiprocessing.BaseManager connection via SSL

2009-11-11 Thread Aahz
In article , Jonas wrote: > >how can I secure the communication between two BaseManager objects? >Regarding the socket/SSL documentation I just need to secure the socket >by SSL. How can i get the socket object within the multiprocessing >module? You'll need to create subclasses of the objects i

Re: Threaded import hang in cPickle.dumps

2009-11-11 Thread Zac Burns
On Tue, Nov 10, 2009 at 2:27 PM, Benjamin Peterson wrote: > Zac Burns gmail.com> writes: >> What can I do about this? > > Not run it in a thread. > > > > -- > http://mail.python.org/mailman/listinfo/python-list > Isn't requesting that pickle not be used in a thread a bit of a tall order? Just th

Re: installing lxml ?

2009-11-11 Thread Terry Reedy
7stud wrote: On Nov 11, 7:37 am, "Diez B. Roggisch" wrote: And third, there are limits to what extend one can anticipate the ineptness of Calling you inept was unnecessary, but others to read. The page you cite from starts with: You wrote " I'm trying to install lxml, but I can't figu

Re: CGI vs mod_python

2009-11-11 Thread Dave Angel
Victor Subervi wrote: The problem was not CGI. It turned out to be line-endings being mangled by Windoze and __invisible __ in my unix editor. Lovely. Thanks anyway, V That's twice you've blamed Windows for the line-ending problem. Windows didn't create those crlf endings, your text edit

Re: How to specify Python version in script?

2009-11-11 Thread kj
In Benjamin Kaplan writes: >On Wed, Nov 11, 2009 at 12:16 PM, kj wrote: >> >> >> >> >> I have a script that must be run with Python 2.6.x. =A0If one tries >> to run it with, say, 2.5.x, *eventually* it runs into problems and >> crashes. =A0(The failure is quicker if one attempts to run it with

Re: python simply not scaleable enough for google?

2009-11-11 Thread Terry Reedy
Robert P. J. Day wrote: http://groups.google.com/group/unladen-swallow/browse_thread/thread/4edbc406f544643e?pli=1 thoughts? Program_cost = human_writing&maintance_cost + running_cost*number_of_runs Nothing new here. The builtin types and many modules are written in C to reduce running cos

Re: Pause a script before termination

2009-11-11 Thread David
Il Wed, 11 Nov 2009 08:43:29 -0800 (PST), noydb ha scritto: > Hi All, > > I want to pause my script before it terminates, just so a user can > have a moment to read some print statements I include at the end. How > can this be accomplished? http://stackoverflow.com/questions/510357/python-read-

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 2:46 PM, Rami Chowdhury wrote: > Now, the problem is that it doesn't print the picture. It prints only the >> url. Please try: >> http://angrynates.com/stcroixresort/cart/getpic.py?w=1&i=1 >> Now, if I go into mysql and the correct database and enter: >> select pic1 from pr

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
Now, the problem is that it doesn't print the picture. It prints only the url. Please try: http://angrynates.com/stcroixresort/cart/getpic.py?w=1&i=1 Now, if I go into mysql and the correct database and enter: select pic1 from products where ID=1; it starts printing out all sorts of crap (indicati

Re: installing lxml ?

2009-11-11 Thread srid
On Nov 11, 6:54 am, 7stud wrote: > > Unfortunately, easy_install was not able to installlxml!  Here is the > output: > > --- > $ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/ > 2.6/bin/easy_installlxml > Password: > sudo: STATIC_DEPS=true: command not found > $ STATIC_DEPS=t

Re: Can't Write File

2009-11-11 Thread Victor Subervi
Never mind. It appears my old original file from a couple of years ago prints out the image nicely. Thanks all! V On Wed, Nov 11, 2009 at 2:26 PM, Victor Subervi wrote: > On Wed, Nov 11, 2009 at 1:20 PM, Benjamin Kaplan > wrote: > >> On Wed, Nov 11, 2009 at 11:42 AM, Victor Subervi >> wrote: >>

Re: installing lxml ?

2009-11-11 Thread srid
Much of these non-trivial build steps are abstracted in the ActiveState build repository. 1. Download ActivePython: http://www.activestate.com/activepython/ 2. Run "pypm install lxml" (on Mac, Linux or Windows) $ pypm install lxml Ready to perform these actions: The following packages will be ins

Re: New syntax for blocks

2009-11-11 Thread Terry Reedy
Steven D'Aprano wrote: Why is the third example, with an if... test, so special that it needs special syntax to make it a two-liner? ...because Beautiful is better than ugly. I can quote the Zen too: Special cases aren't special enough to break the rules. You haven't demonstrated that your

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 1:20 PM, Benjamin Kaplan wrote: > On Wed, Nov 11, 2009 at 11:42 AM, Victor Subervi > wrote: > > On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury < > rami.chowdh...@gmail.com> > > wrote: > >> > >> On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi > >> wrote: > >> > >>> On

Re: New syntax for blocks

2009-11-11 Thread Robert Latest
r wrote: > Just thinking out loud here...what if variable assignments could > return a value... hmmm? Not to them selfs of course but to a caller, > like an if statement... > > if a=openfile: > # do something with a That's like in C. I sometimes miss it in Python. robert -- http://mail.python.

Re: How to specify Python version in script?

2009-11-11 Thread Benjamin Kaplan
On Wed, Nov 11, 2009 at 1:28 PM, Javier Collado wrote: > Hello, > > If you are working on linux, you can change the shebang line from: > #!/usr/bin/python > > to: > #!/usr/bin/python2.6 > > Best regards, >    Javier > > P.S. If you just want to avoid python 3 while running the latest > python 2.x

Re: How to specify Python version in script?

2009-11-11 Thread Javier Collado
Hello, If you are working on linux, you can change the shebang line from: #!/usr/bin/python to: #!/usr/bin/python2.6 Best regards, Javier P.S. If you just want to avoid python 3 while running the latest python 2.x version, this should also work: #!/usr/bin/python2 2009/11/11 Benjamin Kapla

Re: Can't Write File

2009-11-11 Thread Benjamin Kaplan
On Wed, Nov 11, 2009 at 11:42 AM, Victor Subervi wrote: > On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury > wrote: >> >> On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi >> wrote: >> >>> On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: >>> Victor Subervi wrote: >> Wrong? 2)

Re: How to specify Python version in script?

2009-11-11 Thread Benjamin Kaplan
On Wed, Nov 11, 2009 at 12:16 PM, kj wrote: > > > > > I have a script that must be run with Python 2.6.x.  If one tries > to run it with, say, 2.5.x, *eventually* it runs into problems and > crashes.  (The failure is quicker if one attempts to run it with > Python 3.x.) > > Is there some way to sp

Re: Can't Write File

2009-11-11 Thread Carsten Haese
Victor Subervi wrote: > I will do that after I fix the problem "Doing that" is the fix. > No, this doesn't fix the problem! How do you know? You obviously haven't tried it, since you say you have yet to do it. -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailma

Re: How to specify Python version in script?

2009-11-11 Thread David Robinow
On Wed, Nov 11, 2009 at 12:16 PM, kj wrote: > > > > > I have a script that must be run with Python 2.6.x.  If one tries > to run it with, say, 2.5.x, *eventually* it runs into problems and > crashes.  (The failure is quicker if one attempts to run it with > Python 3.x.) > > Is there some way to sp

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 11:58 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Here's > > a bigger code snippet with the entire try clause: > > > > if 14 < x < 20: # This just shows that it's a pic, not some > > other type of data > > y += 1 > > w += 1 > >

ask a question about the module

2009-11-11 Thread leo zhao
when I run a program, it list the hint: Could not import module "Gnuplot" - it is not installed on your system. You need to install the Gnuplot.py package. \easyviz\gnuplot_.py(41) : Traceback (most recent call last): File "E:\study\python\commodity modle 10.23.py", line 3, in import mult

How to specify Python version in script?

2009-11-11 Thread kj
I have a script that must be run with Python 2.6.x. If one tries to run it with, say, 2.5.x, *eventually* it runs into problems and crashes. (The failure is quicker if one attempts to run it with Python 3.x.) Is there some way to specify at the very beginning of the script the acceptable ran

Re: Authentication session with urllib2

2009-11-11 Thread Ken Seehart
Jon Clements wrote: On 11 Nov, 07:02, Ken Seehart wrote: I'm having some difficulty implementing a client that needs to maintain an authenticated https: session. I'd like to avoid the approach of receiving a 401 and resubmit with authentication, for two reasons: 1. I control the

RE: Pause a script before termination

2009-11-11 Thread baboucarr sanneh
$LIM $...@dy > From: jenn.du...@gmail.com > Subject: Re: Pause a script before termination > Date: Wed, 11 Nov 2009 08:47:05 -0800 > To: python-list@python.org > > On Nov 11, 11:43 am, noydb wrote: > > Hi All, > > > > I want to pause my script before it terminates, just so a user can > > h

Re: Pause a script before termination

2009-11-11 Thread Gary Herron
noydb wrote: Hi All, I want to pause my script before it terminates, just so a user can have a moment to read some print statements I include at the end. How can this be accomplished? Thanks! If your IO is to/from a command line window, try this: raw_input('Hit ENTER to exit: ') Gary Her

Re: Pause a script before termination

2009-11-11 Thread Philip Semanchuk
On Nov 11, 2009, at 11:47 AM, noydb wrote: On Nov 11, 11:43 am, noydb wrote: Hi All, I want to pause my script before it terminates, just so a user can have a moment to read some print statements I include at the end. How can this be accomplished? Thanks! Never mind, duh, found my ans

Re: Can't Write File

2009-11-11 Thread Carsten Haese
Victor Subervi wrote: > Here's > a bigger code snippet with the entire try clause: > > if 14 < x < 20: # This just shows that it's a pic, not some > other type of data > y += 1 > w += 1 > try: # It does this, because I've printed 'getpic1.py' etc. >

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
On Wed, 11 Nov 2009 08:42:27 -0800, Victor Subervi wrote: On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury wrote: On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi < victorsube...@gmail.com> wrote: On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: Victor Subervi wrote: Wrong?

Re: Pause a script before termination

2009-11-11 Thread noydb
On Nov 11, 11:43 am, noydb wrote: > Hi All, > > I want to pause my script before it terminates, just so a user can > have a moment to read some print statements I include at the end.  How > can this be accomplished? > > Thanks! Never mind, duh, found my answer now import time time.sleep(10) #10

Pause a script before termination

2009-11-11 Thread noydb
Hi All, I want to pause my script before it terminates, just so a user can have a moment to read some print statements I include at the end. How can this be accomplished? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury wrote: > On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi < > victorsube...@gmail.com> wrote: > > On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: >> >> Victor Subervi wrote: >>> >> > Wrong? >>> >>> 2) you don't show the error traceback >>>

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi wrote: On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: Victor Subervi wrote: Wrong? 2) you don't show the error traceback because there are none try: # It does this, because I've printed 'getpic1.py' etc.

Re: Most efficient way to "pre-grow" a list?

2009-11-11 Thread Francis Carr
Hmmm. I am trying some algorithms, and timeit reports that a list.extend variant is fastest... WTH?! Really this seems like it must be a "bug" in implementing the "[None]*x" idiom. As expected, appending one-at-a-time is slowest (by an order of magnitude): % python -m timeit -s "N=100" \

win32com IE interface PAMIE javascript click

2009-11-11 Thread elca
Hello, these day im making some script. i have encounter some problem with my script work. problem is i want to click emulate javascript on following site. http://news.naver.com/main/presscenter/category.nhn this site is news site. and everyday news content also changed, but javascript is not

Re: installing lxml ?

2009-11-11 Thread Stefan Behnel
7stud, 11.11.2009 16:12: > On Nov 11, 7:37 am, "Diez B. Roggisch" wrote: >> And third, >> there are limits to what extend one can anticipate the ineptness of >> others to read. The page you cite from starts with: >> >>For special installation instructions regarding MS Windows and >> MacOS-X, s

Re: Basic list/dictionary question

2009-11-11 Thread Mick Krippendorf
Ralax wrote: > On Nov 11, 8:58 pm, Chris Rebert wrote: >> In [2]: def foo(z, a=[]): >>...: a.append(z) >>...: return a >>...: >> >> In [3]: foo(1) >> Out[3]: [1] >> >> In [4]: foo(2) >> Out[4]: [1, 2] >> >> In [5]: foo(2) >> Out[5]: [1, 2, 2] >> >> In [6]: foo(3) >> Out[6]: [1,

Re: installing lxml ?

2009-11-11 Thread 7stud
On Nov 11, 7:37 am, "Diez B. Roggisch" wrote: > And third, > there are limits to what extend one can anticipate the ineptness of > others to read. The page you cite from starts with: > >    For special installation instructions regarding MS Windows and > MacOS-X, see below. > > And below you find

Re: installing lxml ?

2009-11-11 Thread Benjamin Kaplan
On Wed, Nov 11, 2009 at 9:23 AM, Diez B. Roggisch wrote: > Chris Rebert schrieb: >> >> On Wed, Nov 11, 2009 at 4:49 AM, 7stud wrote: >>> >>> I'm trying to install lxml, but I can't figure out the installation >>> instructions.  Here: >>> >>> http://codespeak.net/lxml/installation.html >>> >>> it

Re: installing lxml ?

2009-11-11 Thread 7stud
On Nov 11, 6:31 am, Jussi Piitulainen wrote: > 7stud writes: > > I'm trying to install lxml, but I can't figure out the installation > > instructions.  Here: > ... > > My os is mac os x 10.4.11.   But this: > > > STATIC_DEPS=true easy_install lxml > > > is not a valid command: > > > $ sudo STATIC_

Re: installing lxml ?

2009-11-11 Thread Benjamin Kaplan
On Wed, Nov 11, 2009 at 7:49 AM, 7stud wrote: > I'm trying to install lxml, but I can't figure out the installation > instructions.  Here: > > http://codespeak.net/lxml/installation.html > > it says: > > 1) Get the easy_install tool. > > Ok, I went to the easy_install website, downloaded, and inst

Re: PyQt 2 Exe

2009-11-11 Thread Benjamin Kaplan
On Wed, Nov 11, 2009 at 8:29 AM, baboucarr sanneh wrote: > Hi guys, > > I wan to make a gui app using pyqt so i have done some thing already now i > want to save it as an exe file so that i can give it out to users who dont > have pyqt installed  (windows users)..Please help me out on this one..th

Re: installing lxml ?

2009-11-11 Thread Diez B. Roggisch
7stud schrieb: I'm trying to install lxml, but I can't figure out the installation instructions. Here: http://codespeak.net/lxml/installation.html it says: 1) Get the easy_install tool. Ok, I went to the easy_install website, downloaded, and installed it. The last two lines of the output dur

Re: Unexpected python exception

2009-11-11 Thread Richard Purdie
On Wed, 2009-11-11 at 05:04 -0800, Chris Rebert wrote: > On Wed, Nov 11, 2009 at 4:37 AM, Richard Purdie wrote: > > > Is there a way to make the "global x" apply to all functions without > > adding it to each one? > > Thankfully, no. Hmm :(. > > What I'm trying to do is to avoid having "import

Re: PyQt 2 Exe

2009-11-11 Thread Jorge
search the web, find the sites and follow the instructions. On Wed, Nov 11, 2009 at 2:11 PM, baboucarr sanneh wrote: > > How can i use it ? > > *$LIM $...@dy* > > > > > -- > Date: Wed, 11 Nov 2009 14:07:47 + > Subject: Re: PyQt 2 Exe > From: starglider...@gmail.co

Re: installing lxml ?

2009-11-11 Thread Diez B. Roggisch
Chris Rebert schrieb: On Wed, Nov 11, 2009 at 4:49 AM, 7stud wrote: I'm trying to install lxml, but I can't figure out the installation instructions. Here: http://codespeak.net/lxml/installation.html it says: 1) Get the easy_install tool. My os is mac os x 10.4.11. I would recommend in

Re: Unexpected python exception

2009-11-11 Thread Ralax
On Nov 11, 6:59 pm, Richard Purdie wrote: > I've been having problems with an unexpected exception from python which > I can summarise with the following testcase: > > def A(): >     import __builtin__ >     import os > >     __builtin__.os = os > > def B(): >     os.stat("/") >     import os > >

Re: Basic list/dictionary question

2009-11-11 Thread Ralax
On Nov 11, 8:58 pm, Chris Rebert wrote: > On Wed, Nov 11, 2009 at 4:16 AM, Daniel Jowett > wrote: > > Greetings, > > > I'm trying to categorize items in a list, by copying them into a > > dictionary... > > A simple example with strings doesn't seem to work how I'd expect: > > basket = ['app

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: > Victor Subervi wrote: > >> Hi; >> I've determined the problem in a script is I can't open a file to write >> it: >> script = open(getpic, "w") # where getpic is already defined >> Here are the permissions: >> -rwxr-xr-x 1 root root 4649 Nov

Re: installing lxml ?

2009-11-11 Thread Jussi Piitulainen
7stud writes: > I'm trying to install lxml, but I can't figure out the installation > instructions. Here: ... > My os is mac os x 10.4.11. But this: > > STATIC_DEPS=true easy_install lxml > > is not a valid command: > > $ sudo STATIC_DEPS=true easy_install lxml > Password: > sudo: STATIC_DEP

Re: Python C api: create a new object class

2009-11-11 Thread samwyse
On Nov 10, 1:09 pm, "lallous" wrote: > Hello > > I have 3 questions, hope someone can help: > > 1) > How can I create an instance class in Python, currently I do: > > class empty: >   pass > > Then anytime I want that class (which I treat like a dictionary): > > o = empty() > o.myattr = 1 > etc...

PyQt 2 Exe

2009-11-11 Thread baboucarr sanneh
Hi guys, I wan to make a gui app using pyqt so i have done some thing already now i want to save it as an exe file so that i can give it out to users who dont have pyqt installed (windows users)..Please help me out on this one..thnx Regards $LIM $...@dy

  1   2   >