Re: rstrip()

2010-07-19 Thread News123
Dennis Lee Bieber wrote: > On Sun, 18 Jul 2010 17:49:11 +0100, MRAB > declaimed the following in gmane.comp.python.general: > >> How about 'strip_str', 'lstrip_str' and 'rstrip_str', or something > > Not sure what the first would do... unless one is envisioning > > "abracadabra".str

Re: Difference between import in script and from interpreter

2010-07-19 Thread News123
Edward Diener wrote: > In a python script a: > > from xxx.yyy.zzz import aaa > > fails with the message: > > "ImportError: No module named xxx.yyy.zzz" > > but from within the python interpreter the same line succeeds. What > would be the causes of that ? > > From within the python interpreter

Emacs Time Line, Graphical Chart by Jamie Zawinski - Valuable Resource for Newbies - written: 8-Mar-1999, updated: 29-Oct-2007

2010-07-19 Thread bolega
Many newbies would find this one by Jamie Zawinski, of immense help http://www.jwz.org/doc/emacs-timeline.html written: 8-Mar-1999, updated: 29-Oct-2007 For more detail about the early days, please see Bernie Greenberg's paper, Multics Emacs: The History, Design and Implementation. I've drawn

Re: why is this group being spammed?

2010-07-19 Thread Stephen Hansen
On 7/17/10 10:01 PM, be.krul wrote: > why is this group being spammed? Because while God created the Internet, the Devil twisted it by creating spammers. What do you expect? Adam just didn't pay enough attention when Eve made him a waldorf salad; we descendants of Seth have gone and tried to devo

Re: Fascinating interview by Richard Stallman on Russia TV

2010-07-19 Thread Nick Keighley
On 18 July, 09:38, Emmy Noether wrote: > On Jul 18, 1:09 am, Nick <3-nos...@temporary-address.org.uk> wrote: > > Emmy Noether writes: > > > In this video, Stall man makes 4 promises to public but stalls on 2nd > > > of them. > > > I have no idea of the rights or wrongs of this case.  But I've

Re: Sharing: member type deduction for member pointers (Alf's device?)

2010-07-19 Thread Vladimir Jovic
Alf P. Steinbach /Usenet wrote: #include // PyWeakPtr, PyPtr, PyModule, PyClass using namespace progrock; namespace { using namespace cppy; struct Noddy { PyPtr first; PyPtr last; int number; Noddy( PyWeakPtr pySelf, PyPtr

Re: Sharing: member type deduction for member pointers (Alf's device?)

2010-07-19 Thread Alf P. Steinbach /Usenet
* Vladimir Jovic, on 19.07.2010 09:41: Alf P. Steinbach /Usenet wrote: #include // PyWeakPtr, PyPtr, PyModule, PyClass using namespace progrock; namespace { using namespace cppy; struct Noddy { PyPtr first; PyPtr last; int number;

Re: Fascinating interview by Richard Stallman on Russia TV

2010-07-19 Thread geremy condra
On Sun, Jul 18, 2010 at 7:53 AM, David Kastrup wrote: >    File: elisp,  Node: Writing Emacs Primitives,  Next: Object Internals,   > Prev: Memory Usage,  Up: GNU Emacs Internals > >    E.5 Writing Emacs Primitives >     > >    Lisp primitives are Lisp functions impl

Re: Difference between import in script and from interpreter

2010-07-19 Thread Jean-Michel Pichavant
Steven D'Aprano wrote: On Mon, 19 Jul 2010 00:53:56 -0400, Edward Diener wrote: In a python script a: from xxx.yyy.zzz import aaa fails with the message: "ImportError: No module named xxx.yyy.zzz" but from within the python interpreter the same line succeeds. What would be the causes of

how to copy and move file with its attribute?

2010-07-19 Thread oyster
I mean writeonly, hidden, system and so on attributes I use windows, but if possible, is there any method to do so in a crossplatfrom way? thanks -- http://mail.python.org/mailman/listinfo/python-list

Accumulate function in python

2010-07-19 Thread dhruvbird
Hello, I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] And would like to compute the cumulative sum of all the integers from index zero into another array. So for the array above, I should get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] What is the best way (or pythonic way) to get this. Re

Re: how to copy and move file with its attribute?

2010-07-19 Thread Peter Otten
oyster wrote: > I mean writeonly, hidden, system and so on attributes > > I use windows, but if possible, is there any method to do so in a > crossplatfrom way? I can't check, but shutil.copy2() may do what you want. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: how to copy and move file with its attribute?

2010-07-19 Thread Vlastimil Brom
2010/7/19 oyster : > I mean writeonly, hidden, system and so on attributes > > I use windows, but if possible, is there any method to do so in a > crossplatfrom way? > > thanks > -- > http://mail.python.org/mailman/listinfo/python-list > You may check to see several possibilities http://timgolden.

Re: Accumulate function in python

2010-07-19 Thread Nitin Pawar
Hi, you may want to do like this array=[0,1,2] sumArray = [] for element in range(0,len(array)): if element == 0 : sumArray.append(array[element]) else: sumArray.append((array[element] + sumArray[element-1])) and then you can recheck it Thanks, nitin On Mon, Jul 19, 20

Re: Accumulate function in python

2010-07-19 Thread Peter Otten
dhruvbird wrote: > I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > And would like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] > What is the best way (or pythonic

Re: Accumulate function in python

2010-07-19 Thread Vlastimil Brom
2010/7/19 dhruvbird : > Hello, >  I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] >  And would like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] >  What is the best way (or

Re: Accumulate function in python

2010-07-19 Thread Mick Krippendorf
Am 19.07.2010 13:18, dhruvbird wrote: > Hello, > I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > And would like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] > What

decimal.Decimal formatting

2010-07-19 Thread python
I have various decimals which eventually are written to an XML file. Requirements indicate a precision of 11. I am currently having some 'issues' with Decimal("0"). When using quantize(decimal.Decimal("1e-11")) the result is not 0.000, but 1e-11. Personally I agree 1e-11 is a better notati

CPython 3.1.1 docs error in noddy3 example?

2010-07-19 Thread Alf P. Steinbach /Usenet
"Extending and Embedding the Python Interpreter" §2.1.2, the noddy3 extension module example, uses "S" as format character for string arguments in its call to PyArg_ParseTupleAndKeywords. This causes Noddy to only accept bytes as arguments, instead of strings (format "U"). I suspect this is

Re: timing

2010-07-19 Thread Alex A.
You could use pycallgraph module Regards, Alex Abushkevich -- http://mail.python.org/mailman/listinfo/python-list

Different python versions confusion under Windows Vista x64

2010-07-19 Thread Edward Diener
In Windows Vista x64 I have installed python 2.6 64-bit version and python 3.1 64-bit version to separate folders. Within the command interpreter I add python 2.6 to the PATH. In the command interpreter, When I type python somescript.py with an import sys print (sys.version) in the script, it

Re: Different python versions confusion under Windows Vista x64

2010-07-19 Thread Alf P. Steinbach /Usenet
* Edward Diener, on 19.07.2010 14:53: In Windows Vista x64 I have installed python 2.6 64-bit version and python 3.1 64-bit version to separate folders. Within the command interpreter I add python 2.6 to the PATH. In the command interpreter, When I type python somescript.py with an import sys p

Re: [ANN] Lupa 0.6 - Lua in Python

2010-07-19 Thread Fabrizio Milo aka misto
This is very very interesting. Do you have any direct application of it ? I know games like World of Warcraft uses Lua as scripting language. Thanks. Fabrizio -- Luck favors the prepared mind. (Pasteur) -- http://mail.python.org/mailman/listinfo/python-list

Re: Accumulate function in python

2010-07-19 Thread Andre Alexander Bell
On 07/19/2010 01:18 PM, dhruvbird wrote: > Hello, > I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > And would like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] > Wh

ANN: pyTenjin 0.9.0 - very fast and full-featured template engine

2010-07-19 Thread Makoto Kuwata
I released pyTenjin 0.9.0 http://www.kuwata-lab.com/tenjin/ http://pypi.python.org/pypi/Tenjin/ This release contains a lot of enhancements and changes. Also you should read planned changes in the next release (1.0.0). See http://www.kuwata-lab.com/tenjin/pytenjin-users-guide.html#planned-change

Re: Accumulate function in python

2010-07-19 Thread Steven D'Aprano
On Mon, 19 Jul 2010 04:18:48 -0700, dhruvbird wrote: > Hello, > I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] And would > like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7

Re: decimal.Decimal formatting

2010-07-19 Thread Stefan Krah
pyt...@lists.fastmail.net wrote: > I have various decimals which eventually are written to an XML file. > Requirements indicate a precision of 11. I am currently having some > 'issues' with Decimal("0"). When using > quantize(decimal.Decimal("1e-11")) the result is not 0.000, but > 1e-11.

Re: Fascinating interview by Richard Stallman at KTH on emacs history and internals

2010-07-19 Thread Pascal J. Bourguignon
Kenneth Tilton writes: > What we do not have is any interesting amount of "free as in speech" > software, because no one uses the GPL. I do. So far, I resist to calls to put my software in a less freedom-promoting license. Hey everybody! Switch from MIT or BSD to GPL! Now! -- __Pascal Bo

Email für Dich

2010-07-19 Thread Wolfgang Meiners
Liebe Kirsten, ich liebe dich und freue mich, dass du bald auch Ferien hast. Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

Re: Accumulate function in python

2010-07-19 Thread Brian Victor
dhruvbird wrote: > Hello, > I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > And would like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] > What is the best way (or p

Re: Email für Dich

2010-07-19 Thread Deadly Dirk
On Mon, 19 Jul 2010 17:52:56 +0200, Wolfgang Meiners wrote: > Liebe Kirsten, > > ich liebe dich und freue mich, dass du bald auch Ferien hast. > > Wolfgang Und die ganze Python gruppe liebt dich auch. -- The missionaries go forth to Christianize the savages - as if the savages weren't dang

mod_python load cx_Oracle error

2010-07-19 Thread li wang
It's quite weird when I import cx_Oracle in python interactive shell, it works perfectly. but when I import cx_Oracle in a *,py script, handled by mod_python.publisher, it keep reportint : ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory Can I anyone have

ANNOUNCING Tahoe, the Least-Authority File System, v1.7.1

2010-07-19 Thread Zooko O'Whielacronx
Folks: This innovative distributed filesystem is written entirely in Python. Well, actually we rely on some C/C++ extension code in Python packages like "zfec" and "pycryptopp" for some mathematical heavy lifting, but all of the code in the tahoe-lafs package is actually pure Python. Regards, Zo

Re: how to copy and move file with its attribute?

2010-07-19 Thread Alban Nona
Hello, About this one. I tried the os.system copy. But it seems I cant find the right syntax. *os.system ("xcopy /s %s %s" % (dirname1, dirname2))* This one seems to not working. Is there anyway I can do this way: localpath= c:\ networkpath=g:\ os.system("copy localpath networkpath) I tried

Re: how to copy and move file with its attribute?

2010-07-19 Thread MRAB
Alban Nona wrote: Hello, About this one. I tried the os.system copy. But it seems I cant find the right syntax. *os.system ("xcopy /s %s %s" % (dirname1, dirname2))* This one seems to not working. In what way doesn't it work? If the names contain spaces then you need to quote them: o

Re: Accumulate function in python

2010-07-19 Thread dhruvbird
On Jul 19, 9:12 pm, Brian Victor wrote: > dhruvbird wrote: > > Hello, > >   I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > >   And would like to compute the cumulative sum of all the integers > > from index zero into another array. So for the array above, I should > > get: [ 0, 1,

Re: Accumulate function in python

2010-07-19 Thread dhruvbird
On Jul 19, 4:28 pm, Peter Otten <__pete...@web.de> wrote: > dhruvbird wrote: > >   I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > >   And would like to compute the cumulative sum of all the integers > > from index zero into another array. So for the array above, I should > > get: [

Re: why is this group being spammed?

2010-07-19 Thread John Bokma
"be.krul" writes: > why is this group being spammed? Do you report those spammers? While Google is extremely lazy with dealing with spammers, if sufficient people report them action might be taken. Also make sure to report those spammers with their ISP; posts via GG contain the posting IP addre

CPython Signal Handler Check for SIGKILL

2010-07-19 Thread Scott McCarty
All, I just want to understand the C/Python piece better because I am writing a tutorial on signals and I am using python to demonstrate. I thought it would be fun to show that the SIGKILL is never processed, but instead python errors out. There is something in Python checking the SIGKILL signal h

Re: Accumulate function in python

2010-07-19 Thread Duncan Booth
dhruvbird wrote: > On Jul 19, 4:28 pm, Peter Otten <__pete...@web.de> wrote: >> dhruvbird wrote: >> >   I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] >> >   And would like to compute the cumulative sum of all the integers >> > from index zero into another array. So for the array ab

Re: how to copy and move file with its attribute?

2010-07-19 Thread Alban Nona
Hello Mrab, Thank you very much for this informations. Homever, Im still stuck with a problem: import os import sys import threading import shutil source= "C://Production//" dest= "D://Production//" os.system('xcopy /E /I /Q "%s" "%s"' % (source, dest)) It seems that it wont copy the files F

Re: CPython Signal Handler Check for SIGKILL

2010-07-19 Thread Thomas Jollans
On 07/19/2010 07:28 PM, Scott McCarty wrote: > All, I just want to understand the C/Python piece better because I am > writing a tutorial on signals and I am using python to demonstrate. I > thought it would be fun to show that the SIGKILL is never processed, but > instead python errors out. There

Re: CPython Signal Handler Check for SIGKILL

2010-07-19 Thread Antoine Pitrou
Hello, > I am not asking about the signals, I understand them, > I am asking about the registration of the SIGNAL handler and how it knows > that you are trying to register SIGKILL, you get an error like this. > > ./signal-catcher.py > Traceback (most recent call last): > File "./signal-catch

Re: how to copy and move file with its attribute?

2010-07-19 Thread MRAB
Alban Nona wrote: Hello Mrab, Thank you very much for this informations. Homever, Im still stuck with a problem: import os import sys import threading import shutil source= "C://Production//" dest= "D://Production//" os.system('xcopy /E /I /Q "%s" "%s"' % (source, dest)) It seems that it wo

Re: Fascinating interview by Richard Stallman at KTH on emacs history and internals

2010-07-19 Thread Rui Maciel
Kenneth Tilton wrote: > What we do not have is any interesting amount of "free as in speech" > software, because no one uses the GPL. You appear to be either confused or out of touch with reality. If that wasn't enough, your comment becomes a bit more amusing once we check your post's user age

Re: mod_python load cx_Oracle error

2010-07-19 Thread Mladen Gogala
On Mon, 19 Jul 2010 09:12:20 -0700, li wang wrote: > It's quite weird when I import cx_Oracle in python interactive shell, it > works perfectly. > but when I import cx_Oracle in a *,py script, handled by > mod_python.publisher, it keep reportint : > > ImportError: libclntsh.so.10.1: cannot open s

Re: why is this group being spammed?

2010-07-19 Thread Jia Hu
I use Gmail. When I receive spams, I will click "Report Spam". In addition, I will not empty the spam box of my email immediately. When I receive about 25 spams, I will click "Filter messages like these" to filter all the spams and let gmail automatically delete them. On Mon, Jul 19, 2010 at 1:

Re: CPython Signal Handler Check for SIGKILL

2010-07-19 Thread Scott McCarty
Yes, yes, thank you both. That is exactly what I didn't understand, I knew it was some how linked to the C library and wasn't exactly being handled or decided at the Python layer, I just didn't understand the C part good enough. I have found the CPython source code that checks. I see what you are s

Re: why is this group being spammed?

2010-07-19 Thread Nobody
On Sun, 18 Jul 2010 15:18:59 -0700, sturlamolden wrote: >> why is this group being spammed? > > There used to be bots that issued cancel messages against spam, but I > don't think they are actively maintained anymore. Mostly because cancel messages are invariably ignored nowadays. -- http://ma

Pyglet being extremely slow

2010-07-19 Thread Joshua Landau
I've just tried Pyglet on my computer, a lower-end laptop at that, and going though the Pyglet tutorials I've tried this: import pyglet > window = pyglet.window.Window() > @window.event def on_key_press(symbol, modifiers): print 'A key was pressed' > @window.event def on_draw():

Re: Accumulate function in python

2010-07-19 Thread Paul Rubin
Brian Victor writes: > def running_sum(result, current_value): > return result + [result[-1]+current_value if result else current_value] > > reduce(running_sum, x, []) That is not really any good because Python lists are actually vectors, so result+[...] actually copies the whole old list, ma

Re: how to copy and move file with its attribute?

2010-07-19 Thread Nobody
On Mon, 19 Jul 2010 17:57:31 +0100, MRAB wrote: >> About this one. I tried the os.system copy. But it seems I cant find the >> right syntax. >> >> *os.system ("xcopy /s %s %s" % (dirname1, dirname2))* >> >> This one seems to not working. >> > In what way doesn't it work? > > If the names cont

Re: CPython Signal Handler Check for SIGKILL

2010-07-19 Thread Nobody
On Mon, 19 Jul 2010 20:06:16 +0200, Antoine Pitrou wrote: > So, in short, Python doesn't check SIGKILL by itself. It's just > forbidden by the underlying C standard library, Actually, it's forbidden by the kernel. The C library just passes along the error to Python, which just passes it to the ap

Re: why is this group being spammed?

2010-07-19 Thread Jia Hu
Hi noboby: How can you make the current email and name hidden? On Mon, Jul 19, 2010 at 2:42 PM, Nobody wrote: > On Sun, 18 Jul 2010 15:18:59 -0700, sturlamolden wrote: > > >> why is this group being spammed? > > > > There used to be bots that issued cancel messages against spam, but I > > don't

ANN: PiCloud's Python Platform is now open to the Public!

2010-07-19 Thread Ken Elkabany
After 5 months in private beta, PiCloud, a cloud computing platform for the Python Programming Language, is now open to the general public. PiCloud enables Python users to leverage the power of an on-demand, high performance, and auto scaling compute cluster with as few as two lines of code! No ser

parmiko problem

2010-07-19 Thread George Trojan
(('alice', 22)) t.connect(username='gtrojan') # , password='a-passwd']) sftp = paramiko.SFTPClient.from_transport(t) sftp.close() t.close() results in the following output in /tmp/paramiko: DEB [20100719-19:58:22.497] thr=1 paramiko.transport: starting thread (client mo

Re: parmiko problem

2010-07-19 Thread George Trojan
miko') t = paramiko.Transport(('alice', 22)) t.connect(username='gtrojan') # , password='a-passwd']) sftp = paramiko.SFTPClient.from_transport(t) sftp.close() t.close() results in the following output in /tmp/paramiko: DEB [20100719-19:58:22.497] thr=1 paramiko.transport: star

Re: Different python versions confusion under Windows Vista x64

2010-07-19 Thread Edward Diener
On 7/19/2010 9:15 AM, Alf P. Steinbach /Usenet wrote: * Edward Diener, on 19.07.2010 14:53: In Windows Vista x64 I have installed python 2.6 64-bit version and python 3.1 64-bit version to separate folders. Within the command interpreter I add python 2.6 to the PATH. In the command interpreter,

Re: Accumulate function in python

2010-07-19 Thread Joel Goldstick
Peter Otten wrote: dhruvbird wrote: I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] And would like to compute the cumulative sum of all the integers from index zero into another array. So for the array above, I should get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] What is the best way (

How is memory managed in python?

2010-07-19 Thread Vishal Rana
Hi, In my web application (Django) I call a function for some request which loads like 500 MB data from the database uses it to do some calculation and stores the output in disk. I just wonder even after this request is served the apache / python process is still shows using that 500 MB, why is it

How to pass the shell in Python

2010-07-19 Thread Ranjith Kumar
Hi Folks, Can anyone tell me how to run shell commands using python script. -- Cheers Ranjith, http://ranjith10z.wordpress.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pass the shell in Python

2010-07-19 Thread MRAB
Ranjith Kumar wrote: Hi Folks, Can anyone tell me how to run shell commands using python script. Use the 'subprocess' module. -- http://mail.python.org/mailman/listinfo/python-list

Re: Different python versions confusion under Windows Vista x64

2010-07-19 Thread Edward Diener
On 7/19/2010 5:45 PM, Edward Diener wrote: On 7/19/2010 9:15 AM, Alf P. Steinbach /Usenet wrote: * Edward Diener, on 19.07.2010 14:53: In Windows Vista x64 I have installed python 2.6 64-bit version and python 3.1 64-bit version to separate folders. Within the command interpreter I add python 2

Re: How is memory managed in python?

2010-07-19 Thread Chris Rebert
On Mon, Jul 19, 2010 at 6:30 PM, Vishal Rana wrote: > Hi, > In my web application (Django) I call a function for some request which > loads like 500 MB data from the database uses it to do some calculation and > stores the output in disk. I just wonder even after this request is served > the apach