Re: "Deprecated sets module" with Python 2.6

2009-07-28 Thread Gabriel Genellina
En Tue, 28 Jul 2009 17:28:09 -0300, Virgil Stokes escribió: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process:

Re: bad certificate error

2009-07-28 Thread Gabriel Genellina
En Tue, 28 Jul 2009 09:02:40 -0300, Steven D'Aprano escribió: On Mon, 27 Jul 2009 23:16:39 -0300, Gabriel Genellina wrote: I don't see the point on "fixing" either the Python script or httplib to accomodate for an invalid server certificate... If it's just for internal testing, I'd use HTTP i

Re: need help using Tkinter

2009-07-28 Thread Manzur Ahmed
i figured it out. its actually because i'm using python 3.1. for python 3.0+, many of the packages are lowercased, tkinter being one of them and so thats why i wan getting a module not found error . . . thanks for getting back to me. manzur On Tue, Jul 28, 2009 at 8:06 PM, Jan Kaliszewski wro

Re: M2Crypto hangs on this URL

2009-07-28 Thread Heikki Toivonen
John Nagle wrote: > There's something strange about this URL: > > "https://sagar310.pontins.com/sraep/"; The following program finishes fine for me using M2Crypto 0.20beta1 + openssl 0.9.8g. Like Martin mentioned in another message, maybe someone fixed the site. from M2Crypto import SSL ctx = SS

simple splash screen?

2009-07-28 Thread NighterNet
I am trying to make a simple splash screen from python 3.1.Not sure where to start looking for it. Can any one help? -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression solution

2009-07-28 Thread Brian
On Tue, Jul 28, 2009 at 9:11 PM, tiefeng wu wrote: > 2009/7/29 Nobody : > >> The output should be something like > >> document.write("hello my name is 21c";) > > > > import re > > r = re.compile(r'"\s*\+\s*"') > > s = r'''document.write("h" +"e"+ "ll"+ "o"+ " m" +"y"+" > n"+"ame"+ > > "

Re: Regular expression solution

2009-07-28 Thread tiefeng wu
2009/7/29 Nobody : >> The output should be something like >> document.write("hello my name is  21c";) > > import re > r = re.compile(r'"\s*\+\s*"') > s = r'''document.write("h" +"e"+ "ll"+ "o"+ " m" +"y"+" n"+"ame"+ > " is  "+"21c";)''' > r.sub('', s) > Nobody's solution is good. here is m

Print value CLOB via cx_Oracle

2009-07-28 Thread Vincent Vega
Hi, I call function in Oracle database use cx_Oracle. In standard I define: db = cx_Oracle.connect(username, password, tnsentry) cursor = db.cursor() I create variable 'y' (result function 'fun_name') and call function 'fun_name': y = cursor.var(cx_Oracle.CLOB) cursor.callfunc(fun_name

Re: If Scheme is so good why MIT drops it?

2009-07-28 Thread Дамјан Георгиевски
> So do all these OSes have some kind of __mega_unifying_poll system > call that works for anything that might possibly block, that you can > exploit from a user process? On Linux at least, the select/poll/epoll is that system, the trick is to use eventfd, timerfd and signalfd which are Linux spe

Re: The longest word

2009-07-28 Thread NiklasRTZ
There were 3 solutions. Everybody's homework is someone's "what's this?" max('asdasfd faop29v8 asejrhjhw awg5w35g aw3g5aw3g kajhsdkfhlskjdhfakljsdhf awg3 aw3'.split(), key=len) sorted("a AAA aa a sdfsdfsdfsdf vv".split(' '),key=len)[-1] sorted("a AAA aa a vv".split(' '),lambda a,b: len

Re: Suggestions for Python MapReduce?

2009-07-28 Thread Phillip B Oldham
In answer to my own question, I came across Octo.py[1] today. Not tested/played-with/used it yet, however, though it seems simple enough. Still welcoming any suggestions for other/similar tools. [1] http://code.google.com/p/octopy/ -- http://mail.python.org/mailman/listinfo/python-list

Re: merge two png pic

2009-07-28 Thread Xavier Ho
On Wed, Jul 29, 2009 at 11:20 AM, cocobear wrote: > > >>> Image.new("RGB",(44544,38656)) > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1710, in > new >return Image()._new(core.fill(mode, size, color)) > MemoryError

merge two png pic

2009-07-28 Thread cocobear
This two png file has their own palette >>> im1.mode 'P' >>> im.mode 'P' >>> im.getpalette == im1.getpalette False I can use this code to merge two png pic together: Map = Image.new("RGB", (x,y)) Map.paste(im, box) Map.paste(im1,box) Map = Map.convert("L", optimize=True, palette=Image.ADAPTIVE)

Re: Regular expression solution

2009-07-28 Thread Nobody
On Tue, 28 Jul 2009 16:12:19 -0700, nickname wrote: > I'm a newbie with python. I am looking to write a regex > program which can take in a piece of text and remove some parts of it > and supply the remaining parts back. > > The input can be something like: > document.write("h" +"e"+

Re: New implementation of re module

2009-07-28 Thread MRAB
William Dode wrote: On 28-07-2009, MRAB wrote: With the official Python 2.6 distribution for Mac OS X it works. The source code is intended to replace the current 're' module in Python 2.7 (and I'll be porting it to Python 3.2), so I'm not that worried about Python versions earlier than 2.6 for

Re: bad certificate error

2009-07-28 Thread Nobody
On Tue, 28 Jul 2009 21:44:05 +0200, Piet van Oostrum wrote: >>j># cert_file is a PEM formatted certificate chain file. >>j>connection = httplib.HTTPSConnection(host, int(port), key_file, >>j> cert_file) > > What happens if you set cert_file to None? This would indicate tha

Re: xlrd - insert column?

2009-07-28 Thread John Machin
On Jul 29, 6:05 am, LeeRisq wrote: > Does xlrd have the capability to insert a column? No. If there was anything in the PyPI description, the README, or the docs that gave you the faintest hope that xlrd does anything other than read Excel files, please raise a documentation bug-fix request. Sta

Re: need help using Tkinter

2009-07-28 Thread Jan Kaliszewski
28-07-2009 o 17:17 Manzur Ahmed wrote: i wanted to ask you if one of you could help me to use Tkinter. i'm trying to just create a simple GUI for which I have provided the code for below. [snip] i tried to google search this and there were some threads that were saying to install tcl but t

Re: Semaphore Techniques

2009-07-28 Thread Carl Banks
On Jul 28, 3:15 pm, John D Giotta wrote: > I'm looking to run a process with a limit of 3 instances, but each > execution is over a crontab interval. I've been investigating the > threading module and using daemons to limit active thread objects, but > I'm not very successful at grasping the docum

Re: Semaphore Techniques

2009-07-28 Thread David Bolen
John D Giotta writes: > I'm looking to run a process with a limit of 3 instances, but each > execution is over a crontab interval. I've been investigating the > threading module and using daemons to limit active thread objects, but > I'm not very successful at grasping the documentation. > > Is i

Re: Semaphore Techniques

2009-07-28 Thread Philip Semanchuk
On Jul 28, 2009, at 7:19 PM, Christian Heimes wrote: John D Giotta schrieb: I'm looking to run a process with a limit of 3 instances, but each execution is over a crontab interval. I've been investigating the threading module and using daemons to limit active thread objects, but I'm not ver

Re: Extract images from PDF files

2009-07-28 Thread Xavier Ho
I've got a non-Python solution if you have Acrobat 6 or up. >From the menu, Advanced -> Document Processing -> Extract All Images... If you need multiple PDFs done, Batch Processing would be a great start. Then you can run another script to make the thumbnails, or use Photoshop. Either way works

Re: Semaphore Techniques

2009-07-28 Thread Christian Heimes
John D Giotta schrieb: > I'm looking to run a process with a limit of 3 instances, but each > execution is over a crontab interval. I've been investigating the > threading module and using daemons to limit active thread objects, but > I'm not very successful at grasping the documentation. > > Is i

Re: "Deprecated sets module" with Python 2.6

2009-07-28 Thread Steven D'Aprano
On Tue, 28 Jul 2009 22:28:09 +0200, Virgil Stokes wrote: > When using GUI2exe to create an *.exe I always get the following warning > during the compile process: > > C:\Python26\lib\site-packages\py2exe\build_exe.py:16: > DeprecationWarning: the sets module is deprecated > import sets The be

Re: New implementation of re module

2009-07-28 Thread Mark Lawrence
MRAB wrote: Hi all, I've been working on a new implementation of the re module. The details are at http://bugs.python.org/issue2636, specifically from http://bugs.python.org/issue2636#msg90954. I've included a .pyd file for Python 2.6 on Windows if you want to try it out. I'm interested in how

Questions on python 2.6.2 installed files

2009-07-28 Thread Weidong
I would like to build a python 2.6.2 for Linux that runs on arm-based embeded devices. After some experiment of building from the python 2.6.2 source, I notice that the installed files from "make install" are much too big for an embedded system. For example, the files it installs to /usr/local/li

Re: If Scheme is so good why MIT drops it?

2009-07-28 Thread magicus
On Tue, 28 Jul 2009 23:22:29 +0100, MRAB wrote: > magicus wrote: >> On Tue, 28 Jul 2009 16:11:02 +0100, MRAB >> wrote: >> >>> Hendrik van Rooyen wrote: On Monday 27 July 2009 16:49:25 Aahz wrote: > In article , > > Hendrik van Rooyen wrote: >> On Sunday 26 July 2009 21:26

Re: If Scheme is so good why MIT drops it?

2009-07-28 Thread MRAB
magicus wrote: On Tue, 28 Jul 2009 16:11:02 +0100, MRAB wrote: Hendrik van Rooyen wrote: On Monday 27 July 2009 16:49:25 Aahz wrote: In article , Hendrik van Rooyen wrote: On Sunday 26 July 2009 21:26:46 David Robinow wrote: I'm a mediocre programmer. Does this mean I should switch to

Semaphore Techniques

2009-07-28 Thread John D Giotta
I'm looking to run a process with a limit of 3 instances, but each execution is over a crontab interval. I've been investigating the threading module and using daemons to limit active thread objects, but I'm not very successful at grasping the documentation. Is it possible to do what I'm trying to

Re: FTP Offset larger than file.

2009-07-28 Thread Bakes
On Jul 28, 5:36 pm, Dave Angel wrote: > Bakes wrote: > > On 28 July, 15:18, Bakes wrote: > > >> On 28 July, 15:01, Hrvoje Niksic wrote: > > >>> Bakes writes: > > The error I get is: > ftplib.error_temp: 451-Restart offset 24576 is too large for file size > 22852. > 451 Resta

Re: "Deprecated sets module" with Python 2.6

2009-07-28 Thread Diez B. Roggisch
Virgil Stokes schrieb: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process: C:\Python26\lib\site-packages\py2exe\bui

Re: Questions about unicodedata in python 2.6.2

2009-07-28 Thread Weidong
On Jul 28, 12:37 pm, Christian Heimes wrote: > 'make install' shouldn't compile any libraries if you run 'make' prior > to 'make install'. I suggest you start again with a clean build tree of > Python 2.6.2. > > Christian You are perfectly right. I started everything again after a "make distclea

Re: C function taking double pointer to a structure variable as OUTPUT parameter

2009-07-28 Thread Diez B. Roggisch
fengmang_pyt...@sina.com schrieb: Hi, Everyone, I am a newbie to both Swig and Python. I am trying to export a set of C APIs to Python. If you are really dealing with a plain C-api, don't bother using SWIG - use ctypes. It comes with python >=2.5, is availabe as extra module for earlier ver

Re: If Scheme is so good why MIT drops it?

2009-07-28 Thread magicus
On Tue, 28 Jul 2009 16:11:02 +0100, MRAB wrote: > Hendrik van Rooyen wrote: >> On Monday 27 July 2009 16:49:25 Aahz wrote: >>> In article , >>> >>> Hendrik van Rooyen wrote: On Sunday 26 July 2009 21:26:46 David Robinow wrote: > I'm a mediocre programmer. Does this mean I should switc

Re: New implementation of re module

2009-07-28 Thread Aahz
In article , MRAB wrote: >Aahz wrote: >> In article , >> MRAB wrote: >>> I've been working on a new implementation of the re module. The details >>> are at http://bugs.python.org/issue2636, specifically from >>> http://bugs.python.org/issue2636#msg90954. I've included a .pyd file for >>> Python

Re: Override a method but inherit the docstring

2009-07-28 Thread Shai
On Jul 26, 6:55 pm, a...@pythoncraft.com (Aahz) wrote: > > Nice!  Maybe stick this on the Cookbook? http://code.activestate.com/recipes/576862/ Thanks for the suggestion, Shai. -- http://mail.python.org/mailman/listinfo/python-list

Re: need help using Tkinter

2009-07-28 Thread Mark Roseman
MRAB wrote: > Manzur Ahmed wrote: > > i wanted to ask you if one of you could help me to use Tkinter. i'm > > trying to just create a simple GUI for which I have provided the code > > for below. > There are some differences between Python 3.x and Python 2.x. In Python > 3.1 the module is called

Re: Need help in passing a "-c command" argument to the interactive shell.

2009-07-28 Thread Mark Lawrence
Bill wrote: On my windows box I type => c:\x>python -c "import re" The result is => c:\x> In other words, the Python interactive shell doesn't even open. What am I doing wrong? I did RTFM at http://www.python.org/doc/1.5.2p2/tut/node4.html on argument passing, but to no avail. You've told pyth

Re: "Deprecated sets module" with Python 2.6

2009-07-28 Thread MRAB
Virgil Stokes wrote: I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process: C:\Python26\lib\site-packages\py2exe\build

Re: xlrd - insert column?

2009-07-28 Thread Tino Wildenhain
LeeRisq wrote: Does xlrd have the capability to insert a column? rd means ReaD, so there is nothing it could insert something to. Of course once you have read the data you can manipulate its structure how you like it. The counterpart is xlwt and it can write excel files however you like it. R

Re: Need help in passing a "-c command" argument to the interactive shell.

2009-07-28 Thread Philip Semanchuk
On Jul 28, 2009, at 4:16 PM, Bill wrote: On my windows box I type => c:\x>python -c "import re" The result is => c:\x> In other words, the Python interactive shell doesn't even open. What am I doing wrong? Nothing! =) The -c option tells Python to execute the commands in the quotes as a P

"Deprecated sets module" with Python 2.6

2009-07-28 Thread Virgil Stokes
I would appreciate help on correcting a problem when trying to create an *.exe file using py2exe via GUI2exe with Python 2.6.2. When using GUI2exe to create an *.exe I always get the following warning during the compile process: C:\Python26\lib\site-packages\py2exe\build_exe.py:16: Deprecatio

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-28 Thread Ben
On Jul 22, 1:04 pm, davidj411 wrote: > i think "Piet van Oostrum" has resolved my issue. > good eyes! Well, he *is* Dutch... -Ben -- http://mail.python.org/mailman/listinfo/python-list

Re: Extract images from PDF files

2009-07-28 Thread writeson
David, Thanks for your reply, I'll take a look at pdftohtml and see if it suits my needs. Thanks! Doug -- http://mail.python.org/mailman/listinfo/python-list

Need help in passing a "-c command" argument to the interactive shell.

2009-07-28 Thread Bill
On my windows box I type => c:\x>python -c "import re" The result is => c:\x> In other words, the Python interactive shell doesn't even open. What am I doing wrong? I did RTFM at http://www.python.org/doc/1.5.2p2/tut/node4.html on argument passing, but to no avail. -- http://mail.python.org/mai

Re: New implementation of re module

2009-07-28 Thread William Dode
On 28-07-2009, MRAB wrote: > With the official Python 2.6 distribution for Mac OS X it works. >> > The source code is intended to replace the current 're' module in Python > 2.7 (and I'll be porting it to Python 3.2), so I'm not that worried > about Python versions earlier than 2.6 for testing, a

xlrd - insert column?

2009-07-28 Thread LeeRisq
Does xlrd have the capability to insert a column? -- http://mail.python.org/mailman/listinfo/python-list

instead of depending on data = array('h') .. write samples 1 by 1 to w = wave.open("wav.wav", "w")

2009-07-28 Thread '2+
it says Wave_write.writeframes(data) will that mean "from array import array" is a must? this does the job: import oil import wave from array import array a = oil.Sa() w = wave.open("current.wav", "w") w.setnchannels(2) w.setsampwidth(2) w.setframerate(44100) data = array('h') for gas in rang

[ANN] Pyjamas 0.6pre2 Python Web Widget Set and Javascript Compiler

2009-07-28 Thread Luke Kenneth Casson Leighton
http://pyjs.org this is a pre-release announcement, 0.6pre2, of the pyjamas widget set and python-to-javascript compiler. there are over 110 entries in the CHANGELOG since the last stable release, 0.5p1, and so it was deemed sensible to invite people to test this version before its next stable re

Re: bad certificate error

2009-07-28 Thread Piet van Oostrum
> jakecjacobson (j) wrote: >j> On Jul 28, 9:48 am, Jean-Paul Calderone wrote: >>> On Tue, 28 Jul 2009 03:35:55 -0700 (PDT), jakecjacobson >>> wrote: >>> > [snip] >>> >>> >"Invalid how?  Self signed certificate? Domain mismatch? Expired >>> >certificate?"  It is a server name mismatch. >>>

Re: Discovery IP in connection

2009-07-28 Thread Djames Suhanko
Thanks, all! I didn't tried to print addr. :-( sorry all. I'm learning python yet. Thanks again ! On Mon, Jul 27, 2009 at 8:23 PM, Piet van Oostrum wrote: >> Djames Suhanko (DS) wrote: > >>DS> Hello,all! >>DS>  I wrote a little programa that listening UDP packets. A can receive >>DS> the me

Re: If Scheme is so good why MIT drops it?

2009-07-28 Thread Dimiter "malkia" Stanev
Xah Lee wrote: PHP is functional. PHP is functional, as in "it functions!". PHP is not functional, as in "it ain't functions!" -- http://mail.python.org/mailman/listinfo/python-list

C function taking double pointer to a structure variable as OUTPUT parameter

2009-07-28 Thread fengmang_python
Hi, Everyone, I am a newbie to both Swig and Python. I am trying to export a set of C APIs to Python. My C function is int getInfor( char* name, int height, int weight, Infor** infor) //where infor is an OUTPUT parameter { .. *infor = (Infor*)malloc(sizeof(Infor)); .. }   The declare of

Re: Gracefully exiting CLI application

2009-07-28 Thread David
Il Tue, 28 Jul 2009 14:31:56 +0100, Nobody ha scritto: > Killed by what means? > > Ctrl-C sends SIGINT which is converted to a KeyboardInterrupt exception. > This can be caught, or if it's allowed to terminate the process, any exit > handlers registered via atexit.register() will be used. > > Fo

Re: M2Crypto hangs on this URL

2009-07-28 Thread Martin P. Hellwig
John Nagle wrote: Martin P. Hellwig wrote: John Nagle wrote: John Nagle wrote: John Nagle wrote: There's something strange about this URL: "https://sagar310.pontins.com/sraep/"; ... It looks to me like the SSL handshake is not done properly from the server side. Compare the output of: op

Language detector for Python using en-gram.

2009-07-28 Thread varun
One of my friend suggested me to do a language detector for python.At present the language detector in python is in uni-gram mode and i have planned to do it in en-gram mode.Kindly give me your suggestion as i am doing this as my final year project. With Anticipation, Varun V. Kumar -- http://m

Re: New implementation of re module

2009-07-28 Thread MRAB
Christopher Arndt wrote: On 27 Jul., 21:27, Wolfgang Rohdewald wrote: how do I compile _regex.c on Linux? This simple setup.py file should do the trick: from distutils.core import setup, Extension setup(name='regex', version='1.0', py_modules = ['regex'], ext_modules=[Extension(

Re: New implementation of re module

2009-07-28 Thread Christopher Arndt
On 27 Jul., 21:27, Wolfgang Rohdewald wrote: > how do I compile _regex.c on Linux? This simple setup.py file should do the trick: from distutils.core import setup, Extension setup(name='regex', version='1.0', py_modules = ['regex'], ext_modules=[Extension('_regex', ['_regex.c'])], )

Re: Questions about unicodedata in python 2.6.2

2009-07-28 Thread Christian Heimes
Weidong wrote: > Thanks for your response! I configured it in the same way as you > said, but without "--enable-unicode=ucs4". The ocnfig.log shows that > checking for UCS-4 was failed. So I assume that by default UCS-2 was > used. There was no other problme in the "make" step. Correct > The

Re: FTP Offset larger than file.

2009-07-28 Thread Dave Angel
Bakes wrote: On 28 July, 15:18, Bakes wrote: On 28 July, 15:01, Hrvoje Niksic wrote: Bakes writes: The error I get is: ftplib.error_temp: 451-Restart offset 24576 is too large for file size 22852. 451 Restart offset reset to 0 which tells me that the local file is larger t

Re: The longest word

2009-07-28 Thread ryles
On Jul 28, 7:55 am, NiklasRTZ wrote: > Sincere thanks for strengthening python's superior flexibility. Same > function also works around an exploding index problem returning > results for longest word where otherwise a word with whitespace > crashes the index: Babelfish? -- http://mail.python.

Python as active script

2009-07-28 Thread misterdi
I'm using Activestate python, For older version of python, I know that we can register python as active script by registering it through win32comext.axscript.client pyscript.py And to do that I need to change something in this pyscript.py before running pyscript_rexec.py(http://fastq.com/~sckitchin

Re: Wrapping prstat on Solaris

2009-07-28 Thread ryles
On Jul 27, 10:26 am, s...@pobox.com wrote: > At work we currently use top to monitor ongoing system utilization on our > Solaris systems.  As time has moved on though, use of top has become > problematic.  Our admins want us to switch to prstat, Sun's top-like > command.  It works fine however does

Re: Questions about unicodedata in python 2.6.2

2009-07-28 Thread Weidong
On Jul 28, 10:17 am, Christian Heimes wrote: > unicodedatais usually build as a shared library and not linked into the > Python core. How did you configure Python? The usual prodecure is: > >    ./configure >    make >    sudo make install > > On Unix the preferred option for ./configure is "--ena

Re: FTP Offset larger than file.

2009-07-28 Thread Hrvoje Niksic
Bakes writes: >> > As a quick fix, you can add a file.flush() line after the >> > file.write(...) line, and the problem should go away. >> >> Thank you very much, that worked perfectly. > > Actually, no it didn't. That fix works seamlessly in Linux, but gave > the same error in a Windows environm

Re: M2Crypto hangs on this URL

2009-07-28 Thread John Nagle
Martin P. Hellwig wrote: John Nagle wrote: John Nagle wrote: John Nagle wrote: There's something strange about this URL: "https://sagar310.pontins.com/sraep/"; ... It looks to me like the SSL handshake is not done properly from the server side. Compare the output of: openssl s_client -hos

Re: need help using Tkinter

2009-07-28 Thread MRAB
Manzur Ahmed wrote: i wanted to ask you if one of you could help me to use Tkinter. i'm trying to just create a simple GUI for which I have provided the code for below. # Simple GUI # Demonstrates creating a window from Tkinter import * # create the root window root = Tk () # modify the win

Re: WSDL and XML generation

2009-07-28 Thread Gustavo Andrés Angulo
Hi you can generate the WSDl with soaplib [1], and you can view web.py or django for this: for web.py -> http://webpy.org/cookbook/webservice for django -> http://www.djangosnippets.org/snippets/979/ [1]=> http://trac.optio.webfactional.com/ > Hi all > Newbie in Python, i am looking for some

need help using Tkinter

2009-07-28 Thread Manzur Ahmed
i wanted to ask you if one of you could help me to use Tkinter. i'm trying to just create a simple GUI for which I have provided the code for below. # Simple GUI # Demonstrates creating a window from Tkinter import * # create the root window root = Tk () # modify the window root.title("Simple G

Re: If Scheme is so good why MIT drops it?

2009-07-28 Thread MRAB
Hendrik van Rooyen wrote: On Monday 27 July 2009 16:49:25 Aahz wrote: In article , Hendrik van Rooyen wrote: On Sunday 26 July 2009 21:26:46 David Robinow wrote: I'm a mediocre programmer. Does this mean I should switch to PHP? I have searched, but I can find nothing about this mediocre l

Re: New implementation of re module

2009-07-28 Thread MRAB
Aahz wrote: In article , MRAB wrote: I've been working on a new implementation of the re module. The details are at http://bugs.python.org/issue2636, specifically from http://bugs.python.org/issue2636#msg90954. I've included a .pyd file for Python 2.6 on Windows if you want to try it out. Ho

Re: Internal Math Library of Numpy

2009-07-28 Thread David Cournapeau
On Tue, Jul 28, 2009 at 10:09 PM, Nanime Puloski wrote: > Does Numpy use Python's standard math library when calculating > elementary functions such as exp(x) and acos(x)? It depends on the dtype: for fundamental types (float, int, etc...), the underlying implementation is whatever the (C) math li

Re: Looking for a dream language: sounds like Python to me.

2009-07-28 Thread Stef Mientki
Matlab, from The Mathworks, has a companion product called Simulink. This allows the user to graphically build ‘algorithms’ in block form. There is a similar Python function. Where can I find a Python functionality like simulink ? thanks, Stef Mientki -- http://mail.python.org/mailman/l

Re: FTP Offset larger than file.

2009-07-28 Thread Bakes
On 28 July, 15:18, Bakes wrote: > On 28 July, 15:01, Hrvoje Niksic wrote: > > > > > Bakes writes: > > > The error I get is: > > > ftplib.error_temp: 451-Restart offset 24576 is too large for file size > > > 22852. > > > 451 Restart offset reset to 0 > > > which tells me that the local file is la

Re: initializing with empty list as default causes freaky problems

2009-07-28 Thread Luis Alberto Zarrabeitia Gomez
Quoting Reckoner : > Hi, > > Observe the following: > > In [202]: class Foo(): >.: def __init__(self,h=[]): >.: self.h=h [...] > In [207]: f.h.append(10) > > In [208]: f.h > Out[208]: [10] > > In [209]: g.h > Out[209]: [10] > > The question is: why is g.h updated

Re: Help understanding the decisions *behind* python?

2009-07-28 Thread Luis Zarrabeitia
On Friday 24 July 2009 11:07:30 am Inky 788 wrote: > On Jul 23, 3:42 am, Hendrik van Rooyen > > if you think it is contrived, then please consider how you would > > keep track of say the colour of a pixel on a screen at position > > (x,y) - this is about the simplest "natural" tuple format and > >

Re: FTP Offset larger than file.

2009-07-28 Thread Bakes
On 28 July, 15:01, Hrvoje Niksic wrote: > Bakes writes: > > The error I get is: > > ftplib.error_temp: 451-Restart offset 24576 is too large for file size > > 22852. > > 451 Restart offset reset to 0 > > which tells me that the local file is larger than the external file, > > by about a kilobyte.

Re: Questions about unicodedata in python 2.6.2

2009-07-28 Thread Christian Heimes
Weidong schrieb: > I am trying to build python 2.6.2 from the source by following the > instructions in README that comes with the source. The configure and > make steps are fine, but there is an error in "make install" step. > This "make install" attempts to build a lot of lib, and it complains >

Python-URL! - weekly Python news and links (Jul 28)

2009-07-28 Thread Gabriel Genellina
QOTW: "But there's another principle at work here that's less well known, and that was first articulated to me by Robert Dewar: You can remove linear factors by profiling, but it's much harder to undo bad algorithmic decisions. In particular, whether a program runs in O(n) or O(n^2) sometimes dep

Re: FTP Offset larger than file.

2009-07-28 Thread Hrvoje Niksic
Bakes writes: > The error I get is: > ftplib.error_temp: 451-Restart offset 24576 is too large for file size > 22852. > 451 Restart offset reset to 0 > which tells me that the local file is larger than the external file, > by about a kilobyte. Certainly, the local file is indeed that size, so > m

Re: len() should always return something

2009-07-28 Thread Luis Zarrabeitia
On Friday 24 July 2009 11:58:36 am Phillip M. Feldman wrote: > I've been converting Matlab codes to Python.  In Matlab, a scalar is just a > one-by-one matrix and has a length of 1.  This convention seems no less > arbitrary to me than Python's convention that the concept of length is not > applica

Re: Questions about unicodedata in python 2.6.2

2009-07-28 Thread Weidong
On Jul 28, 9:54 am, Weidong wrote: > I am trying to build python 2.6.2 from the source by following the > instructions in README that comes with the source.  The configure and > make steps are fine, but there is an error in "make install" step. > This "make install" attempts to build a lot of lib,

Questions about unicodedata in python 2.6.2

2009-07-28 Thread Weidong
I am trying to build python 2.6.2 from the source by following the instructions in README that comes with the source. The configure and make steps are fine, but there is an error in "make install" step. This "make install" attempts to build a lot of lib, and it complains about the lack of "unicode

Re: bad certificate error

2009-07-28 Thread jakecjacobson
On Jul 28, 9:48 am, Jean-Paul Calderone wrote: > On Tue, 28 Jul 2009 03:35:55 -0700 (PDT), jakecjacobson > wrote: > > [snip] > > >"Invalid how?  Self signed certificate? Domain mismatch? Expired > >certificate?"  It is a server name mismatch. > > Python 2.4 is not capable of allowing you to cust

Re: bad certificate error

2009-07-28 Thread Jean-Paul Calderone
On Tue, 28 Jul 2009 03:35:55 -0700 (PDT), jakecjacobson wrote: [snip] "Invalid how? Self signed certificate? Domain mismatch? Expired certificate?" It is a server name mismatch. Python 2.4 is not capable of allowing you to customize this verification behavior. It is hard coded to let Open

Re: index nested lists

2009-07-28 Thread Jean-Michel Pichavant
Alex wrote: On 28 Lug, 15:12, "Andreas Tawn" wrote: hi at all, If I have this list: lista ['ciao', 1, ['mela', 'pera', 'banana'], [1, 2, 3]] if I want enumerate elements...I can see: for parola in lista: print lista[i] i = i + 1

Re: Gracefully exiting CLI application

2009-07-28 Thread Nobody
On Mon, 27 Jul 2009 22:35:01 +0200, David wrote: > I am writing a command line application, and I need to perform some > cleaning on exit even if the process is killed. How can I do that with > python? Killed by what means? Ctrl-C sends SIGINT which is converted to a KeyboardInterrupt exception.

python 3 and stringio.seek

2009-07-28 Thread Michele Petrazzo
Hi list, I'm trying to port a my library to python 3, but I have a problem with a the stringio.seek: the method not accept anymore a value like pos=-6 mode=1, but the "old" (2.X) version yes... The error: File "/home/devel/Py3/lib/python3.0/io.py", line 2031, in seek return self._seek(pos,

Re: index nested lists

2009-07-28 Thread Alex
On 28 Lug, 15:12, "Andreas Tawn" wrote: > > hi at all, > >  If I have this list: > > > >>> lista > > ['ciao', 1, ['mela', 'pera', 'banana'], [1, 2, 3]] > > > if I want enumerate elements...I can see: > > > >>> for parola in lista: > >    print lista[i] > >    i = i + 1 > > > ciao > > 1 > > ['mela'

RE: index nested lists

2009-07-28 Thread Andreas Tawn
> hi at all, > If I have this list: > > >>> lista > ['ciao', 1, ['mela', 'pera', 'banana'], [1, 2, 3]] > > if I want enumerate elements...I can see: > > >>> for parola in lista: > print lista[i] > i = i + 1 > > ciao > 1 > ['mela', 'pera', 'banana'] > [1, 2, 3] > >>> > > but, if I

Internal Math Library of Numpy

2009-07-28 Thread Nanime Puloski
Does Numpy use Python's standard math library when calculating elementary functions such as exp(x) and acos(x)? Also, what is the internal library of Numpy and Python's standard math library? Is it platform independent? -- http://mail.python.org/mailman/listinfo/python-list

FTP Offset larger than file.

2009-07-28 Thread Bakes
I am writing a python script that performs an identical function to the 'tail' unix utility, except that it connects to its files over FTP, rather than the local hard disk. I am currently using this python script to generate an increasing 'logfile' of garbage. > import time > for i in range(1, 20

File and TagPy

2009-07-28 Thread redhot
Hello, I have question, is it possible to read tag in tagpy module from file stream? For example I have earlier read file: file = open('some.mp3', 'rb') and next get tags from it? Regards, Konrad -- http://mail.python.org/mailman/listinfo/python-list

index nested lists

2009-07-28 Thread Alex
hi at all, If I have this list: >>> lista ['ciao', 1, ['mela', 'pera', 'banana'], [1, 2, 3]] if I want enumerate elements...I can see: >>> for parola in lista: print lista[i] i = i + 1 ciao 1 ['mela', 'pera', 'banana'] [1, 2, 3] >>> but, if I want to enumerate elements about n

Re: bad certificate error

2009-07-28 Thread Nick Craig-Wood
jakecjacobson wrote: > > >  If I go to this server in my browser, I get a "This server tried to > > >  identify itself with invalid information".  Is there a way to > > >  ignore this issue with Python?  Can I setup a trust store and add > > >  this server to the trust store? > > > > Invalid how?

Re: bad certificate error

2009-07-28 Thread Steven D'Aprano
On Mon, 27 Jul 2009 23:16:39 -0300, Gabriel Genellina wrote: > I don't see the point on "fixing" either the Python script or httplib to > accomodate for an invalid server certificate... If it's just for > internal testing, I'd use HTTP instead (at least until the certificate > is fixed). In real

Re: The longest word

2009-07-28 Thread NiklasRTZ
On Jul 28, 7:03 am, Hrvoje Niksic wrote: > Piet van Oostrum writes: > > >> NiklasRTZ (N) wrote: > > >>N> Thank you. This seems to work: > >>N> sorted("a AAA aa a  sdfsdfsdfsdf vv".split(' '),lambda a,b: len(a)- > >>N> len(b))[-1] > >>N> 'sdfsdfsdfsdf' > > > simpler: > > > sorted("a AAA a

Re: Looking for a dream language: sounds like Python to me.

2009-07-28 Thread ray
On Jul 27, 10:39 am, David Cournapeau wrote: > On Tue, Jul 28, 2009 at 12:28 AM, Dotan Cohen wrote: > >> It is neither efficient or inefficient: it is just a distribution > >> tool, to deploy python software in a form familiar to most windows > >> users. It does not make it any faster than running

Re: I am trying to compile python 2.6.2 on my Mac

2009-07-28 Thread Tommy Nordgren
On Jul 26, 2009, at 10:37 AM, Chris Rebert wrote: On Sun, Jul 26, 2009 at 1:12 AM, Jessica R Smith wrote: Hello, I am trying to compile Python 2.6.2 on my Mac which has os/x 10.5.7 I downloaded python 2.6.2 from here: - http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2 I unpacked

Re: The longest word

2009-07-28 Thread Hrvoje Niksic
Piet van Oostrum writes: >> NiklasRTZ (N) wrote: > >>N> Thank you. This seems to work: >>N> sorted("a AAA aa a sdfsdfsdfsdf vv".split(' '),lambda a,b: len(a)- >>N> len(b))[-1] >>N> 'sdfsdfsdfsdf' > > simpler: > > sorted("a AAA aa a sdfsdfsdfsdf vv".split(' '), key=len)[-1] There i

  1   2   >