Re: [Ann] Cobra 3.0 - Windows GUI test automation tool

2013-01-09 Thread Nagappan Alagappan
Hello, Apologize for the inconvenience. Correction in binary download: http://code.google.com/p/cobra-winldtp/downloads/list Thanks Nagappan On Tue, Jan 8, 2013 at 5:07 PM, Nagappan Alagappan nagap...@gmail.comwrote: Hello, Highlights: - Added getcellsize / getcellvalue, returns table

functon invoke or not

2013-01-09 Thread skyworld
Hi, I see someone's code as this: class ABC: def __init__(self, env): ... self.jmpTable['batchQ']['submit_job'] = self.lsf_submit ... def lsf_submit(self, cmd,env): . what confused me is why there is no parentheses for

Re: functon invoke or not

2013-01-09 Thread Peter Otten
skyworld wrote: Hi, I see someone's code as this: class ABC: def __init__(self, env): ... self.jmpTable['batchQ']['submit_job'] = self.lsf_submit The bound method self.lsf_submit is not invoked in this line, it is stored for later use.

Re: functon invoke or not

2013-01-09 Thread Mitya Sirenef
On Wed 09 Jan 2013 03:23:56 AM EST, skyworld wrote: Hi, I see someone's code as this: class ABC: def __init__(self, env): ... self.jmpTable['batchQ']['submit_job'] = self.lsf_submit ... def lsf_submit(self, cmd,env): . what

Re: functon invoke or not

2013-01-09 Thread skyworld
On 1月9日, 下午4时46分, Mitya Sirenef msire...@lightbird.net wrote: On Wed 09 Jan 2013 03:23:56 AM EST, skyworld wrote: Hi, I see someone's code as this: class ABC:      def __init__(self, env):           ...           self.jmpTable['batchQ']['submit_job']  = self.lsf_submit  

Re: functon invoke or not

2013-01-09 Thread Jussi Piitulainen
skyworld writes: Hi, I see someone's code as this: class ABC: def __init__(self, env): ... self.jmpTable['batchQ']['submit_job'] = self.lsf_submit ... def lsf_submit(self, cmd,env): . what confused me is why there is no

Re: How to modify this script?

2013-01-09 Thread Kurt Hansen
Den 08/01/13 16.31, chaouche yacine skrev: Well tell me how do you use this script in gedit, are you using it as a plugin ? Snippets is a plugin, yes. It's included in the .app for Mac (v. 2.30.2), but not activated af default. Open Tools in the menu line and click Manage snippets Here

Re: How to modify this script?

2013-01-09 Thread Kurt Hansen
Den 06/01/13 15.20, Chris Angelico wrote: That version should work. Am 06.01.2013 15:30 schrieb Kurt Hansen: It certainly does. I'll keep it and use it until at better solution is found. On 08/01/13 15.18, Thomas Rachel wrote: That would be simple: Replace output += 'td colspan=' +

Re: How to get the selected text of the webpage in chrome through python ?

2013-01-09 Thread Alister
On Mon, 07 Jan 2013 20:20:28 -0800, iMath wrote: How to get the selected text of the webpage in chrome through python ? i think you need to explain your requirement further also what do you want to do to the text once you have it? -- Genius is one percent inspiration and ninety-nine

Regex not matching a string

2013-01-09 Thread python . prog29
Hi All - In the following code ,am trying to remove a multi line - comment that contains This is a test comment for some reason the regex is not matching.. can anyone provide inputs on why it is so? import os import sys import re import fnmatch def find_and_remove(haystack, needle):

Re: How to modify this script?

2013-01-09 Thread chaouche yacine
I figrued it out. Copy/paste exactly these lines in the snippets tool. You can bind it to a key as you may know, I bound it to Ctrl-E. So paste it in a new snippet (keep the original in a safe place), bind to a key, select the text you want to html-tableize and hit the key binding. In my case

Re: Regex not matching a string

2013-01-09 Thread Steven D'Aprano
On Wed, 09 Jan 2013 02:08:23 -0800, python.prog29 wrote: Hi All - In the following code ,am trying to remove a multi line - comment that contains This is a test comment for some reason the regex is not matching.. can anyone provide inputs on why it is so? It works for me. Some

Re: Regex not matching a string

2013-01-09 Thread Peter Otten
python.pro...@gmail.com wrote: In the following code ,am trying to remove a multi line - comment that contains This is a test comment for some reason the regex is not matching.. can anyone provide inputs on why it is so? def find_and_remove(haystack, needle): pattern =

Re: How to modify this script?

2013-01-09 Thread Kurt Hansen
Den 09/01/13 11.23, chaouche yacine skrev: I figrued it out. Copy/paste exactly these lines in the snippets tool. You can bind it to a key as you may know, I bound it to Ctrl-E. So paste it in a new snippet (keep the original in a safe place), bind to a key, select the text you want to

socket.makefile raises ValueError when mode = 'rt'

2013-01-09 Thread Antoon Pardon
This is using python 3.2. I am writing somekind of wrapper around the ftplib. So that you can work with it as if you are working with local files. The idea is that you start with making a connection like rmt = FTP(...) and then do something like the following rmtfl = rmt.open(rmtfilename, rt)

Re: socket.makefile raises ValueError when mode = 'rt'

2013-01-09 Thread Dave Angel
On 01/09/2013 08:22 AM, Antoon Pardon wrote: This is using python 3.2. I am writing somekind of wrapper around the ftplib. So that you can work with it as if you are working with local files. The idea is that you start with making a connection like rmt = FTP(...) and then do something

Re: socket.makefile raises ValueError when mode = 'rt'

2013-01-09 Thread Antoon Pardon
Op 01/09/13 14:54, Dave Angel schreef: On 01/09/2013 08:22 AM, Antoon Pardon wrote: This is using python 3.2. ... But the documentation states: socket.makefile(mode='r', buffering=None, *, encoding=None, errors=None, newline=None) Return a file object associated with the socket. The

PIL or something to open EXIF Metadata with Python

2013-01-09 Thread Jose Trevino
I am trying to load the PIL module to manage exif metadata with Python but have had no success. I do some work relate with applescript, but for large files time increases exponentially. So I changed to Python with the intention of using PIL or something similar. I see that the last update of

Re: PIL or something to open EXIF Metadata with Python

2013-01-09 Thread Tim Golden
On 09/01/2013 14:45, Jose Trevino wrote: I am trying to load the PIL module to manage exif metadata with Python but have had no success. Try pyexiv2: http://tilloy.net/dev/pyexiv2/ TJG -- http://mail.python.org/mailman/listinfo/python-list

new to python and programming at large

2013-01-09 Thread kwakukwatiah
pls I want to write a function that can compute for the sqrt root of any number.bt it not working pls help. from math import sqrt def squareroot(self): x = sqrt(y) print x-- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyDTLS

2013-01-09 Thread Neal Becker
A bit OT, but the widespread use of rfc 6347 could have a big impact on my work. I wonder if it's likely to see widespread use? What are likely/possible use cases? Thank. -- http://mail.python.org/mailman/listinfo/python-list

new to python and programming at large

2013-01-09 Thread kwakukwatiah
pls I want to write a function that can compute for the sqrt root of any number.bt it not working pls help. from math import sqrt def squareroot(self): x = sqrt(y) print x-- http://mail.python.org/mailman/listinfo/python-list

Re: new to python and programming at large

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 8:03 AM, kwakukwat...@gmail.com wrote: pls I want to write a function that can compute for the sqrt root of any number.bt it not working pls help. from math import sqrt def squareroot(self): x = sqrt(y) print x The 'self' argument is a convention used in

Re: new to python and programming at large

2013-01-09 Thread Alister
On Thu, 10 Jan 2013 02:18:11 +1100, Chris Angelico wrote: On Thu, Jan 10, 2013 at 8:03 AM, kwakukwat...@gmail.com wrote: pls I want to write a function that can compute for the sqrt root of any number.bt it not working pls help. from math import sqrt def squareroot(self): x = sqrt(y)

Re: new to python and programming at large

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 2:38 AM, Alister alister.w...@ntlworld.com wrote: On Thu, 10 Jan 2013 02:18:11 +1100, Chris Angelico wrote: On Thu, Jan 10, 2013 at 8:03 AM, kwakukwat...@gmail.com wrote: pls I want to write a function that can compute for the sqrt root of any number.bt it not

Interpolating/crossfading a stack of matrices

2013-01-09 Thread raphael
Hi, I want to interpolate (with quadratic splines) a stack of 2D-arrays/matrices y1, y2, y3, ... in a third dimension (which I call x) e.g. for crossfading images. I already have a working code which unfortunately still contains two explicit loops over the rows and colums of the matrices.

Re: ANN: PyDTLS

2013-01-09 Thread Guido van Rossum
On Tue, Jan 8, 2013 at 11:38 PM, rbit p...@liquibits.com wrote: On Tue, Jan 8, 2013 at 9:09 PM, Guido van Rossum gu...@python.org wrote: But don't you have to deal with that when doing synchronous I/O as well? It's a datagram protocol after all. No: when dealing with blocking sockets, the

wiki.python.org

2013-01-09 Thread Reed, Kevin
Hello, I have been unable to access wiki.python.org for two days. Is there a problem with the server, or is it me? Thank you much, Kevin C. Reed New Python User -- http://mail.python.org/mailman/listinfo/python-list

Re: new to python and programming at large

2013-01-09 Thread Ulrich Eckhardt
Am 09.01.2013 22:05, schrieb kwakukwat...@gmail.com: pls I want to write a function that can compute for the sqrt root of any number.bt it not working pls help. Whenever describing an error, be precise. In this particular case, we have some sourcecode (which is good!) but what is still

RE: new to python and programming at large

2013-01-09 Thread Adrian Espinosa Moreno
Hello, you have to use the same parameter, not self which is used in classes def squareroot(n): return sqrt(n) -- Adrián Espinosa. Engineering Support, Wholesale Systems. Jazztel.com De: kwakukwat...@gmail.com [mailto:kwakukwat...@gmail.com] Enviado el: miércoles, 09 de enero de 2013

Re: wiki.python.org

2013-01-09 Thread Matty Sarro
Wiki.python.org was compromised a few days ago, almost everything was wiped per a previous email. Not sure what the recovery status is. On Wed, Jan 9, 2013 at 11:05 AM, Reed, Kevin kevin.re...@hp.com wrote: Hello, ** ** I have been unable to access wiki.python.org for two days. Is

Re: wiki.python.org

2013-01-09 Thread Ken
On Wed, Jan 09, 2013 at 04:05:31PM +, Reed, Kevin wrote: Hello, I have been unable to access wiki.python.org for two days. Is there a problem with the server, or is it me? Thank you much, Kevin C. Reed New Python User Well, I just tried it twice and could not get there, so I

Re: wiki.python.org

2013-01-09 Thread Ben Carleton
- Original Message - From: Kevin Reed kevin.re...@hp.com To: python-list@python.org Sent: Wednesday, January 9, 2013 11:05:31 AM Subject: wiki.python.org Hello, I have been unable to access wiki.python.org for two days. Is there a problem with the server, or is it me? Thank

Re: wiki.python.org

2013-01-09 Thread Benjamin Kaplan
On Wed, Jan 9, 2013 at 8:30 AM, Ken kensubu...@gmail.com wrote: On Wed, Jan 09, 2013 at 04:05:31PM +, Reed, Kevin wrote: Hello, I have been unable to access wiki.python.org for two days. Is there a problem with the server, or is it me? Thank you much, Kevin C. Reed New Python User

new to python and programming at large.

2013-01-09 Thread kwakukwatiah
thanks for ur help I wz able to do it.but I wish to expand it by asking a user to input a number for the sqrt to be calculated it I dd it this way but its not working. from math import sqrt number = raw_input('enter a number:') def number(y): return number(Y) thnx--

Re: wiki.python.org

2013-01-09 Thread Evan Driscoll
On 01/09/2013 10:05 AM, Reed, Kevin wrote: I have been unable to access wiki.python.org for two days. Is there a problem with the server, or is it me? I can't speak to why, but it appears down for me as well. I also checked http://www.downforeveryoneorjustme.com/ (which is just about the best

Previous Question Answered - Thank You All For Your Replies

2013-01-09 Thread Reed, Kevin
Hello, My question concerning wiki.python.org unavailability has been answered. Thank you all for your assistance! You guys are awesome! For those of you who don't know, here's the info. http://mail.python.org/pipermail/python-list/2013-January/638182.html Thanks again, Kevin --

Re: Previous Question Answered - Thank You All For Your Replies

2013-01-09 Thread Dave Angel
On 01/09/2013 12:11 PM, Reed, Kevin wrote: Hello, My question concerning wiki.python.org unavailability has been answered. Thank you all for your assistance! You guys are awesome! For those of you who don't know, here's the info.

Re: new to python and programming at large.

2013-01-09 Thread John Gordon
In mailman.328.1357750432.2939.python-l...@python.org kwakukwat...@gmail.com writes: thanks for ur help I wz able to do it.but I wish to expand it by asking a user to input a number for the sqrt to be calculated it I dd it this way but its not working. from math import sqrt number =

Re: new to python and programming at large.

2013-01-09 Thread Dave Angel
On 01/09/2013 05:28 PM, kwakukwat...@gmail.com wrote: thanks for ur help I wz able to do it.but I wish to expand it by asking a user to input a number for the sqrt to be calculated it I dd it this way but its not working. from math import sqrt number = raw_input('enter a number:') def

Re: How to modify this script?

2013-01-09 Thread chaouche yacine
Indeed, the console shows a traceback where data is misinterpreted, maybe due to my triple protective quotes around $GEDIT_SELECTED_TEXT. Try without them, like so (it worked for me) : $ def addline(line):     return tr\%s/tr\\n % line def addcolumn(item,nb_columns):     if nb_columns != 3:   

Re: ANN: PyDTLS

2013-01-09 Thread rbit
Neal, A network protocol that is unreliable (i.e., lacks retransmission of dropped packets) and lacks congestion control will certainly never be a common, general purpose protocol, due to the amount of work it imposes on its user. Implementing an AIMD congestion control algorithm is burdensome to

Class confusion

2013-01-09 Thread Rodrick Brown
How can I make a class that has methods with attributes and other functions? I see a lot of code I'm reading the documentation to Redhat's Satellite software which has a XMLRPC interface and wrote the following code to test the api. I would like to extend this code to support methods with

paralell ftp uploads and pool size

2013-01-09 Thread ben
Hello, I have a python script that uploads multiple files from the local machine to a remote server in parallel via ftp using p process pool: p = Pool(processes=x) Now as I increase the value of x, the overall upload time for all files drops as expected. If I set x too high however, then an

Re: new to python and programming at large.

2013-01-09 Thread kwakukwatiah
-Original Message- From: Dave Angel Sent: Wednesday, January 09, 2013 12:00 PM To: python-list@python.org Subject: Re: new to python and programming at large. On 01/09/2013 05:28 PM, kwakukwat...@gmail.com wrote: thanks for ur help I wz able to do it.but I wish to expand it by asking

Re: Class confusion

2013-01-09 Thread MRAB
On 2013-01-09 20:13, Rodrick Brown wrote: How can I make a class that has methods with attributes and other functions? I see a lot of code I'm reading the documentation to Redhat's Satellite software which has a XMLRPC interface and wrote the following code to test the api. I would like to

Re: Class confusion

2013-01-09 Thread Matt Jones
# Something like... class SystemList(object): def get_systemid(self): return System Id: bleh def get_running_kernel(self): return Kernel: bleh class SatelliteConnect(object): def get_systemlist(self): return SystemList() # Now the code you wrote would work, only

Re: ANN: PyDTLS

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 7:04 AM, rbit p...@liquibits.com wrote: The following are some of the main use cases that force applications into datagram protocols: * Minimizing protocol overhead. TCP has relatively high overhead, for example, its 3-way handshake for connection

Re: Class confusion

2013-01-09 Thread Rodrick Brown
On Wed, Jan 9, 2013 at 4:34 PM, Matt Jones matt.walker.jo...@gmail.comwrote: # Something like... class SystemList(object): def get_systemid(self): return System Id: bleh def get_running_kernel(self): return Kernel: bleh class SatelliteConnect(object): def

Why BOM in logging message?

2013-01-09 Thread Roy Smith
We've got 10 (supposedly) identical servers, all running Ubuntu 12.04, Python 2.7, Django 1.3. We log to syslog using the logging module and a custom fomatter. 'formatters': { 'verbose': { 'format': '%(asctime)s [%(process)d]: %(program)s %(session_id)s

Re: Interpolating/crossfading a stack of matrices

2013-01-09 Thread Oscar Benjamin
On 9 January 2013 16:02, raph...@mameghani.de wrote: Hi, I want to interpolate (with quadratic splines) a stack of 2D-arrays/matrices y1, y2, y3, ... in a third dimension (which I call x) e.g. for crossfading images. I already have a working code which unfortunately still contains two

Re: Why BOM in logging message?

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 9:54 AM, Roy Smith r...@panix.com wrote: What's weird is that two of the servers, and only those two, stick a BOM (Byte Order Mark) in front of the message they log. Could it be this issue you're looking at? http://bugs.python.org/issue14452 What are the exact Python

Re: Why BOM in logging message?

2013-01-09 Thread John Gordon
In kcksg2$bkp$1...@panix2.panix.com r...@panix.com (Roy Smith) writes: What's weird is that two of the servers, and only those two, stick a BOM (Byte Order Mark) in front of the message they log. It shows up in syslog as: 2013-01-09T00:00:00+00:00 web5.songza.com

Re: Best way to do this? List loop (matrix?) iteration

2013-01-09 Thread andydtaylor
Thanks for your help - this is what I did - though it's probably obvious to most people reading this. for rowcount in range (0, stn_count): row_durations.append(stn_list_short[rowcount]) for colcount in range (0, stn_count): # 3. Determine Station pairs for API query

Re: socket.makefile raises ValueError when mode = 'rt'

2013-01-09 Thread Terry Reedy
On 1/9/2013 9:14 AM, Antoon Pardon wrote: Op 01/09/13 14:54, Dave Angel schreef: On 01/09/2013 08:22 AM, Antoon Pardon wrote: This is using python 3.2. ... But the documentation states: socket.makefile(mode='r', buffering=None, *, encoding=None, errors=None, newline=None) Return a file

pylint or similar to test version-specific language constructs?

2013-01-09 Thread jkn
Hi all I have to write python code which must run on an old version of python (v2.4) as well as a newer (v2.7). I am using pylint and would like to check if is possible to check with pylint the use of operators etc. which are not present in 2.4; the ternary operator springs to mind. I haven't

Re: Best way to do this? List loop (matrix?) iteration

2013-01-09 Thread Dave Angel
On 01/09/2013 06:24 PM, andydtay...@gmail.com wrote: Thanks for your help - this is what I did - though it's probably obvious to most people reading this. for rowcount in range (0, stn_count): row_durations.append(stn_list_short[rowcount]) for colcount in range (0,

Psycopg2 SyntaxError: invalid syntax on INSERT INTO database

2013-01-09 Thread andydtaylor
Hi, I'm a bit stuck on this INSERT INTO syntax error. I have no idea why it's not working actually... I've tried changing column types to char but that didn't work. I've gone a bit blind looking at it, but hopefully you can set me right. With the '#'d out lines instead the file does work.

Re: How to implement mouse gesture by python or pyqt ?

2013-01-09 Thread Michael Torrie
On 01/08/2013 07:57 PM, iMath wrote: 在 2013年1月8日星期二UTC+8上午8时44分20秒,iMath写道: It would be better to give me some examples .thanks in advance ! P.S. which module or lib are needed ? what I wanna perhaps like this: when a right mouse button is pressed and we go down and right with a

Re: pylint or similar to test version-specific language constructs?

2013-01-09 Thread Gisle Vanem
jkn jkn...@nicorp.f9.co.uk wrote: I have to write python code which must run on an old version of python (v2.4) as well as a newer (v2.7). I am using pylint and would like to check if is possible to check with pylint the use of operators etc. which are not present in 2.4; the ternary

Re: Psycopg2 SyntaxError: invalid syntax on INSERT INTO database

2013-01-09 Thread John Gordon
In b1c7ea47-47b4-4784-8037-e0856fdaa...@googlegroups.com andydtay...@gmail.com writes: I'm a bit stuck on this INSERT INTO syntax error. I have no idea why it's What syntax error? It's always helpful if you can post the actual error message. not working actually... I've tried changing

Re: Psycopg2 SyntaxError: invalid syntax on INSERT INTO database

2013-01-09 Thread andydtaylor
Hi John, He're the code I would like to see work. The cursor_to is an oversight. I extracted this element from some other code in an attempt to isolate/resolve the problem myself, hence having a simplified table version. Which works actually, but unfortunately that's not educating me

Getting audio input and processing it?

2013-01-09 Thread Michael Curry
I've been working on a Morse Code translator, I've made it work so that you can input English and it will translate it to Morse and play the Audio. I now want to add a feature to the program that takes audio input, processes it and then outputs the English. Are there any specific APIs that I

Re: Class confusion

2013-01-09 Thread Rodrick Brown
Can anyone care to advise on the following? Based on the responses does this look sufficient? #!/opt/local/bin/python class SystemList(object): sysmap = { '1039' : 'nebula', '1040' : 'mercury'} def __init__(self, sysid): self.sysid = sysid def

Re: Psycopg2 SyntaxError: invalid syntax on INSERT INTO database

2013-01-09 Thread Mitya Sirenef
On Wed 09 Jan 2013 07:19:10 PM EST, andydtay...@gmail.com wrote: Hi John, He're the code I would like to see work. The cursor_to is an oversight. I extracted this element from some other code in an attempt to isolate/resolve the problem myself, hence having a simplified table version. Which

Re: Psycopg2 SyntaxError: invalid syntax on INSERT INTO database

2013-01-09 Thread MRAB
On 2013-01-10 00:19, andydtay...@gmail.com wrote: Hi John, He're the code I would like to see work. The cursor_to is an oversight. I extracted this element from some other code in an attempt to isolate/resolve the problem myself, hence having a simplified table version. Which works actually,

Re: Why BOM in logging message?

2013-01-09 Thread Roy Smith
In article kcktti$sbg$1...@reader1.panix.com, John Gordon gor...@panix.com wrote: In kcksg2$bkp$1...@panix2.panix.com r...@panix.com (Roy Smith) writes: What's weird is that two of the servers, and only those two, stick a BOM (Byte Order Mark) in front of the message they log. It shows

Re: Why BOM in logging message?

2013-01-09 Thread Roy Smith
In article mailman.344.1357772847.2939.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Thu, Jan 10, 2013 at 9:54 AM, Roy Smith r...@panix.com wrote: What's weird is that two of the servers, and only those two, stick a BOM (Byte Order Mark) in front of the message they log.

Re: How to get the selected text of the webpage in chrome through python ?

2013-01-09 Thread iMath
在 2013年1月9日星期三UTC+8下午5时35分15秒,Alister写道: On Mon, 07 Jan 2013 20:20:28 -0800, iMath wrote: How to get the selected text of the webpage in chrome through python ? i think you need to explain your requirement further also what do you want to do to the text once you have it?

Re: how to download internet files by python ?

2013-01-09 Thread iMath
在 2013年1月8日星期二UTC+8下午1时04分54秒,Roy Smith写道: In article mailman.259.1357620254.2939.python-l...@python.org, Cameron Simpson c...@zip.com.au wrote: On 07Jan2013 20:19, iMath redstone-c...@163.com wrote: | for example ,if I want to download this file ,how to implement the download

How to call wget by python ?

2013-01-09 Thread iMath
can you give me an example code ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Psycopg2 SyntaxError: invalid syntax on INSERT INTO database

2013-01-09 Thread andydtaylor
Thanks for your help guys. I was actually doing a few things wrong, but I have got this script to work by declaring fields as varchar and all values as strings. But I would like to log journey time values in hours/minutes, so I will have to look into the following: 1. Retrieving this data

Re: How to call wget by python ?

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 1:11 PM, iMath redstone-c...@163.com wrote: can you give me an example code ? -- http://mail.python.org/mailman/listinfo/python-list You've asked several very vague questions. I would strongly recommend that you read this:

Re: How to implement mouse gesture by python or pyqt ?

2013-01-09 Thread iMath
在 2013年1月10日星期四UTC+8上午8时06分13秒,Michael Torrie写道: On 01/08/2013 07:57 PM, iMath wrote: 在 2013年1月8日星期二UTC+8上午8时44分20秒,iMath写道: It would be better to give me some examples .thanks in advance ! P.S. which module or lib are needed ? what I wanna perhaps like this:

Re: Psycopg2 SyntaxError: invalid syntax on INSERT INTO database

2013-01-09 Thread Mitya Sirenef
On Wed 09 Jan 2013 09:20:10 PM EST, andydtay...@gmail.com wrote: Thanks for your help guys. I was actually doing a few things wrong, but I have got this script to work by declaring fields as varchar and all values as strings. But I would like to log journey time values in hours/minutes, so I

Re: new to python and programming at large.

2013-01-09 Thread Michael Torrie
On 01/09/2013 07:45 PM, kwakukwat...@gmail.com wrote: thanks so much it worked.I have tried and tried.look at what I was doing. me = raw_input(Enter a value:) from math import sqrt def squareroot(y): me = squareroot(y) return squareroot(y) Congratulations! You've just created a

Re: How to call wget by python ?

2013-01-09 Thread Michael Torrie
On 01/09/2013 07:11 PM, iMath wrote: can you give me an example code ? No but I can suggest some alternative ideas, such as using httplib (built into python), or libcurl. Or if you have to use wget, you run it the same way you run any external command from python. If it were my I'd plunk a

Re: Class confusion

2013-01-09 Thread Matt Jones
Does this look sufficient for what? You haven't actually told us what it is you're trying to accomplish. I gave you the how, you must supply the why. *Matt Jones* On Wed, Jan 9, 2013 at 6:43 PM, Rodrick Brown rodrick.br...@gmail.comwrote: Can anyone care to advise on the following? Based on

Re: How to call wget by python ?

2013-01-09 Thread 88888 Dihedral
Michael Torrie於 2013年1月10日星期四UTC+8上午11時04分31秒寫道: On 01/09/2013 07:11 PM, iMath wrote: can you give me an example code ? No but I can suggest some alternative ideas, such as using httplib (built into python), or libcurl. Or if you have to use wget, you run it the same way you

Re: How to call wget by python ?

2013-01-09 Thread Chris Angelico
On Thu, Jan 10, 2013 at 2:21 PM, 8 Dihedral dihedral88...@googlemail.com wrote: Inherantly the python interpreter has a GC builtin to use pacakages like DLL by reference counting. That almost makes sense. And it's almost profound, too. ChrisA --

Re: How to call wget by python ?

2013-01-09 Thread Steven D'Aprano
On Wed, 09 Jan 2013 18:11:34 -0800, iMath wrote: can you give me an example code ? Is the web broken where you are? If you google for python wget, you will find example of how to call wget as an external process, as well as examples of downloading files from the web like wget would do but

Re: how to download internet files by python ?

2013-01-09 Thread Tim Roberts
iMath redstone-c...@163.com wrote: There is also a httplib2 module https://code.google.com/p/httplib2/ which one is more pythonic and powerful ? Both are Pythonic, and power is irrelevant for this. Your code is going to spend 90% of its time waiting for the network. Just solve the problem.

Re: How to call wget by python ?

2013-01-09 Thread rurpy
On Wednesday, January 9, 2013 7:11:34 PM UTC-7, iMath wrote: can you give me an example code ? For running any system command from Python, you can use the subprocess module: http://docs.python.org/3/library/subprocess.html#module-subprocess To run wget -p -k http://python.org; from Python

subprocess.Popen and multiprocessing fails to execute external program

2013-01-09 Thread Niklas Berliner
I have a pipline that involves processing some data, handing the data to an external program (t_coffee used for sequence alignments in bioinformatics), and postprocessing the result. Since I have a lot of data, I need to run my pipeline in parallel which I implemented using the multiprocessing

Re: Getting audio input and processing it?

2013-01-09 Thread Dave Angel
On 01/09/2013 07:20 PM, Michael Curry wrote: I've been working on a Morse Code translator, I've made it work so that you can input English and it will translate it to Morse and play the Audio. I now want to add a feature to the program that takes audio input, processes it and then outputs

Re: subprocess.Popen and multiprocessing fails to execute external program

2013-01-09 Thread Dave Angel
On 01/09/2013 11:08 PM, Niklas Berliner wrote: I have a pipline that involves processing some data, handing the data to an external program (t_coffee used for sequence alignments in bioinformatics), and postprocessing the result. Since I have a lot of data, I need to run my pipeline in

How to run multiline shell command within python

2013-01-09 Thread Karim
Hello all, I want to run multiline shell command within python without using a command file but directly execute several lines of shell. I already use *subprocess.checkoutput(csh -f my_file.csh.split())* but I want to know if it is posssible to avoid making file and execute shell lines of

RIse and fall of languages in 2012

2013-01-09 Thread Steven D'Aprano
In general-purpose scripting languages, Python continues to grow slowly, JavaScript and Ruby are treading water, and Perl continues its long decline. According to Google trends, the number of searches for Perl is 19% of what it was in 2004. Its declining role in open-source communities further

[issue16853] add a Selector to the select module

2013-01-09 Thread Charles-François Natali
Charles-François Natali added the comment: Please consider my patches instead; it seems our patches crossed. Merging is now difficult because I already submitted my version to Tulip. That's fine, I don't think there's a point into maintaining a standalone patch for now: we can see how it

[issue16902] Add OSS module support for Solaris

2013-01-09 Thread brian-cameron-oracle
New submission from brian-cameron-oracle: Solaris supports OSS, but the attached patch is needed to get it to build. Note that some of the EXPORT_INT lines in Modules/ossaudiodev.c need to be #ifndef'ed out on Sun since OSS on Solaris doesn't support them all. Does it make sense to use

[issue16903] subprocess.Popen.communicate with universal_newlines=True doesn't accept strings on 3.2

2013-01-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: On 3.2 subprocess.Popen.communicate with universal_newlines=True accepts bytes and doesn't accept strings. $ ./python -c import subprocess; subprocess.Popen(['cat'], stdin=subprocess.PIPE, stdout=subprocess.PIPE,

[issue15649] subprocess.Popen.communicate: accept str for input parameter if universal_newlines is False

2013-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue16903. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15649 ___ ___

[issue16903] subprocess.Popen.communicate with universal_newlines=True doesn't accept strings on 3.2

2013-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As quick fix I propose add support of strings (in additional to bytes) in 3.2. Perhaps we must also add support of bytes with warning in 3.3. -- ___ Python tracker rep...@bugs.python.org

[issue12107] TCP listening sockets created without FD_CLOEXEC flag

2013-01-09 Thread Charles-François Natali
Charles-François Natali added the comment: I realize this bugreport cannot fix 35 years of a bad design decision in linux. Well... Ruby made a brave choice :-) Ruby (2.0?) does set close-on-exec flag on *ALL file descriptors (except 0, 1, 2) *by default*:

[issue16903] subprocess.Popen.communicate with universal_newlines=True doesn't accept strings on 3.2

2013-01-09 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +chris.jerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16903 ___ ___

[issue16904] Avoid unnecessary and possibly unsafe code from http.client.HTTPConnection.send

2013-01-09 Thread Attila Gerendi
New submission from Attila Gerendi: In http.client.HTTPConnection's send(data) method if data has attribute read after is handled correctly as file-like object and sent out successfully the code continues to what should be an else branch (~line 858) and tries to send out again the data. This

[issue16491] IDLE and except: raise from

2013-01-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset f28aff31900a by Serhiy Storchaka in branch '3.2': Issue #16491: IDLE now prints chained exception tracebacks. http://hg.python.org/cpython/rev/f28aff31900a New changeset 3feead75c7a5 by Serhiy Storchaka in branch '3.3': Issue #16491: IDLE now

[issue16491] IDLE and except: raise from

2013-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed. Thank you for report, Hans. -- components: +IDLE resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue16905] Fix test discovery for test_warnings

2013-01-09 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- components: Tests files: test_warnings_discovery.diff keywords: patch nosy: berker.peksag, brett.cannon, ezio.melotti, zach.ware priority: normal severity: normal status: open title: Fix test discovery for test_warnings type: behavior

[issue16906] Bug in _PyUnicode_ClearStaticStrings() method of unicodeobject.c

2013-01-09 Thread Prashant Kurnawal
New submission from Prashant Kurnawal: I have embedded python3.3 in my application. I got a crash when I ran a python script containing sample TK window creation code in it. On interpreter shutdown, all strings are released (through _PyUnicode_ClearStaticStrings). (I Found this description

  1   2   3   >