Regarding sort()

2009-05-25 Thread Dhananjay
Hello All, I have data set as follows: 24 GLU3 47 LYS 6 3.9092331 42 PRO5 785 VAL 74 4.145114 1 54 LYS6 785 VAL 74 4.305017 1 55 LYS6 785 VAL 74 4.291098 1 5

Re: select.poll returning strange file descriptors.

2009-05-25 Thread Simon Wittber
Solved. I was using poll.register(fileno) without any flags specfied, which means "tell me when _anything_ happens". Because of this, I was receiving OOB data, which seems to use strange fileno values. to fix this, I now use this: poll.register(sock.fileno(), select.POLLIN|select.POLLOUT| selec

Re: Optimizing math functions

2009-05-25 Thread Lawrence D'Oliveiro
In message <0033dace$0$9725$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > Minimizing functions of two variables is difficult, as a general rule. > Nevertheless, there are tools for doing so. Check out SciPy. The name "Marquadt-Levenberg" comes to mind. As I recall, it involved finding ze

Re: PureData py/pyExt into standalone python

2009-05-25 Thread responsible7
Hi again, Comments inline: > > responsib...@gmail.com wrote: > > Hi guys, > > I've written some python classes for py/pyExt extensions for the "dataflow" > > graphical programming environment PureData. > > My classes talk to eachother via the PureData system, and they talk to the > > outside wor

SendMessage question

2009-05-25 Thread zhouhaifeng
Hi,I want to send "ctrl + A" and "ctrl + C" to a window, but my code can not work, who can help me ? Thanks a lot! hWnd = win32gui.FindWindow(None, "“pad") print hWnd if hWnd <> 0: point = (555, 175) x, y = point win32api.SetCursorPos(point) win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,

[OT] Python hunting

2009-05-25 Thread Iñigo Serna
Hi, excuse me for the off-topic, but today I've seen this video and... and... well, it's amazing http://dailymotion.virgilio.it/search/chasse%2Ben%2Bafrique/video/xz3rz_les-pythons-aiment-les-jambes_animals It's in French, but the audio it's not important. Kind regards, Iñigo Serna -- http://m

Re: help! Troubled when embed python into C++

2009-05-25 Thread A. Cavallo
You need the: int main(int argc, char * argv[]) { Py_Initialize(); PySys_SetArgv(argc, argv); PyRun_SimpleString("execfile(r'1.py')"); Py_Finalize(); return 0; } Regards, Antonio On Sunday 24 May 2009 11:42:13 孟炜 wrote: > I have the following codes in C++: > #include > void

Re: Can I get a technical explanation on the following error

2009-05-25 Thread Chris Rebert
On Sun, May 24, 2009 at 1:14 PM, grocery_stocker wrote: > On May 24, 11:47 am, Hans Müller wrote: >> Try this: >> >> print "\\" >> >> \ is the escape character, it masks the meaning of the next chararcter. >> >> If you write print "\" python tries to print " (the meaning of " as >> the string del

Re: Re: 4 hundred quadrillonth?

2009-05-25 Thread Dave Angel
Lawrence D'Oliveiro wrote: In message , Christian Heimes wrote: Welcome to IEEE 754 floating point land! :) It used to be worse in the days before IEEE 754 became widespread. Anybody remember a certain Prof William Kahan from Berkeley, and the foreword he wrote to the Apple Numeric

Re: Re: Set a variable as in setter

2009-05-25 Thread Dave Angel
Kless wrote: On 24 mayo, 12:27, Duncan Booth wrote: Kless wrote: Is there any way to simplify the next code? Because I'm setting a variable by default of the same way than it's set in the setter. --- class Foo(object): def __init__(self, bar): self._ba

Re: Python -> R?

2009-05-25 Thread Dan Yamins
> > If so, what are you using? I have read about RPy, is that a good > solution? Yes, I think it's quite a good solution. It's not exactly 100% as convenient as working directly in R, but that's IMO more than compensated by the ability to use Python's syntax. Make sure you use Rpy2 (the succes

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-25 Thread Lawrence D'Oliveiro
In message , Igor Katson wrote: > I have written a socket server and some arbitrary clients. When I > shutdown the server, and do socket.close(), I cannot immediately start > it again cause it has some open sockets in TIME_WAIT state. It throws > address already in use exception at me. There's a

Ted Dziuba

2009-05-25 Thread Lawrence D'Oliveiro
: If you've ever had to build C extensions to Python on Windows, you can join me in a feeling of satisfaction that someone at Microsoft is going to have to figure this out. Let's call it retribution for Internet

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-25 Thread Дамјан Георгиевски
> I have written a socket server and some arbitrary clients. When I > shutdown the server, and do socket.close(), I cannot immediately start > it again cause it has some open sockets in TIME_WAIT state. It throws > address already in use exception at me. I have searched for that in > google but h

Re: Regarding sort()

2009-05-25 Thread Jaime Fernandez del Rio
Hi Dhananjay, Sort has several optional arguments, the function's signature is as follows: s.sort([cmp[, key[, reverse]]]) If you store your data as a list of lists, to sort by the third column you could do something like: data.sort(None, lambda x : x[2]) For more complex sortings, as the one

Re: SendMessage question

2009-05-25 Thread David Lyon
you might have more luck with http://pypi.python.org/pypi/SendKeys/0.3 On Sat, 23 May 2009 08:58:14 +0800, zhouhaifeng wrote: > Hi,I want to send "ctrl + A" and "ctrl + C" to a window, > but my code can not work, who can help me ? > > Thanks a lot! > > hWnd = win32gui.FindWindow(None, "“pad")

Re: Re: 4 hundred quadrillonth?

2009-05-25 Thread Lawrence D'Oliveiro
In message , Dave Angel wrote: > Lawrence D'Oliveiro wrote: > >> Anybody remember a certain Prof William Kahan from Berkeley ... >> > I remember the professor. He was responsible for large parts of the > Intel 8087 specification, which later got mostly codified as IEEE 754. The 8087 was poor

Re: How to send a compsite key to window

2009-05-25 Thread Gabriel Genellina
En Thu, 21 May 2009 09:38:26 -0300, zhouhaifeng escribió: just like "ctrl + A", I want to select all the text in a window, now , I operate right menu to get it, but it can not work all the time. so I want to send "ctrl + a" to the window I'd do it in a different way: asuming it is an edit co

Re: Regarding sort()

2009-05-25 Thread Peter Otten
Dhananjay wrote: > Hello All, > > I have data set as follows: > > 24 GLU3 47 LYS 6 3.9092331 > 42 PRO5 785 VAL 74 4.145114 1 > 54 LYS6 785 VAL 74 4.305017 1 > 55 LYS6 785

Re: Regarding sort()

2009-05-25 Thread Peter Otten
Peter Otten wrote: rows = data.splitlines() rows.sort(key=lambda line: int(line.split()[5])) rows.sort(key=lambda line: int(line.split()[2])) print "\n".join(rows) Of course you can also sort in a single step: >>> rows = data.splitlines() >>> def key(row): ... columns = r

Re: Regarding sort()

2009-05-25 Thread Chris Rebert
On Mon, May 25, 2009 at 12:29 AM, Dhananjay wrote: > Hello All, > > I have data set as follows: > > 24   GLU    3   47  LYS 6   3.909233    1 > 42   PRO    5   785 VAL 74  4.145114 1 > 54   LYS    6   785 VAL 74  4.305017  1 >

Re: Regarding sort()

2009-05-25 Thread Chris Rebert
On Mon, May 25, 2009 at 12:51 AM, Jaime Fernandez del Rio wrote: > Hi Dhananjay, > > Sort has several optional arguments, the function's signature is as follows: > > s.sort([cmp[, key[, reverse]]]) > > If you store your data as a list of lists, to sort by the third column > you could do something

Re: writing on file not until the end

2009-05-25 Thread Alessandro
On May 25, 8:38 am, Peter Otten <__pete...@web.de> wrote: > Alexzive wrote: > > I am a newby with python. I wrote the following code to extract a text > > from a file and write it to another file: > > > linestring = open(path, 'r').read() #read all the inp file in > > linestring > > > i=linestring.

Re: Need Help

2009-05-25 Thread abosalim
On May 25, 5:39 am, Steven D'Aprano wrote: > On Mon, 25 May 2009 00:16:19 +0200, Piet van Oostrum wrote: > > By the way, it is better to add python code as attachment instead of > > inline text because some news software might fold the lines like in your > > posting, making it difficult to reconst

Re: Multiprocessing and file I/O

2009-05-25 Thread Infinity77
Hi Paul & All, On May 24, 4:16 pm, Paul Boddie wrote: > On 24 Mai, 16:13, Infinity77 wrote: > > > > > No, the processing of the data is fast enough, as it is very simple. > > What I was asking is if anyone could share an example of using > > multiprocessing to read a file, along the lines I desc

Re: Optimizing math functions

2009-05-25 Thread Charlie
Esmail hotmail.com> writes: > > Charlie wrote: > > > > You might also look at: > > http://pyparasol.sourceforge.net/example_1.html > > Thanks for this lead, I had never heard of parasol before. Do you know > if this also works under Linux? The docs mention only the Windows platform, > but give

Re: writing on file not until the end

2009-05-25 Thread Peter Otten
Alessandro wrote: > - until now, the only solution which works is to repeat the code while > the file is still open, which means a quite redundant code: > > linestring = open(path, 'r').read() > i=linestring.index("*NODE") > i=linestring.index("E",i) > e=linestring.index("*",i+10) > textN = lines

Re: writing on file not until the end

2009-05-25 Thread John Machin
On May 25, 6:30 pm, Alessandro wrote: > On May 25, 8:38 am, Peter Otten <__pete...@web.de> wrote: > > > > > Alexzive wrote: > > > I am a newby with python. I wrote the following code to extract a text > > > from a file and write it to another file: > > > > linestring = open(path, 'r').read() #read

Re: Can I get a technical explanation on the following error

2009-05-25 Thread Niklas Norrthon
On 25 Maj, 05:29, Jim Garrison wrote: > And as an interesting exercise, try > > print r'test \' > print r'test \\' > > Because of the way raw string parsing is defined, neither of these will > pass the parser.  In fact, a raw string cannot have a backslash as > its last character. Tried it: >>> r

Re: writing on file not until the end

2009-05-25 Thread Alessandro
On May 25, 10:58 am, John Machin wrote: > On May 25, 6:30 pm, Alessandro wrote: > > > > > On May 25, 8:38 am, Peter Otten <__pete...@web.de> wrote: > > > > Alexzive wrote: > > > > I am a newby with python. I wrote the following code to extract a text > > > > from a file and write it to another fi

Re: Regarding sort()

2009-05-25 Thread Jaime Fernandez del Rio
On Mon, May 25, 2009 at 10:15 AM, Chris Rebert wrote: > Erm, using a compare function rather than a key function slows down > sorting /significantly/. In fact, the `cmp` parameter to list.sort() > has been *removed* in Python 3.0 because of this. Makes a lot of sense, as you only have to run the

Re: Can I get a technical explanation on the following error

2009-05-25 Thread pdpi
On May 24, 6:41 pm, grocery_stocker wrote: > How come something like '\'  causes an error? Here is what I mean. > > [cdal...@localhost ~]$ python > Python 2.6.2 (r262:71600, May  3 2009, 17:04:44) > [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2 > Type "help", "copyright", "credits" or "license

Re: Regarding sort()

2009-05-25 Thread Neil Crighton
Dhananjay gmail.com> writes: > I want to sort the data on the basis of 3rd column first and latter want to > sort the sorted data (in first step) on the basis of 6th column.I tried > sort() function but could not get the way how to use it.I am new to > programming, please tell me how can I sor

Re: 4 hundred quadrillonth?

2009-05-25 Thread Hendrik van Rooyen
"Dennis Lee Bieber" wrote: > On Sun, 24 May 2009 22:47:51 +1200, Lawrence D'Oliveiro > declaimed the following in > gmane.comp.python.general: > > > > As for exactitude in physics, Gregory Chaitin among others has been trying > > to rework physics to get rid of real numbers altogether. > >

INVITATION FLIB: Fringe/Functional Languages In Barcelona user group.

2009-05-25 Thread jos koot
INVITATION We, (Jose A. Ortega Ruiz j...@gnu.org, Andy Wingo wi...@pobox.com and Jos Koot jos.k...@telefonica.net) have scheduled a meeting in Barcelona (Spain) with the intention to form a user group FLIB: Fringe/ Functional Languages In Barcelona. Everyone who is interested in shaping this group

what I would like python.el to do (and maybe it does)

2009-05-25 Thread Giovanni Gherdovich
Hello everybody, basically I'm writing here since I cannot make my python.el work (a major mode for writing python with emacs), but I would also like to share my user experience and tell you what I think an emacs mode should do, why do I like them and hopefully have some feedbacks to see if I mis

Re: Python -> R?

2009-05-25 Thread Esmail
Dan Yamins wrote: If so, what are you using? I have read about RPy, is that a good solution? Yes, I think it's quite a good solution. It's not exactly 100% as convenient as working directly in R, but that's IMO more than compensated by the ability to use Python's syntax. Make

Re: Python -> R?

2009-05-25 Thread Esmail
edexter wrote: I was playing around with a r sound module and looking at the graphic stuff and I have downloaded the rpy thing but I have never used it I have been looking for a good excuse to use it... It looks like it could be useful for graphing stuff or maybe alogrithmic (spelling I am

Re: email scanning for X-Spam-Score

2009-05-25 Thread Peter Otten
Helmut Jarausch wrote: > my emails received from our mailing system contain a field like > > X-Spam-Score: -2.2 > > Given the full email message in 'msg' > I've tried >mailmsg = email.message_from_string(msg) >SPAM_CORE = mailmsg['X-Spam-Score'] > but it doesn't work. What do you mean b

Re: email scanning for X-Spam-Score

2009-05-25 Thread Helmut Jarausch
Peter Otten wrote: Helmut Jarausch wrote: my emails received from our mailing system contain a field like X-Spam-Score: -2.2 Given the full email message in 'msg' I've tried mailmsg = email.message_from_string(msg) SPAM_CORE = mailmsg['X-Spam-Score'] but it doesn't work. What do you m

Re: How to reuse TCP listening socket immediately after it was connected at least once?

2009-05-25 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > In message , Roy Smith wrote: > > > In article , > > Lawrence D'Oliveiro wrote: > > > >> The right thing to do is try to ensure that all your connections are > >> properly closed at shutdown. That may not be enough (if your server > >> crashes due to

Re: what I would like python.el to do (and maybe it does)

2009-05-25 Thread Arnaud Delobelle
Giovanni Gherdovich writes: > Hello everybody, Hi > (well, it's python-send-buffer, so maybe not a single > line but the whole buffer; the closest to my needs, anyway). > However: I open my Emacs, issue M-x python-mode, > then M-x run-python to have the interpreter in > a second buffer, I type

formating query with empty parameter

2009-05-25 Thread someone
Hello! if one of parameter in values is empty, I'm getting TypeError: not enough arguments for format string But how to handle such situation? It is ok for DB, that some of values are empty. def __insert(self, data): query = """ BEGIN; INSERT INTO table

Re: formating query with empty parameter

2009-05-25 Thread Diez B. Roggisch
someone wrote: > Hello! > > if one of parameter in values is empty, I'm getting > TypeError: not enough arguments for format string > > But how to handle such situation? It is ok for DB, that some of values > are empty. > > > > def __insert(self, data): > query = """ > BEG

Re: formating query with empty parameter

2009-05-25 Thread Pet
On May 25, 2:15 pm, "Diez B. Roggisch" wrote: > someone wrote: > > Hello! > > > if one of parameter in values is empty, I'm getting > > TypeError: not enough arguments for format string > > > But how to handle such situation? It is ok for DB, that some of values > > are empty. > > > def __insert(s

Re: formating query with empty parameter

2009-05-25 Thread Pet
On May 25, 2:25 pm, Pet wrote: > On May 25, 2:15 pm, "Diez B. Roggisch" wrote: > > > > > > > someone wrote: > > > Hello! > > > > if one of parameter in values is empty, I'm getting > > > TypeError: not enough arguments for format string > > > > But how to handle such situation? It is ok for DB, t

Re: formating query with empty parameter

2009-05-25 Thread Peter Otten
Pet wrote: > > someone wrote: > > > Hello! > > > > > if one of parameter in values is empty, I'm getting > > > TypeError: not enough arguments for format string > > > > > But how to handle such situation? It is ok for DB, that some of values > > > are empty. > > > > > def __insert(self, data): > >

Re: formating query with empty parameter

2009-05-25 Thread Tim Chase
if one of parameter in values is empty, I'm getting TypeError: not enough arguments for format string But how to handle such situation? It is ok for DB, that some of values are empty. def __insert(self, data): query = """ BEGIN; INSERT INTO table

Re: what I would like python.el to do (and maybe it does)

2009-05-25 Thread J Kenneth King
Giovanni Gherdovich writes: > Hello everybody, > > basically I'm writing here since I cannot > make my python.el work (a major mode for writing > python with emacs), but I would also like to share > my user experience and tell you what I think > an emacs mode should do, why do I like them > and h

Re: writing on file not until the end

2009-05-25 Thread Dave Angel
Alessandro wrote: I closed and restarted the python console. Now this code (with added "Nfile.close()" at the end) seems to work properly: linestring = open(path, 'r').read() i=linestring.index("*NODE") i=linestring.index("E",i) e=linestring.index("*",i+10) textN = linestring[i+2:e-1] Nfile =

exec statement with/without prior compile...

2009-05-25 Thread Jaime Fernandez del Rio
These weekend I've been tearing down to pieces Michele Simionato's decorator module, that builds signature preserving decorators. At the heart of it all there is a dynamically generated function, which works something similar to this... ... src = """def function(a,b,c) :\nreturn _caller_(a

Re: Need Help

2009-05-25 Thread Piet van Oostrum
> abosalim (a) wrote: >a> I modified the method,but it can't identified it.(self.res=textcorrect >a> (self.string) >a> NameError: global name 'textcorrect' is not defined) >a> This is what i done: [...] >a> class Ex3: [...] >a> def textcorrect(str): >a> s=[] >a> for i in

Re: Can I get a technical explanation on the following error

2009-05-25 Thread Piet van Oostrum
> Jim Garrison (JG) wrote: >JG> And as an interesting exercise, try >JG> print r'test \' >JG> print r'test \\' >JG> Because of the way raw string parsing is defined, neither of these will >JG> pass the parser. In fact, a raw string cannot have a backslash as >JG> its last character. Cannot

Re: [ANN] vim patch to support python3 interface

2009-05-25 Thread Roland Puntaier
vim_...@googlegroups.com schrieb am 21.05.2009 14:27:13: > > On 12/05/09 18:35, Roland Puntaier wrote: > > Hello, > > > > I have ported vim's python interface (if_python.c) to the python3 C-API. > > > > The changed files are: > > - Makefile (for linux) > > - Make_mvc.mak (for windows) > > - if_p

How to pickle a 'PySwigObject' ?

2009-05-25 Thread Barak, Ron
Hi, I have a wxPython application that is creating a subprocess that performs a lengthy log analysis. Currently, the subprocess is displaying its results using its own MainLoop(). I want to display the subprocess' results using the parent process' MainLoop(). I tried to pickle the class instance

Re: formating query with empty parameter

2009-05-25 Thread Pet
On May 25, 2:50 pm, Peter Otten <__pete...@web.de> wrote: > Pet wrote: > > > someone wrote: > > > > Hello! > > > > > if one of parameter in values is empty, I'm getting > > > > TypeError: not enough arguments for format string > > > > > But how to handle such situation? It is ok for DB, that some o

Re: formating query with empty parameter

2009-05-25 Thread Pet
On May 25, 3:26 pm, Tim Chase wrote: > if one of parameter in values is empty, I'm getting > TypeError: not enough arguments for format string > But how to handle such situation? It is ok for DB, that some of values > are empty. > def __insert(self, data): >         q

unicode confusing

2009-05-25 Thread someone
Hi, reading content of webpage (encoded in utf-8) with urllib2, I can't get parsed data into DB Exception: File "/usr/lib/python2.5/site-packages/pyPgSQL/PgSQL.py", line 3111, in execute raise OperationalError, msg libpq.OperationalError: ERROR: invalid UTF-8 byte sequence detected near b

Re: I need help building a data structure for a state diagram

2009-05-25 Thread Paul McGuire
On May 24, 1:16 pm, Matthew Wilson wrote: > I'm working on a really simple workflow for my bug tracker.  I want > filed bugs to start in an UNSTARTED status.  From there, they can go to > STARTED. > I just wrote an article for the April issue of Python Magazine on how to add embedded DSL code to

Re: unicode confusing

2009-05-25 Thread Paul Boddie
On 25 Mai, 17:39, someone wrote: > Hi, > > reading content of webpage (encoded in utf-8) with urllib2, I can't > get parsed data into DB > > Exception: > >   File "/usr/lib/python2.5/site-packages/pyPgSQL/PgSQL.py", line 3111, > in execute >     raise OperationalError, msg > libpq.OperationalError

Re: formating query with empty parameter

2009-05-25 Thread Tim Chase
To stave off this problem, I often use: values = [ data['a'], data['b'], data['c'], data['d'], data['e'], data['f'], data['g'], ] params = ', '.join('%s' for _ in values) query = """ BEGIN; INSERT INTO table (a,b,c,d,e,f,g) VALU

Re: formating query with empty parameter

2009-05-25 Thread Peter Otten
Pet wrote: > On May 25, 2:50 pm, Peter Otten <__pete...@web.de> wrote: >> cursor.execute(query, *values) # wrong > > as far as I know it is not wrong, at least for pyPgSQL it takes values > and escapes properly preventing sql injections If so replace "# wrong" with "# superfluous" ;) Peter --

Re: formating query with empty parameter

2009-05-25 Thread Pet
On 25 Mai, 18:16, Tim Chase wrote: > >> To stave off this problem, I often use: > > >>    values = [ > >>     data['a'], > >>     data['b'], > >>     data['c'], > >>     data['d'], > >>     data['e'], > >>     data['f'], > >>     data['g'], > >>     ] > >>    params = ', '.join('%s' for _ in value

Re: from __future__ import absolute_import issue

2009-05-25 Thread LittleGrasshopper
On May 23, 6:39 pm, "Gabriel Genellina" wrote: > En Sat, 23 May 2009 12:32:24 -0300, LittleGrasshopper   > escribió: > > > > > On May 22, 12:42 am, "Gabriel Genellina" > > wrote: > >> En Wed, 20 May 2009 20:18:02 -0300, LittleGrasshopper   > >> escribió: > > >> > It appears that either absolute

What text editor is everyone using for Python

2009-05-25 Thread LittleGrasshopper
With so many choices, I was wondering what editor is the one you prefer when coding Python, and why. I normally use vi, and just got into Python, so I am looking for suitable syntax files for it, and extra utilities. I dabbled with emacs at some point, but couldn't get through the key bindings for

Re: What text editor is everyone using for Python

2009-05-25 Thread J Kenneth King
LittleGrasshopper writes: > With so many choices, I was wondering what editor is the one you > prefer when coding Python, and why. I normally use vi, and just got > into Python, so I am looking for suitable syntax files for it, and > extra utilities. I dabbled with emacs at some point, but couldn

Re: What text editor is everyone using for Python

2009-05-25 Thread LittleGrasshopper
On May 25, 10:44 am, J Kenneth King wrote: > LittleGrasshopper writes: > > With so many choices, I was wondering what editor is the one you > > prefer when coding Python, and why. I normally use vi, and just got > > into Python, so I am looking for suitable syntax files for it, and > > extra util

Re: What text editor is everyone using for Python

2009-05-25 Thread Mr.SpOOn
2009/5/25 LittleGrasshopper : > I know Google (as a matter I read this group from Google.) I was > hoping for some new insightful responses. It's just too hot to start a flame :P -- http://mail.python.org/mailman/listinfo/python-list

Re: What text editor is everyone using for Python

2009-05-25 Thread Esmail
LittleGrasshopper wrote: So what do you guys use, and why? Hopefully we can keep this civil. I use Emacs, just because I have been using this editor for all sorts of things in the last 20+ years. I haven't been able to get the python mode to work for Windows (do most of my work under Linux an

Re: [Python-Dev] PEP 384: Defining a Stable ABI

2009-05-25 Thread M.-A. Lemburg
Martin v. Löwis wrote: > Thomas Wouters reminded me of a long-standing idea; I finally > found the time to write it down. > > Please comment! > ... > Up until this PEP proposal, we had a very simple scheme for the Python C-API: all documented functions and variables with a "Py" prefix were part o

Re: What text editor is everyone using for Python

2009-05-25 Thread Ryniek90
Temat: Re: What text editor is everyone using for Python Od: Esmail Data: Mon, 25 May 2009 14:07:24 -0400 Do: python-list@python.org Do: python-list@python.org LittleGrasshopper wrote: So what do you guys use, and w

Re: What text editor is everyone using for Python

2009-05-25 Thread Marcelo de Moraes Serpa
emacs is a swiss-knife, good for small, medium, big or huge projects, or single files On Mon, May 25, 2009 at 1:24 PM, Ryniek90 wrote: > > >> >> >> Temat: >> Re: What text editor is everyone using for Python >> Od: >> Esmai

Are Python-based web frameworks reliable enough?

2009-05-25 Thread Gilles Ganault
Hello Until now, the modest web apps I wrote were all in PHP because it's available on just about any hosted server. I now have a couple of ideas for applications where I would deploy my own servers, so that I'd rather write them in Python because I find the language more pleasant to writ

Re: Are Python-based web frameworks reliable enough?

2009-05-25 Thread Krishnakant
On Mon, 2009-05-25 at 20:49 +0200, Gilles Ganault wrote: > Hello > > Until now, the modest web apps I wrote were all in PHP because it's > available on just about any hosted server. > > I now have a couple of ideas for applications where I would deploy my > own servers, so that I'd rather w

Re: how to get rid of pyc files ?

2009-05-25 Thread pythoncurious
On May 25, 12:08 am, Dave Angel wrote: > > Is Clearcase still around?  I hope it works better than it did in 1992. > I don't know how it worked back then, but if it's worse than today, I don't know how they ever managed to get people to use it. I'm not a fan and I don't have a choice about using

Re: how to get rid of pyc files ?

2009-05-25 Thread pythoncurious
On May 25, 12:07 am, John Machin wrote: > "switching" scarcely seems to be the right description. You appear to > be running the same code from one repository simultaneously available > to two different platforms. > > Try this: Instead of running your code straight from your repository, > set up

Re: What text editor is everyone using for Python

2009-05-25 Thread Günther Dietrich
LittleGrasshopper wrote: >With so many choices, I was wondering what editor is the one you >prefer when coding Python, and why. [...] >So what do you guys use, and why? Hopefully we can keep this civil. I found 'EasyEclipse for Python' soon after I began using Python. With PyDev, it even cont

Re: What text editor is everyone using for Python

2009-05-25 Thread Roy Smith
LittleGrasshopper wrote: > I normally use vi > [...] > I dabbled with emacs at some point > [...] > So what do you guys use, and why? Hopefully we can keep this civil. I'm confused. You put emacs and vi in the same paragraph and then expect the conversation to remain civil? :-) -- http://mail

Determining 32 bit vs 64 bit Python and numpy

2009-05-25 Thread mmanns
Hi I am looking for a robust, cross-platform way to determine if I am on a 32 bit or a 64 bit Python and if the numpy installation is also 32 bit or 64 bit. I have googled a bit and found some platform specific solutions but nothing general. The solution should work with different versions of Py

Re: Determining 32 bit vs 64 bit Python and numpy

2009-05-25 Thread Martin v. Löwis
> I am looking for a robust, cross-platform way to determine if I am on a > 32 bit or a 64 bit Python and if the numpy installation is also 32 bit > or 64 bit. You can find out the size of a pointer with struct.calcsize("P") * 8. Numpy will have the same configuration if you can import it. Regard

Re: Determining 32 bit vs 64 bit Python and numpy

2009-05-25 Thread mmanns
On Mon, 25 May 2009 23:54:45 +0200 "Martin v. Löwis" wrote: > > I am looking for a robust, cross-platform way to determine if I am > > on a 32 bit or a 64 bit Python and if the numpy installation is > > also 32 bit or 64 bit. > > You can find out the size of a pointer with struct.calcsize("P") *

Re: Optimizing math functions

2009-05-25 Thread Esmail
Charlie wrote: It might work under Linux, however, it was developed under Windows and, to my knowledge, has never been tested on a Linux machine. Basic operation only depends on installations of matplotlib, numpy, and scipy. Those packages are all available on Linux. If you try it, I'd like t

Re: how to get rid of pyc files ?

2009-05-25 Thread John Machin
On May 26, 6:04 am, pythoncuri...@gmail.com wrote: > On May 25, 12:07 am, John Machin wrote: > > > "switching" scarcely seems to be the right description. You appear to > > be running the same code from one repository simultaneously available > > to two different platforms. > > > Try this: Instead

Re: A fast way to read last line of gzip archive ?

2009-05-25 Thread David Bolen
"Barak, Ron" writes: > I couldn't really go with the shell utilities approach, as I have no > say in my user environment, and thus cannot assume which binaries > are install on the user's machine. I suppose if you knew your target you could just supply the external binaries to go with your appli

Re: What text editor is everyone using for Python

2009-05-25 Thread John Yeung
On May 25, 4:28 pm, Roy Smith wrote: > > I'm confused.  You put emacs and vi in the same paragraph > and then expect the conversation to remain civil? :-) I know! He is really asking a lot! Ultimately, I think if you are comfortable with vi, stick with vi. There are plenty of people who are usi

Re: Searching for pyvm

2009-05-25 Thread A. Cavallo
http://students.ceid.upatras.gr/~sxanth/pyvm/ Does this help? Regards, Antonio On Monday 25 May 2009 00:19:57 Vladimir G. Ivanovic wrote: > Hello, > > I'm looking for the sources to pyvm, a python virtual machine > implementation which can run Python 2.4 bytecode. > > If someone could point me in

email scanning for X-Spam-Score

2009-05-25 Thread Helmut Jarausch
Hi, my emails received from our mailing system contain a field like X-Spam-Score: -2.2 Given the full email message in 'msg' I've tried mailmsg = email.message_from_string(msg) SPAM_CORE = mailmsg['X-Spam-Score'] but it doesn't work. What am I missing? Many thanks for a hint, Helmut. -- H

Network programming ?

2009-05-25 Thread thushianthan15
Hi everyone, I am planning to develop a chatting software in Python, for my college project. I am using Windows Vista. Is it possible to do sockets programming in Python ? Any books or websites ? Also, i want to develop a gui for that program. What are the gui tool kits available for windows? I

Re: Network programming ?

2009-05-25 Thread Ralf Schoenian
thushiantha...@gmail.com wrote: Hi everyone, I am planning to develop a chatting software in Python, for my college project. I am using Windows Vista. Is it possible to do sockets programming in Python ? Any books or websites ? Also, i want to develop a gui for that program. What are the gui to

any lib to extract pages form pdf and then merge?

2009-05-25 Thread oyster
I want to extract some pages from vary pdf files, then write them with/witout rotation into one new pdf file. something likes this [py] import gfx doc = gfx.open("pdf", r"Theory.pdf") pdf = gfx.PDF() for pagenr in [1,5,7]: page = doc.getPage(pagenr) if pagenr==1: page.rotate(90)

Re: What text editor is everyone using for Python

2009-05-25 Thread Steven D'Aprano
On Mon, 25 May 2009 10:35:03 -0700, LittleGrasshopper wrote: > With so many choices, I was wondering what editor is the one you prefer > when coding Python, and why. I use kwrite when on a GUI. When I can't avoid editing files remotely over ssh, I use nano. Why? I dislike Gnome's user-interface

Re: any lib to extract pages form pdf and then merge?

2009-05-25 Thread CTO
On May 26, 12:47 am, oyster wrote: > I want to extract some pages from vary pdf files, then write them > with/witout rotation into one new pdf file. something likes this > [py] > import gfx > doc = gfx.open("pdf", r"Theory.pdf") > pdf = gfx.PDF() > for pagenr in [1,5,7]: >     page = doc.getPage(p

Re: 4 hundred quadrillonth?

2009-05-25 Thread Scott David Daniels
Steven D'Aprano wrote: On Mon, 25 May 2009 16:21:19 +1200, Lawrence D'Oliveiro wrote: ... (0) "Opposite" is not well-defined unless you have a dichotomy. In the ... (1/3) Why do you jump to the conclusion that "pi=3" implies that only ... (1/2) If you "get rid of real numbers", then obviously y

Re: What text editor is everyone using for Python

2009-05-25 Thread alex23
On May 26, 3:01 pm, Steven D'Aprano wrote: > I dislike Gnome's user-interface, and I find gedit slightly too > underpowered and dumbed down for my taste. (Although it has a couple of > nice features.) Gedit is also nicely extensible: http://www.instructables.com/id/Using-Gedit-as-a-Python-IDE/

Re: What text editor is everyone using for Python

2009-05-25 Thread Lawrence D'Oliveiro
In message , LittleGrasshopper wrote: > ... I am looking for suitable syntax files for [editor of choice] ... I don't understand why people need "syntax files" to use a text editor. -- http://mail.python.org/mailman/listinfo/python-list

Re: What text editor is everyone using for Python

2009-05-25 Thread Steven D'Aprano
On Tue, 26 May 2009 18:31:56 +1200, Lawrence D'Oliveiro wrote: > In message b201-4b2445732...@v35g2000pro.googlegroups.com>, LittleGrasshopper > wrote: > >> ... I am looking for suitable syntax files for [editor of choice] ... > > I don't understand why people need "syntax files" to use a text