MATLAB to Python?

2010-11-17 Thread MATLABdude
Hi! Can you, please, try to help me with Python? I try to convert a MATLAB program to Python. Here are the MATLAB codes: http://pastebin.com/eJetYizv http://pastebin.com/0eXTVfyN Here is my Python code: http://pastebin.com/jCPdLHx7 What is wrong with my Python code? The program doesn't produce

Re: Cannot Remove File: Device or resource busy

2010-11-17 Thread Brett Bowman
Good ideas, but I've tried them already: -No del command, or replacing it with a set-to-null, neither solve my file access problem. -PdfFileReader has no close() function, and causes an error. Weird, but true. -pdf_handle.close() on the other hand, fails to solve the problem. On Tue, Nov 16,

Re: MATLAB to Python?

2010-11-17 Thread Peter Otten
MATLABdude wrote: Can you, please, try to help me with Python? I try to convert a MATLAB program to Python. Here are the MATLAB codes: http://pastebin.com/eJetYizv http://pastebin.com/0eXTVfyN Here is my Python code: http://pastebin.com/jCPdLHx7 That is too much code for me, in a

Re: MATLAB to Python?

2010-11-17 Thread Carl Banks
On Nov 17, 12:04 am, MATLABdude matlab.d...@mbnet.fi wrote: Hi! Can you, please, try to help me with Python? I try to convert a MATLAB program to Python. Here are the MATLAB codes:http://pastebin.com/eJetYizvhttp://pastebin.com/0eXTVfyN Here is my Python code:http://pastebin.com/jCPdLHx7

Re: MATLAB to Python?

2010-11-17 Thread Arnaud Delobelle
MATLABdude matlab.d...@mbnet.fi writes: Hi! Can you, please, try to help me with Python? I try to convert a MATLAB program to Python. Here are the MATLAB codes: http://pastebin.com/eJetYizv http://pastebin.com/0eXTVfyN Here is my Python code: http://pastebin.com/jCPdLHx7 What is

Re: import site fails - Please Help

2010-11-17 Thread swapnil
On Nov 15, 1:46 pm, Helmut Jarausch jarau...@igpm.rwth-aachen.de wrote: Hi, I'm completely puzzled and I hope someone can shed some light on it. After cloning a running system, booting the new machine from a rescue CD, chroot to the new root partition, I get the following strange error from

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Ned Deily
In article 61496525-afab-4d19-a7e9-e61fb46e0...@n30g2000vbb.googlegroups.com, Roger Davis r...@hawaii.edu wrote: First, I *still* don't quite understand why this happens with my 2.6.6 interpreter but not my 2.6.1, and why another of the respondents to this thread (Chris) could not duplicate

In-process interpreters

2010-11-17 Thread swapnil
Hi, Please refer my post on Python-ideas list http://mail.python.org/pipermail/python-ideas/2010-November/008666.html and provide feedback if any. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Jean-Michel Pichavant
Roger Davis wrote: Hi all, [snip] Roger Davis # code follows #!/usr/bin/python import sys import subprocess def main(): psargs= [/bin/ps, -e] try: ps= subprocess.Popen(psargs, stdout=subprocess.PIPE, close_fds=True) psout=

urllib2 error

2010-11-17 Thread asit
I have this piece of code import urllib2 proc_url = 'http://www.nse-india.com/content/historical/EQUITIES/2001/ JAN/cm01JAN2001bhav.csv.zip' print 'processing', proc_url req = urllib2.Request(proc_url) res = urllib2.urlopen(req) when i run this...following error comes Traceback (most

Re: urllib2 error

2010-11-17 Thread Kushal Kumaran
On Wed, Nov 17, 2010 at 5:18 PM, asit lipu...@gmail.com wrote: I have this piece of code import urllib2 proc_url = 'http://www.nse-india.com/content/historical/EQUITIES/2001/ JAN/cm01JAN2001bhav.csv.zip' print 'processing', proc_url req = urllib2.Request(proc_url) res =

Re: urllib2 error

2010-11-17 Thread asit dhal
On Wed, Nov 17, 2010 at 5:31 PM, Kushal Kumaran kushal.kumaran+pyt...@gmail.com wrote: On Wed, Nov 17, 2010 at 5:18 PM, asit lipu...@gmail.com wrote: I have this piece of code import urllib2 proc_url = 'http://www.nse-india.com/content/historical/EQUITIES/2001/ JAN/cm01JAN2001bhav.csv.zip'

Re: Cannot Remove File: Device or resource busy

2010-11-17 Thread Christian Heimes
Am 17.11.2010 09:16, schrieb Brett Bowman: Good ideas, but I've tried them already: -No del command, or replacing it with a set-to-null, neither solve my file access problem. -PdfFileReader has no close() function, and causes an error. Weird, but true. -pdf_handle.close() on the other hand,

Re: Some syntactic sugar proposals

2010-11-17 Thread Christopher
? Of course we can write it as     t = foo() if pred(foo()) else default_value but here we have 2 foo() calls instead of one. Why can't we write just something like this:     t = foo() if pred(it) else default_value where it means foo() value? i don't like magic names. what about: t =

Re: How can I catch segmentation fault in python?

2010-11-17 Thread justin
On Nov 17, 1:06 am, John Nagle na...@animats.com wrote: On 11/16/2010 10:15 PM, swapnil wrote: On Nov 17, 10:26 am, justinjustpar...@gmail.com  wrote: Hi all, I am calling a program written in C inside Python using ctypes, and it seems that sometimes the program in C crashes while

Re: Pickle in a POST/GET request give EOFError

2010-11-17 Thread Romaric DEFAUX
Le 16/11/2010 17:47, Romaric DEFAUX a écrit : Hi everybody ! First time I write to this mailing list :) I started writing in python last week, that's probably why I can't understand the following problem... I create a list called web_site_list. This list contain dictionaries called

Re: Some syntactic sugar proposals

2010-11-17 Thread Mel
Christopher wrote: ? Of course we can write it as t = foo() if pred(foo()) else default_value but here we have 2 foo() calls instead of one. Why can't we write just something like this: t = foo() if pred(it) else default_value where it means foo() value? i don't like magic names. what

Re: Some syntactic sugar proposals

2010-11-17 Thread Andreas Waldenburger
On Wed, 17 Nov 2010 10:18:51 -0500 Mel mwil...@the-wire.com wrote: Christopher wrote: ? Of course we can write it as t = foo() if pred(foo()) else default_value but here we have 2 foo() calls instead of one. Why can't we write just something like this: t = foo() if pred(it) else

Re: How can I catch segmentation fault in python?

2010-11-17 Thread Wolfgang Rohdewald
On Mittwoch 17 November 2010, justin wrote: But the problem is that the code is not mine, and it takes over a day for me to get the point where the segmentation fault occurred. Plus, it seems that the point is not deterministic Still, I think I should at least try to figure out exactly at

Oracle jdbc sql select for update in python

2010-11-17 Thread loial
I want to do a select from...for update in python, update the selected row and then commit; However cannot seem to get it to work...the update statement seems to be waiting because the row is locked. Presumably oracle thinks the update is another transaction. How can I get this to work? What

Re: How can I catch segmentation fault in python?

2010-11-17 Thread Wolfgang Rohdewald
On Mittwoch 17 November 2010, Wolfgang Rohdewald wrote: On Mittwoch 17 November 2010, justin wrote: But the problem is that the code is not mine, and it takes over a day for me to get the point where the segmentation fault occurred. Plus, it seems that the point is not deterministic

Re: How can I catch segmentation fault in python?

2010-11-17 Thread justin
Just checked what is valgrind, sounds promising. Let me try that. Thanks a lot, Justin. On Nov 17, 9:47 am, Wolfgang Rohdewald wolfg...@rohdewald.de wrote: On Mittwoch 17 November 2010, Wolfgang Rohdewald wrote: On Mittwoch 17 November 2010, justin wrote: But the problem is that the code

Re: how to use socket to get packet which destination ip is not local?

2010-11-17 Thread Mark Wooding
Hans hans...@gmail.com writes: I tried socket bind to 0.0.0.0, but it only binds to any local ip, not any ip which may not be local. therefore the socket cannot get that dhcp offer packet even I can use wireshark to see that packet did come to this pc. You must use a raw socket for this.

pySerial Vs 2 Serial Ports

2010-11-17 Thread Virgílio Bento
Dear all, I Have two modules communicating by Bluetooth. Basically I want to rotate two vector using the accelerometer data. I read the data using pyserial like this: ### ser1 = serial.Serial(port='COM6',baudrate=19200) if ser1.isOpen(): print Comm

Re: Raw Unicode docstring

2010-11-17 Thread RJB
On Nov 16, 1:56 pm, Boštjan Mejak bostjan.me...@gmail.com wrote: Hello, how does one write a raw unicode docstring? If I have backslashes in the docstring, I must tuck an 'r' in front of it, like this: rThis is a raw docstring. If I have foreign letters in the docstring, I must tuck a 'u'

Re: Some syntactic sugar proposals

2010-11-17 Thread Mark Wooding
Christopher nadiasver...@gmail.com writes: i don't like magic names. what about: t = foo() as v if pred(v) else default_value This is an improvement on `it'; anaphorics are useful in their place, but they don't seem to fit well with Python. But I don't think that's the big problem with this

Sqlalchemy access to Firefox's places.sqlite

2010-11-17 Thread Kent Tenney
Howdy, Lazy, wanting to access Firefox's places.sqlite via Sqlalchemy. How about this: Sqlite Manager - places.sqlite - Export Wizard - table name sqlite_manager this produces file sqlite_manager.sql which looks like: BEGIN TRANSACTION; INSERT INTO sqlite_master

Re: Raw Unicode docstring

2010-11-17 Thread Steve Holden
On 11/17/2010 11:32 AM, RJB wrote: On Nov 16, 1:56 pm, Boštjan Mejak bostjan.me...@gmail.com wrote: Hello, how does one write a raw unicode docstring? If I have backslashes in the docstring, I must tuck an 'r' in front of it, like this: rThis is a raw docstring. If I have foreign letters

Re: Raw Unicode docstring

2010-11-17 Thread MRAB
On 17/11/2010 16:32, RJB wrote: On Nov 16, 1:56 pm, Boštjan Mejakbostjan.me...@gmail.com wrote: Hello, how does one write a raw unicode docstring? If I have backslashes in the docstring, I must tuck an 'r' in front of it, like this: rThis is a raw docstring. If I have foreign letters in the

Program, Application, and Software

2010-11-17 Thread Boštjan Mejak
What is the difference between a program, an application, and software? -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickle in a POST/GET request give EOFError

2010-11-17 Thread Adam Tauno Williams
On Wed, 2010-11-17 at 15:44 +0100, Romaric DEFAUX wrote: After entirely rewrite my code to not use Web service but socket (a real client/server program) I finally found the problem... And it's not linked to the POST or GET method... It's because of that :

Re: Program, Application, and Software

2010-11-17 Thread Chris Rebert
On Wed, Nov 17, 2010 at 10:38 AM, Boštjan Mejak bostjan.me...@gmail.com wrote: What is the difference between a program, an application, and software? (1) This has nothing at all to do with (wx)Python specifically. (2) Did you try consulting Wikipedia?:

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Roger Davis
Completely off topic but I think the try clause could be rewritten that way: ... Don't use bare except clause, you're masking syntax errors for instance, which will be flagged as 'unexpected error in generation In a more general manner, if something unexpected happens it's better to

Re: Help: Guide needed in trying to delete/flush the content of a fifo file.

2010-11-17 Thread Ton
Thanks Mrab ... the way of how to use the pipe for the producer as well as the consumer is a bit confusing to me. As i am using the subprocess for both the producer and the consumer as above. Can you please explain me further using a bit of pseudocode. Thanks for ur concern. In Nov 17, 12:13 am,

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Roger Davis
On Nov 16, 11:19 pm, Ned Deily n...@acm.org wrote: Interesting.  It appears that OS X 10.6 takes into account the ... Thanks very much for your thorough explanation, Ned! I think I've got what I need now. Roger -- http://mail.python.org/mailman/listinfo/python-list

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Chris Rebert
On Wed, Nov 17, 2010 at 11:29 AM, Roger Davis r...@hawaii.edu wrote: Completely off topic but I think the try clause could be rewritten that way: ... Don't use bare except clause, you're masking syntax errors for instance, which will be flagged as 'unexpected error in generation In a

Re: Is Unladen Swallow dead?

2010-11-17 Thread John Ladasky
On Nov 16, 2:30 pm, laspi lorena.aspi...@gmail.com wrote: Is Unladen Swallow dead? No, it's just resting. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Roger Davis
Thanks for the clarification on exceptions, Chris! Roger -- http://mail.python.org/mailman/listinfo/python-list

How to read such file and sumarize the data?

2010-11-17 Thread huisky
Say I have following log file, which records the code usage. I want to read this file and do the summarize how much total CPU time consumed for each user. Is Python able to do so or say easy to achieve this?, anybody can give me some hints, appricate very much! Example log file.

Re: Is Unladen Swallow dead?

2010-11-17 Thread John Nagle
On 11/17/2010 12:49 PM, John Ladasky wrote: On Nov 16, 2:30 pm, laspilorena.aspi...@gmail.com wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty Python reference: http://www.mtholyoke.edu/~ebarnes/python/dead-parrot.htm; Owner: Oh yes, the, uh,

Re: How to read such file and sumarize the data?

2010-11-17 Thread MRAB
On 17/11/2010 21:45, huisky wrote: Say I have following log file, which records the code usage. I want to read this file and do the summarize how much total CPU time consumed for each user. Is Python able to do so or say easy to achieve this?, anybody can give me some hints, appricate very much!

Re: How to read such file and sumarize the data?

2010-11-17 Thread Tim Harig
On 2010-11-17, huisky hui...@gmail.com wrote: I want to read this file and do the summarize how much total CPU time consumed for each user. Is Python able to do so or say easy to achieve this?, anybody can give me some hints, appricate very much! The question is, is the information you want

Re: How to read such file and sumarize the data?

2010-11-17 Thread Tim Harig
On 2010-11-17, MRAB pyt...@mrabarnett.plus.com wrote: When a user starts, save the info in the first dict, and when a user finishes, calculate the elapsed time and add it to the total for that user. Perhaps you know more about the structure of this data. It seems to me that a user might have

Re: Is Unladen Swallow dead?

2010-11-17 Thread Alexander Kapps
On 17.11.2010 23:09, John Nagle wrote: On 11/17/2010 12:49 PM, John Ladasky wrote: On Nov 16, 2:30 pm, laspilorena.aspi...@gmail.com wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty Python reference:

Re: How to read such file and sumarize the data?

2010-11-17 Thread Steve Holden
On 11/17/2010 4:45 PM, huisky wrote: Say I have following log file, which records the code usage. I want to read this file and do the summarize how much total CPU time consumed for each user. Is Python able to do so or say easy to achieve this?, anybody can give me some hints, appricate very

Re: Program, Application, and Software

2010-11-17 Thread Alexander Kapps
On 17.11.2010 19:38, Boštjan Mejak wrote: What is the difference between a program, an application, and software? Program: A sequence of one or more instructions (even 'print hello' is a valid Python program) Application: Usually a large(er), complex program Software: The parts of a

Re: Raw Unicode docstring

2010-11-17 Thread Alexander Kapps
On 17.11.2010 06:14, John Machin wrote: On Nov 17, 9:34 am, Alexander Kappsalex.ka...@web.de wrote: urScheißt\nderBär\nim Wald? Nicht ohne eine Genehmigung von der Umwelt Erhaltung Abteilung. The typical response around here is Ja, aber nur wenn er Klopapier dabei hat. :-D --

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Cameron Simpson
On 16Nov2010 20:18, Ned Deily n...@acm.org wrote: | In article | 55f26d5c-aba9-4892-9e2c-1caa9988e...@v23g2000vbi.googlegroups.com, | Roger Davis r...@hawaii.edu wrote: | I am running 2.6.6 under MacOS 10.6.4 on a MacBook Pro Intel. I have | appended the code below. I am running both commands

simple(?) Python C module question

2010-11-17 Thread Mark Crispin
This is something that ought to be simple, but going through the documentation hasn't come up with the answer. Hopefully someone can answer it faster than I can figure it out from the documentation. I am using Python 2.6 for a project. I do not have a choice in the matter, so telling me to

Re: How to read such file and sumarize the data?

2010-11-17 Thread MRAB
On 17/11/2010 22:49, Tim Harig wrote: On 2010-11-17, MRABpyt...@mrabarnett.plus.com wrote: When a user starts, save the info in the first dict, and when a user finishes, calculate the elapsed time and add it to the total for that user. Perhaps you know more about the structure of this data.

Re: Is Unladen Swallow dead?

2010-11-17 Thread Robert Kern
On 11/17/10 4:51 PM, Alexander Kapps wrote: On 17.11.2010 23:09, John Nagle wrote: On 11/17/2010 12:49 PM, John Ladasky wrote: On Nov 16, 2:30 pm, laspilorena.aspi...@gmail.com wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty Python reference:

Re: simple(?) Python C module question

2010-11-17 Thread Grant Edwards
On 2010-11-17, Mark Crispin nos...@panda.com wrote: Hey, it's the IMAP guy! Get 'im! I have a Python module written in C that interfaces with an external C library. Basically, the project is to make it possible to use that library from Python scripts. If you know who I am, you can guess

Re: Is Unladen Swallow dead?

2010-11-17 Thread Martin Gregorie
On Wed, 17 Nov 2010 23:51:01 +0100, Alexander Kapps wrote: On 17.11.2010 23:09, John Nagle wrote: On 11/17/2010 12:49 PM, John Ladasky wrote: On Nov 16, 2:30 pm, laspilorena.aspi...@gmail.com wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty

Re: How to read such file and sumarize the data?

2010-11-17 Thread Martin Gregorie
On Wed, 17 Nov 2010 13:45:58 -0800, huisky wrote: Say I have following log file, which records the code usage. I want to read this file and do the summarize how much total CPU time consumed for each user. Two points you should think about: - I don't think you can extract CPU time from this

first attempts with pybluez on Linux fail as well

2010-11-17 Thread Gelonida
Hi, Wanted to write a first simple example with pybluez and offer a serial connection service with a given name. What I tried (being inspired by http://people.csail.mit.edu/albert/bluez-intro/x290.html ) is: server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM ) port = bluetooth.PORT_ANY #

Re: simple(?) Python C module question

2010-11-17 Thread Chris Rebert
On Wed, Nov 17, 2010 at 3:18 PM, Mark Crispin nos...@panda.com wrote: snip I have a Python module written in C that interfaces with an external C library.  Basically, the project is to make it possible to use that library from Python scripts.  If you know who I am, you can guess which library.  

Re: Is Unladen Swallow dead?

2010-11-17 Thread Philip Semanchuk
On Nov 17, 2010, at 5:09 PM, John Nagle wrote: On 11/17/2010 12:49 PM, John Ladasky wrote: On Nov 16, 2:30 pm, laspilorena.aspi...@gmail.com wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty Python reference:

Using Python and Connecting to MySQL remotely WITHOUT MySQL installed on local computer

2010-11-17 Thread dave
http://sourceforge.net/projects/mysql-python/ Using this package, WITHOUT having MySQL installed on my Mac OS X, how can I use python to connect to a remote MySQL server? All of the tutorials mention having to download MySQL! -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python and Connecting to MySQL remotely WITHOUT MySQL installed on local computer

2010-11-17 Thread Tim Harig
On 2010-11-18, dave davidrey...@gmail.com wrote: http://sourceforge.net/projects/mysql-python/ Using this package, WITHOUT having MySQL installed on my Mac OS X, how can I use python to connect to a remote MySQL server? All of the tutorials mention having to download MySQL! You don't have

Re: simple(?) Python C module question

2010-11-17 Thread geremy condra
On Wed, Nov 17, 2010 at 3:35 PM, Grant Edwards inva...@invalid.invalid wrote: On 2010-11-17, Mark Crispin nos...@panda.com wrote: Hey, it's the IMAP guy!  Get 'im! I have a Python module written in C that interfaces with an external C library.  Basically, the project is to make it possible

Re: simple(?) Python C module question

2010-11-17 Thread Mark Crispin
On Wed, 17 Nov 2010, Grant Edwards posted: Hey, it's the IMAP guy! Get 'im! Busted! :p Alright, here's the full story. As may be obvious to some, the module is to be a Python interface into c-client. What may not be obvious is that this is for QA automation. The consumers of this module

Re: Program, Application, and Software

2010-11-17 Thread Ben Finney
Alexander Kapps alex.ka...@web.de writes: On 17.11.2010 19:38, Boštjan Mejak wrote: What is the difference between a program, an application, and software? Alexander's guide is good. Some notes from a native speaker of English: Program: A sequence of one or more instructions (even 'print

Re: simple(?) Python C module question

2010-11-17 Thread Mark Wooding
Mark Crispin nos...@panda.com writes: I have a Python module written in C that interfaces with an external C library. Basically, the project is to make it possible to use that library from Python scripts. If you know who I am, you can guess which library. :) You have your very own

Re: Program, Application, and Software

2010-11-17 Thread Mark Wooding
Alexander Kapps alex.ka...@web.de writes: Application: Usually a large(er), complex program I'd say that an `application' is specifically a program intended for direct human use. Other things are servers, daemons and utilities. But I might just be weird. -- [mdw] --

Re: simple(?) Python C module question

2010-11-17 Thread Mark Crispin
On Thu, 18 Nov 2010, Mark Wooding posted: [snip] Whoo-hoo! That's exactly what I was looking for. If we ever meet in person, I owe you a beer, sir. And by that I mean real beer (from what we call a microbrew), not Budweiser... :) -- Mark -- http://panda.com/mrc Democracy is two wolves

Re: Program, Application, and Software

2010-11-17 Thread Tim Chase
On 11/17/2010 05:10 PM, Alexander Kapps wrote: On 17.11.2010 19:38, Boštjan Mejak wrote: What is the difference between a program, an application, and software? Software: The parts of a computer that you *can't* kick. Programmer: the part that usually gets kicked... -tkc --

Re: How to read such file and sumarize the data?

2010-11-17 Thread Terry Reedy
On 11/17/2010 6:10 PM, Steve Holden wrote: $ cat data.py lines = open(data.txt).readlines() Since you iterate through the file just once, there is no reason I can think of to make a complete in-memory copy. That would be a problem with a multi-gigabyte log file ;=). In 3.x at least, open

Re: Program, Application, and Software

2010-11-17 Thread MRAB
On 18/11/2010 00:28, Ben Finney wrote: Alexander Kappsalex.ka...@web.de writes: On 17.11.2010 19:38, Boštjan Mejak wrote: What is the difference between a program, an application, and software? Alexander's guide is good. Some notes from a native speaker of English: Program: A sequence of

Re: How to read such file and sumarize the data?

2010-11-17 Thread Steve Holden
On 11/17/2010 7:51 PM, Terry Reedy wrote: On 11/17/2010 6:10 PM, Steve Holden wrote: $ cat data.py lines = open(data.txt).readlines() Since you iterate through the file just once, there is no reason I can think of to make a complete in-memory copy. That would be a problem with a

Re: Using Python and Connecting to MySQL remotely WITHOUT MySQL installed on local computer

2010-11-17 Thread Steve Holden
On 11/17/2010 7:21 PM, Tim Harig wrote: On 2010-11-18, dave davidrey...@gmail.com wrote: http://sourceforge.net/projects/mysql-python/ Using this package, WITHOUT having MySQL installed on my Mac OS X, how can I use python to connect to a remote MySQL server? All of the tutorials mention

Re: returning results from function

2010-11-17 Thread Cameron Simpson
On 11Nov2010 15:29, Chris Rebert creb...@ucsd.edu wrote: | On Nov 11, 2010, at 1:54 PM, Chris Rebert wrote: | On Thu, Nov 11, 2010 at 1:16 PM, Neil Berg nb...@atmos.ucla.edu wrote: | time_y = ncfile.variables['time_y'][:] # (time,int) [yrs] | time_m = ncfile.variables['time_m'][:] # (time,int)

Re: Using Python and Connecting to MySQL remotely WITHOUT MySQL installed on local computer

2010-11-17 Thread Tim Harig
On 2010-11-18, Steve Holden st...@holdenweb.com wrote: On 11/17/2010 7:21 PM, Tim Harig wrote: On 2010-11-18, dave davidrey...@gmail.com wrote: http://sourceforge.net/projects/mysql-python/ Using this package, WITHOUT having MySQL installed on my Mac OS X, how can I use python to connect to

Re: simple(?) Python C module question

2010-11-17 Thread Terry Reedy
On 11/17/2010 7:25 PM, Mark Crispin wrote: Have you looked at ctypes? It's not suitable for all libraries, but it can often obviate the need to write any C code: http://docs.python.org/release/2.6.6/library/ctypes.html#module-ctypes Hmm. I don't think that it helps, especially as I don't

[ANN]: 'tren' Cross-Platform Batch Renaming Tool, Version 1.239 Released

2010-11-17 Thread Tim Daneliuk
'tren' Version 1.239 is now released and available for download at: http://www.tundraware.com/Software/tren The last public release was 1.217. - What's New In This Release? --- This release

How to run an EXE, with argument, capture output value

2010-11-17 Thread noydb
Hello All, I would appreciate some guidance on this. I'm a newbe, sorry if I sound dumb - I kind of am on this stuff! I have an executable that I want to run within python code. The exe requires an input text file, the user to click a 'compute' button, and then the exe calculates several

Re: Using Python and Connecting to MySQL remotely WITHOUT MySQL installed on local computer

2010-11-17 Thread Steve Holden
On 11/17/2010 10:19 PM, Tim Harig wrote: On 2010-11-18, Steve Holden st...@holdenweb.com wrote: On 11/17/2010 7:21 PM, Tim Harig wrote: On 2010-11-18, dave davidrey...@gmail.com wrote: http://sourceforge.net/projects/mysql-python/ Using this package, WITHOUT having MySQL installed on my Mac

String multi-replace

2010-11-17 Thread Sorin Schwimmer
Hi All, I have to eliminate diacritics in a fairly large file. Inspired by http://code.activestate.com/recipes/81330/, I came up with the following code: #! /usr/bin/env python import re nodia={chr(196)+chr(130):'A', # mamaliga chr(195)+chr(130):'A', # A^ chr(195)+chr(142):'I',

Re: String multi-replace

2010-11-17 Thread Benjamin Kaplan
On Wed, Nov 17, 2010 at 11:21 PM, Sorin Schwimmer sx...@yahoo.com wrote: Hi All, I have to eliminate diacritics in a fairly large file. Inspired by http://code.activestate.com/recipes/81330/, I came up with the following code: #! /usr/bin/env python import re

Re: simple(?) Python C module question

2010-11-17 Thread Dan Stromberg
On Wed, Nov 17, 2010 at 7:42 PM, Terry Reedy tjre...@udel.edu wrote: On 11/17/2010 7:25 PM, Mark Crispin wrote: Have you looked at ctypes? It's not suitable for all libraries, but it can often obviate the need to write any C code:

Re: Help in language development

2010-11-17 Thread Steven D'Aprano
Hello Pedro Igor, On Tue, 16 Nov 2010 12:51:07 -0800, pedro igor sampaio avelino wrote: Hello, my name Pedro Igor, I am a student and develop applications in python for 1 year. I enrolled in the group to contribute in developing this wonderful language that helps me both in day-to-day, but

Re: String multi-replace

2010-11-17 Thread Chris Rebert
On Wed, Nov 17, 2010 at 8:21 PM, Sorin Schwimmer sx...@yahoo.com wrote: Hi All, I have to eliminate diacritics in a fairly large file. Inspired by http://code.activestate.com/recipes/81330/, I came up with the following code: #! /usr/bin/env python import re

Re: Some syntactic sugar proposals

2010-11-17 Thread Steven D'Aprano
On Wed, 17 Nov 2010 16:31:40 +, Mark Wooding wrote: But I don't think that's the big problem with this proposal. The real problem is that it completely changes the evaluation rule for the conditional expression. (The evaluation rule is already pretty screwy: Python is consistently

Re: String multi-replace

2010-11-17 Thread Steven D'Aprano
On Wed, 17 Nov 2010 20:21:06 -0800, Sorin Schwimmer wrote: Hi All, I have to eliminate diacritics in a fairly large file. What's fairly large? Large to you is probably not large to your computer. Anything less than a few dozen megabytes is small enough to be read entirely into memory.

Re: String multi-replace

2010-11-17 Thread Sorin Schwimmer
Thanks for your answers. Benjamin Kaplan: of course dict is a type... silly me! I'll blame it on the time (it's midnight here). Chris Rebert: I'll have a look. Thank you both, SxN -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run an EXE, with argument, capture output value

2010-11-17 Thread Tim Harig
On 2010-11-18, noydb noyd...@gmail.com wrote: I have an executable that I want to run within python code. The exe requires an input text file, the user to click a 'compute' button, and then the exe calculates several output values, one of which I want to capture into a variable. Can I use

Re: String multi-replace

2010-11-17 Thread Sorin Schwimmer
Steven D'Aprano: the original file is 139MB (that's the typical size for it). Eliminating diacritics is just a little toping on the cake; the processing is something else. Thanks anyway for your suggestion, SxN PS Perhaps I should have mention that I'm on Python 2.7 --

Re: How to run an EXE, with argument, capture output value

2010-11-17 Thread Tim Harig
On 2010-11-18, Tim Harig user...@ilthio.net wrote: On 2010-11-18, noydb noyd...@gmail.com wrote: I have an executable that I want to run within python code. The exe requires an input text file, the user to click a 'compute' button, and then the exe calculates several output values, one of

Does Pygoogle allows for advanced search options?

2010-11-17 Thread neocortex
Hello All, Can anyone help me with the Pygoogle: from pygoogle import pygoogle word = u'something' request_word = word.encode('utf-8') request = ('%s+site:.edu' % request_word) g = pygoogle(request) g.get_result_count() Now, I realized that domain restriction works (site:.edu etc.), but I would

[issue10442] Please by default enforce ssl certificate checking in modules that can have user's which *depend* on the security of the ssl connection.

2010-11-17 Thread david
New submission from david db.pub.m...@gmail.com: Please by default enforce ssl certificate checking in modules that can have user's which *depend* on the security of the ssl connection. See https://bugs.launchpad.net/ubuntu/+source/offlineimap/+bug/675120 http://bugs.python.org/issue10274

[issue10441] Please by default enforce ssl certificate checking in modules that can have user's which *depend* on the security of the ssl connection.

2010-11-17 Thread david
New submission from david db.pub.m...@gmail.com: Please by default enforce ssl certificate checking in modules that can have user's which *depend* on the security of the ssl connection. See https://bugs.launchpad.net/ubuntu/+source/offlineimap/+bug/675120 http://bugs.python.org/issue10274

[issue10442] Please by default enforce ssl certificate checking in modules that can have user's which *depend* on the security of the ssl connection.

2010-11-17 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- resolution: - duplicate status: open - closed superseder: - Please by default enforce ssl certificate checking in modules that can have user's which *depend* on the security of the ssl connection. ___ Python

[issue10436] tarfile.extractfile in r| stream mode fails with filenames or members from getmembers()

2010-11-17 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: This behaviour is intentional. A tar archive does not contain a central directory structure, it is just a chain of files. As a side-effect it is possible to have multiple files with the same name in one archive, e.g. when append mode was

[issue10441] Please by default enforce ssl certificate checking in modules that can have user's which *depend* on the security of the ssl connection.

2010-11-17 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +pitrou type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10441 ___ ___

[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2010-11-17 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1589 ___ ___ Python-bugs-list

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-17 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10441 ___ ___ Python-bugs-list

[issue10274] imaplib should provide a means to validate a remote server ssl certificate(s)

2010-11-17 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10274 ___ ___ Python-bugs-list

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-17 Thread david
david db.pub.m...@gmail.com added the comment: Sorry, I don't remember seeing the change-set /commit showing that is now on by default. (for those modules). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10441

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-17 Thread david
david db.pub.m...@gmail.com added the comment: Are you referring to http://code.python.org/hg/branches/py3k/rev/86f97255bfc8 where there is now 2.29 + .. warning:: 2.30 + If neither *cafile* nor *capath* is specified, an HTTPS request 2.31 + will not do any

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2010-11-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Are you referring to http://code.python.org/hg/branches/py3k/rev/86f97255bfc8 where there is now 2.29 + .. warning:: 2.30 + If neither *cafile* nor *capath* is specified, an HTTPS request 2.31 + will not do any

[issue10432] concurrent.futures.as_completed() spins waiting for futures to complete

2010-11-17 Thread Brian Quinlan
Brian Quinlan br...@sweetapp.com added the comment: Looks good but you forgot to actually use your new Waiter ;-) Committed as r86491. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker

  1   2   3   >