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 li

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

2010-11-17 Thread Tim Harig
On 2010-11-18, Tim Harig wrote: > On 2010-11-18, noydb 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

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 -- http://mail.python.org

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

2010-11-17 Thread Tim Harig
On 2010-11-18, noydb 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 Python to supply

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: 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: 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 le

Re: String multi-replace

2010-11-17 Thread Chris Rebert
On Wed, Nov 17, 2010 at 8:21 PM, Sorin Schwimmer 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 > > nodia={chr(196)+chr(130):'A',

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: simple(?) Python C module question

2010-11-17 Thread Dan Stromberg
On Wed, Nov 17, 2010 at 7:42 PM, Terry Reedy 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: >>> http://docs.python.org/release/2.6.6/library/ctypes.html#module-ctyp

Re: String multi-replace

2010-11-17 Thread Benjamin Kaplan
On Wed, Nov 17, 2010 at 11:21 PM, Sorin Schwimmer 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 > > nodia={chr(196)+chr(130):'A',

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: 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 wrote: >> On 11/17/2010 7:21 PM, Tim Harig wrote: >>> On 2010-11-18, dave wrote: http://sourceforge.net/projects/mysql-python/ Using this package, WITHOUT having MySQL installed on my Mac OS X, how can I us

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 output

[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 fixe

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 reall

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 wrote: > On 11/17/2010 7:21 PM, Tim Harig wrote: >> On 2010-11-18, dave 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? >>>

Re: returning results from function

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

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 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 d

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 >

Re: Program, Application, and Software

2010-11-17 Thread MRAB
On 18/11/2010 00:28, Ben Finney wrote: Alexander Kapps 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 instr

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 f

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 -- http://mail.p

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 Mark Wooding
Alexander Kapps 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] -- http://mail.python.org/mailman/listinfo/p

Re: simple(?) Python C module question

2010-11-17 Thread Mark Wooding
Mark Crispin 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 Wikipedia page, so o

Re: Program, Application, and Software

2010-11-17 Thread Ben Finney
Alexander Kapps 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 "hello"' > i

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: simple(?) Python C module question

2010-11-17 Thread geremy condra
On Wed, Nov 17, 2010 at 3:35 PM, Grant Edwards wrote: > On 2010-11-17, Mark Crispin 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 Pytho

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 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 to install all of

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: 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, laspi 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/d

Re: simple(?) Python C module question

2010-11-17 Thread Chris Rebert
On Wed, Nov 17, 2010 at 3:18 PM, Mark Crispin wrote: > 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.  :) > > I have got

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 # o

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 thi

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, laspi wrote: Is Unladen Swallow dead? >>> >>> No, it's just resting. >> >> For those who don't get that, The Monty Python

Re: simple(?) Python C module question

2010-11-17 Thread Grant Edwards
On 2010-11-17, Mark Crispin 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 > which library.

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, laspi wrote: Is Unladen Swallow dead? No, it's just resting. For those who don't get that, The Monty Python reference: "http://www.mtholyoke.ed

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, MRAB 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

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 u

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Cameron Simpson
On 16Nov2010 20:18, Ned Deily wrote: | In article | <55f26d5c-aba9-4892-9e2c-1caa9988e...@v23g2000vbi.googlegroups.com>, | Roger Davis 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 directly in a | > Termin

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 Kapps wrote: >>> ur"Scheiß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 -- http://mail.pyt

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 compu

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 v

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, laspi 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"; Thank y

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

2010-11-17 Thread Tim Harig
On 2010-11-17, MRAB 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 more then a single job(?

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

2010-11-17 Thread Tim Harig
On 2010-11-17, huisky 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 available in t

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: 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, laspi 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, the Norwegian Blue...Wh

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: 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

Re: Is Unladen Swallow dead?

2010-11-17 Thread John Ladasky
On Nov 16, 2:30 pm, laspi 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 Chris Rebert
On Wed, Nov 17, 2010 at 11:29 AM, Roger Davis 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 more gen

Re: strange subprocess behavior when calling ps

2010-11-17 Thread Roger Davis
On Nov 16, 11:19 pm, Ned Deily 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: 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, M

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 t

Re: Program, Application, and Software

2010-11-17 Thread Chris Rebert
On Wed, Nov 17, 2010 at 10:38 AM, Boštjan Mejak 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?: http://en.wikipedia.org/wiki/Computer_program http://en.wikipedi

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 : > g.db.escape_string(fields['hos

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: Raw Unicode docstring

2010-11-17 Thread MRAB
On 17/11/2010 16:32, RJB wrote: On Nov 16, 1:56 pm, Boštjan Mejak 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: r"""This is a raw docstring.""" If I have foreign letters in the docstring, I must

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 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: >> r"""This is a raw docstring.""" >> >> If I have foreign letters in t

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" VALUES('table','moz_bookmar

Re: Some syntactic sugar proposals

2010-11-17 Thread Mark Wooding
Christopher 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 proposal. The real

Re: Raw Unicode docstring

2010-11-17 Thread RJB
On Nov 16, 1:56 pm, Boštjan Mejak 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: > r"""This is a raw docstring.""" > > If I have foreign letters in the docstring, I must tuck a 'u' in front > o

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: how to use socket to get packet which destination ip is not local?

2010-11-17 Thread Mark Wooding
Hans 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. Raw sockets are

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 wrote: > 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, an

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 > > determinist

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 stat

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

Re: Some syntactic sugar proposals

2010-11-17 Thread Andreas Waldenburger
On Wed, 17 Nov 2010 10:18:51 -0500 Mel 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 default_

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 mag

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 web_site

Re: How can I catch segmentation fault in python?

2010-11-17 Thread justin
On Nov 17, 1:06 am, John Nagle wrote: > On 11/16/2010 10:15 PM, swapnil wrote: > > > > > > > On Nov 17, 10:26 am, justin  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 it's being > >> used

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:

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

Re: urllib2 error

2010-11-17 Thread asit dhal
On Wed, Nov 17, 2010 at 5:31 PM, Kushal Kumaran wrote: > On Wed, Nov 17, 2010 at 5:18 PM, asit 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

Re: urllib2 error

2010-11-17 Thread Kushal Kumaran
On Wed, Nov 17, 2010 at 5:18 PM, asit 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 = urllib2.urlopen(req) >

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 recent

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= ps.comm

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 Ned Deily
In article <61496525-afab-4d19-a7e9-e61fb46e0...@n30g2000vbb.googlegroups.com>, Roger Davis 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 this problem

Re: import site fails - Please Help

2010-11-17 Thread swapnil
On Nov 15, 1:46 pm, Helmut Jarausch 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 python upon startup > >

Re: MATLAB to Python?

2010-11-17 Thread Arnaud Delobelle
MATLABdude 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 wrong with m

Re: MATLAB to Python?

2010-11-17 Thread Carl Banks
On Nov 17, 12:04 am, MATLABdude 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 > > What is

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, i

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, 2010

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