Re: How to add ftp put function in PyQT network ftp demo

2014-07-02 Thread 不坏阿峰
在 2014年7月1日星期二UTC+7下午5时27分59秒,不坏阿峰写道: > I want to modify the pyqt network ftp demo to include an upload function, but > I am failing. Could someone can show me how to do this? I have tried to add > this code, but it does not work. > > [Orignal > demo]https://github.com/Werkov/PyQt4/blob/master

Re: Get named groups from a regular expression

2014-07-02 Thread Devin Jeanpierre
On Tue, Jul 1, 2014 at 8:58 AM, Chris Angelico wrote: > On Wed, Jul 2, 2014 at 1:29 AM, Peter Otten <__pete...@web.de> wrote: >> Easy, just write a regular expression to parse regular expressions ;) > > Hmm, is that even possible? AIUI you can't make a regex that correctly > parses nested tokens,

Statically type-checked variant of Python

2014-07-02 Thread musicdenotation
PHP has Hack, JavaScript has TypeScript, Python has what? -- https://mail.python.org/mailman/listinfo/python-list

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Terry Reedy
On 7/2/2014 12:33 AM, Tim Roberts wrote: Terry Reedy wrote: It does not work on Windows. As I reported on http://bugs.python.org/issue8631, msg222053, subprocess.check_output("pyflakes -h") works in the interpreter and Idle shell, while s.check_output("pyflakes c:\programs\python34\lib\turt

Re: fixing an horrific formatted csv file.

2014-07-02 Thread flebber
> >>> TM = TX.Table_Maker (headings = > ('Meeting','Date','Race','Number','Name','Trainer','Location')) > >>> TM (race_table (your_csv_text)).write () Where do I find TX? Found this mention in the list, was it available in pip by any name? https://mail.python.org/pipermail/python-list/2014-Feb

Re: Searching for lots of similar strings (filenames) in sqlite3 database

2014-07-02 Thread Adam Funk
On 2014-07-01, Chris Angelico wrote: > On Wed, Jul 2, 2014 at 1:15 AM, Adam Funk wrote: >> On 2014-07-01, Chris Angelico wrote: >> >>> On Tue, Jul 1, 2014 at 9:26 PM, Adam Funk wrote: cursor.execute('SELECT filename FROM files WHERE filename IS ?', (filename,)) >>> >>> Shouldn

How can I catch values from other def by flask???

2014-07-02 Thread fk26541598fk
this is my code def aa(): if request.method=='POST': get_test(value1) return value1 else: get_test(value2) return value2 return 'it does not work' def post_test(value1): value1='POST it works' return value1 def get_test(value2): value2='GET

Re: Searching for lots of similar strings (filenames) in sqlite3 database

2014-07-02 Thread Adam Funk
On 2014-07-01, Chris Angelico wrote: > On Wed, Jul 2, 2014 at 1:15 AM, Adam Funk wrote: >> On 2014-07-01, Chris Angelico wrote: >>> There is one critical consideration, though. What happens if the >>> directory name contains an underscore or percent sign? Or can you >>> absolutely guarantee that

Re: Searching for lots of similar strings (filenames) in sqlite3 database

2014-07-02 Thread Chris Angelico
On Wed, Jul 2, 2014 at 7:32 PM, Adam Funk wrote: > Well, I've changed it to the following anyway. > > subdir_glob = subdir + '/*' > cursor.execute('SELECT filename FROM files WHERE filename GLOB ?', >(subdir_glob,)) > rows = cursor.fetchall() >

Re: Statically type-checked variant of Python

2014-07-02 Thread Steven D'Aprano
On Wed, 02 Jul 2014 15:26:07 +0700, musicdenotation wrote: > PHP has Hack, JavaScript has TypeScript, Python has what? I don't know if this counts, but there's Cobra: http://cobra-language.com/ http://cobra-language.com/docs/python/ Cobra has a lot more than just (optional) static typing. Some

Re: How can I catch values from other def by flask???

2014-07-02 Thread Steven D'Aprano
On Wed, 02 Jul 2014 02:43:28 -0700, fk26541598fk wrote: > this is my code Change the code as shown below: > def aa(): > if request.method=='POST': > get_test(value1) > return value1 def aa(): if request.method=='POST': value1 = post_test() return value1

Re: Searching for lots of similar strings (filenames) in sqlite3 database

2014-07-02 Thread Adam Funk
On 2014-07-02, Chris Angelico wrote: > On Wed, Jul 2, 2014 at 7:32 PM, Adam Funk wrote: >> Well, I've changed it to the following anyway. >> >> subdir_glob = subdir + '/*' >> cursor.execute('SELECT filename FROM files WHERE filename GLOB ?', >>(subdir_glob,

NEW JOB req: Python developer with Analytical risk

2014-07-02 Thread Suman Bharathi Balasubramanian
Python Developers with Analytical Risk Exp- NYC, Long Island, Wilmington, Columbus, Dallas 6 months plus * Implement statistical, economic, econometric or other mathematical models/code for Client's bank models in Python * Ability to translate existing Excel / SAS Model implementations into req

Re: 1-0.95

2014-07-02 Thread Steven D'Aprano
On Tue, 01 Jul 2014 14:17:14 -0700, Pedro Izecksohn wrote: > pedro@microboard:~$ /usr/bin/python3 > Python 3.3.2+ (default, Feb 28 2014, 00:52:16) [GCC 4.8.1] on linux > Type "help", "copyright", "credits" or "license" for more information. 1-0.95 > 0.050044     >   How to

Re: fixing an horrific formatted csv file.

2014-07-02 Thread F.R.
On 07/02/2014 11:13 AM, flebber wrote: TM = TX.Table_Maker (headings = ('Meeting','Date','Race','Number','Name','Trainer','Location')) TM (race_table (your_csv_text)).write () Where do I find TX? Found this mention in the list, was it available in pip by any name? https://mail.python.org/pipe

Re: 1-0.95

2014-07-02 Thread Marko Rauhamaa
Steven D'Aprano : > This is a problem with the underlying C double floating point format. > Actually, it is not even a problem with the C format, since this > problem applies to ANY floating point format, consequently this sort > of thing plagues *every* programming language (unless they use > arb

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Wolfgang Maier
On 02.07.2014 11:05, Terry Reedy wrote: On 7/2/2014 12:33 AM, Tim Roberts wrote: Terry Reedy wrote: You need to use s.check_output("pyflakes c:\\programs\\python34\\lib\\turtle.py") or s.check_output(r"pyflakes c:\programs\python34\lib\turtle.py") Now I get "Command 'pyflakes c:\pr

Re: 1-0.95

2014-07-02 Thread Skip Montanaro
On Wed, Jul 2, 2014 at 11:59 AM, Marko Rauhamaa wrote: > Yes, I'm making it up, but it's still true. I don't think there's any reason to be hypothetical: In [149]: d Out[149]: Decimal('2') In [150]: d.sqrt() * d.sqrt() == d Out[150]: False :-) Skip -- https://mail.python.org/mailman/listinfo

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Wolfgang Maier
On 02.07.2014 19:31, Wolfgang Maier wrote: I am not 100% sure whether that is the problem, but from what I gather from the subprocess module docs the args string is passed to the Windows CreateProcess function as a single string. To me this seems to imply that it is passed as the lpCommandLine p

Re: NEW JOB req: Python developer with Analytical risk

2014-07-02 Thread Mark Lawrence
On 02/07/2014 14:44, Suman Bharathi Balasubramanian wrote: Please post your jobs here https://www.python.org/community/jobs/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware

Re: 1-0.95

2014-07-02 Thread Steven D'Aprano
On Wed, 02 Jul 2014 19:59:25 +0300, Marko Rauhamaa wrote: > Steven D'Aprano : > >> This is a problem with the underlying C double floating point format. >> Actually, it is not even a problem with the C format, since this >> problem applies to ANY floating point format, consequently this sort of >

Re: general module auditing

2014-07-02 Thread Irmen de Jong
On 2-7-2014 4:04, Rita wrote: > yes, this helps. But I want to know who uses the module, serpent. So, when > I upgrade it or remove it they won't be affected adversely. (Please don't top-post, it makes the discussion harder to follow.) > On Tue, Jul 1, 2014 at 2:16 PM, Irmen de Jong > wrote: >

OOP with MyTime

2014-07-02 Thread kjakupak
I'm trying to write a boolean function that takes two Mytime objects, t1 and t2 as arguments, and returns True if the object falls inbetween the two times. This is a question from the How to Think Like a Computer Scientist book, and I need help. What I've gotten so far: class MyTime: def _

Re: OOP with MyTime

2014-07-02 Thread Akira Li
kjaku...@gmail.com writes: > I'm trying to write a boolean function that takes two Mytime objects, t1 and > t2 as arguments, and returns True if the object falls inbetween the two times. > > This is a question from the How to Think Like a Computer Scientist book, and > I need help. > > What I've

Re: OOP with MyTime

2014-07-02 Thread MRAB
On 2014-07-02 20:20, kjaku...@gmail.com wrote: I'm trying to write a boolean function that takes two Mytime objects, t1 and t2 as arguments, and returns True if the object falls inbetween the two times. This is a question from the How to Think Like a Computer Scientist book, and I need help.

Re: 1-0.95

2014-07-02 Thread Marko Rauhamaa
Steven D'Aprano : >>>>> Rational(2).sqrt() * Rational(2).sqrt() == Rational(2) >>False > > Square root of 2 is not a rational number. Nobody said it was. It's just that even "arbitrary-precision" rational numbers wouldn't free you from the issues of floating-point numbers. The Decimal num

FW: install software via Python script

2014-07-02 Thread Moshe Avraham
HI Guys, I need to install variety of software (Oracle, SqlServer, upgrade JAVA version, WAS, WMB, Tomcat, etc.) on both WINDOWS and UNIX/LINUX. These are usual daily operation of large IT departments. So instead of developing both shell & DOS scripts, I like to develop a single Python script

Re: FW: install software via Python script

2014-07-02 Thread Grant Edwards
On 2014-07-02, Moshe Avraham wrote: > I need to install variety of software (Oracle, SqlServer, upgrade > JAVA version, WAS, WMB, Tomcat, etc.) on both WINDOWS and UNIX/LINUX. > > These are usual daily operation of large IT departments. > > So instead of developing both shell & DOS scripts, I lik

Re: install software via Python script

2014-07-02 Thread Paul Sokolovsky
Hello, On Wed, 2 Jul 2014 18:01:45 -0400 "Moshe Avraham" wrote: > HI Guys, > > I need to install variety of software (Oracle, SqlServer, upgrade JAVA > version, WAS, WMB, Tomcat, etc.) on both WINDOWS and UNIX/LINUX. > > These are usual daily operation of large IT departments. > > So instead

how can i get the source code of goagent.exe?

2014-07-02 Thread 水静流深
There is a open source project-goagent,when you download it and extract it, code.google.com/p/goagent/downloads‍ in the local diretory, a file named goagent.exe in it. how can i get the source code of goagent.exe ,not the binary form ,the text form.-- https://mail.python.org/mailman/listinfo/p

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Terry Reedy
On 7/2/2014 1:37 PM, Wolfgang Maier wrote: On 02.07.2014 19:31, Wolfgang Maier wrote: I am not 100% sure whether that is the problem, but from what I gather from the subprocess module docs the args string is passed to the Windows CreateProcess function as a single string. To me this seems to im

Re: how can i get the source code of goagent.exe?

2014-07-02 Thread Terry Reedy
On 7/2/2014 6:40 PM, 水静流深 wrote: There is a open source project-goagent,when you download it and extract it, code.google.com/p/*goagent*/downloads‍ in the local diretory, a file named goagent.exe in it. how can i get the source code of goagent.exe ,not the binary form ,the text form. This a

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Wolfgang Maier
Terry Reedy udel.edu> writes: > > On 7/2/2014 12:33 AM, Tim Roberts wrote: > > Terry Reedy udel.edu> wrote: > >> > > You need to use > > s.check_output("pyflakes c:\\programs\\python34\\lib\\turtle.py") > > or > > s.check_output(r"pyflakes c:\programs\python34\lib\turtle.py") > > Now

RE: install software via Python script

2014-07-02 Thread Moshe Avraham
HI Guys, I need to install variety of software (Oracle, SqlServer, upgrade JAVA version, WAS, WMB, Tomcat, etc.) on both WINDOWS and UNIX/LINUX. These are usual daily operation of large IT departments. So instead of developing both shell & DOS scripts, I like to develop a single Python script

Re: 1-0.95

2014-07-02 Thread Chris Angelico
On Thu, Jul 3, 2014 at 6:00 AM, Marko Rauhamaa wrote: > Steven D'Aprano : > >>>>>> Rational(2).sqrt() * Rational(2).sqrt() == Rational(2) >>>False >> >> Square root of 2 is not a rational number. > > Nobody said it was. It's just that even "arbitrary-precision" rational > numbers wouldn't

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Ethan Furman
On 07/02/2014 04:22 PM, Wolfgang Maier wrote: So, everything's just fine except that it may be more convenient to use Popen().communicate() to avoid raising the error in the first place :) Nice sleuthing! :) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Conrad Taylor
Hi, shouldn't pip be automatically installed for Python 3.4.0 release? I have read through the release and the PEP 453. Thus, can someone confirm whether or not this is the case? BTW, I have installed Python 3.4.0 using MacPorts. -- Think different and code well, -Conrad -- https://mail.p

Re: general module auditing

2014-07-02 Thread Rita
On Wed, Jul 2, 2014 at 2:46 PM, Irmen de Jong wrote: > On 2-7-2014 4:04, Rita wrote: > > yes, this helps. But I want to know who uses the module, serpent. So, > when > > I upgrade it or remove it they won't be affected adversely. > > > (Please don't top-post, it makes the discussion harder to fol

Re: Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Frank Liou
it's truth pip will be automatically install Python3.4.0 if you want to use another version you should use wget -- https://mail.python.org/mailman/listinfo/python-list

Re: How can I catch values from other def by flask???

2014-07-02 Thread Frank Liou
Steven Thank you!!! it's work i'm so appreciate that hava a nice day^^ -- https://mail.python.org/mailman/listinfo/python-list

Re: 1-0.95

2014-07-02 Thread Steven D'Aprano
On Wed, 02 Jul 2014 23:00:15 +0300, Marko Rauhamaa wrote: > Steven D'Aprano : > >>>>>> Rational(2).sqrt() * Rational(2).sqrt() == Rational(2) >>>False >> >> Square root of 2 is not a rational number. > > Nobody said it was. Your comment can be read as implying it. You stated: [quo

Re: how can i get the source code of goagent.exe?

2014-07-02 Thread liuerfire Wang
Hi 水静流深 the source code is on https://github.com/goagent/goagent Hi Terry, GoAgent, a tool to help cross the GFW, is written by Python not Go. So this may be not off-topic. :P On Thu, Jul 3, 2014 at 6:40 AM, 水静流深 <1248283...@qq.com> wrote: > There is a open source project-goagent,when you downl

TypeError expected in an augmented assignment

2014-07-02 Thread candide
An hybrid list-tuple concatenation is not allowed >>> []+(1, 2) Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate l

Re: Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Conrad Taylor
On Wednesday, July 2, 2014 6:29:53 PM UTC-7, Frank Liou wrote: > it's truth > > > > pip will be automatically install Python3.4.0 > > > > if you want to use another version > > > > you should use wget This doesn't appear to be the case when installing via MacPorts. -- https://mail.pyth

Re: TypeError expected in an augmented assignment

2014-07-02 Thread Terry Reedy
On 7/2/2014 10:39 PM, candide wrote: An hybrid list-tuple concatenation is not allowed []+(1, 2) Traceback (most recent call last): File "", line 1, in TypeError: can only concatenate list (not "tuple") to list hence I was expecting (*) that the following code raises a TypeError :

Re: Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Terry Reedy
On 7/2/2014 9:12 PM, Conrad Taylor wrote: Hi, shouldn't pip be automatically installed for Python 3.4.0 release? I have read through the release and the PEP 453. Thus, can someone confirm whether or not this is the case? BTW, I have installed Python 3.4.0 using MacPorts. by windows install

Re: Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Zachary Ware
On Wed, Jul 2, 2014 at 9:52 PM, Conrad Taylor wrote: > This doesn't appear to be the case when installing via MacPorts. You may need to run `python3.4 -m ensurepip`. Add '--help' to learn about the available options. -- Zach -- https://mail.python.org/mailman/listinfo/python-list

Re: Success with subprocess communicate on Windows?

2014-07-02 Thread Terry Reedy
On 7/2/2014 7:22 PM, Wolfgang Maier wrote: Finally found out what the problem is: When I'm running your command using the cmd console, I get this output: c:\python34\lib\turtle.py:571: local variable 'rgb' is assigned to but never used c:\python34\lib\turtle.py:2936: local variable 'a21' is ass

Re: 1-0.95

2014-07-02 Thread Rustom Mody
On Thursday, July 3, 2014 7:49:30 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 02 Jul 2014 23:00:15 +0300, Marko Rauhamaa wrote: > > On the other hand, floating-point numbers are perfect whenever you deal > > with science and measurement. > /head-desk Just as there are even some esteemed mem

Image Upload with FalconFramework

2014-07-02 Thread Peter Romfeld
Hi, I am stuck at a simple image upload function, in django i just used: for feature phones: file = request.body iOS with Form: class ImageForm(forms.Form): image = forms.FileField() form = ImageForm(request.POST, request.FILES) file = request.FILES['image'].read() with falcon i tried but

Re: Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Ned Deily
In article , Conrad Taylor wrote: > Hi, shouldn't pip be automatically installed for Python 3.4.0 release? I > have read through the release and the PEP 453. Thus, can someone confirm > whether or not this is the case? BTW, I have installed Python 3.4.0 using > MacPorts. Like many other th

Re: 1-0.95

2014-07-02 Thread Gregory Ewing
Rustom Mody wrote: Just as there are even some esteemed members of this list who think that c - a is a meaningful operation where c is speed of light a is speed of an automobile Indeed, it should be (c - a) / (1 - (c*a)/c**2). Although loss of precision might give you the right answer

Re: 1-0.95

2014-07-02 Thread Rustom Mody
On Thursday, July 3, 2014 10:25:17 AM UTC+5:30, Gregory Ewing wrote: > Rustom Mody wrote: > > Just as there are even some esteemed members of this list who think > > that c - a is a meaningful operation > > where > > c is speed of light > > a is speed of an automobile > Indeed, it should

Re: 1-0.95

2014-07-02 Thread Ian Kelly
On Wed, Jul 2, 2014 at 10:55 PM, Gregory Ewing wrote: > Although loss of precision might give you the > right answer anyway. :-) There aren't that many digits in the speed of light. Unless we're talking about a very, very slow-moving automobile. -- https://mail.python.org/mailman/listinfo/pytho

Re: how can i get the source code of goagent.exe?

2014-07-02 Thread Shiyao Ma
Ask on the goagent googlecode? exe is fow win, dig out more on the linux version. I bet it should be delivered with py source in that version. Regards. 2014-07-03 10:20 GMT+08:00 liuerfire Wang : > Hi 水静流深 > the source code is on https://github.com/goagent/goagent > > Hi Terry, > GoAgent, a to

Re: 1-0.95

2014-07-02 Thread Marko Rauhamaa
Steven D'Aprano : > On Wed, 02 Jul 2014 23:00:15 +0300, Marko Rauhamaa wrote: >> Steven D'Aprano : >>> Rational(2).sqrt() * Rational(2).sqrt() == Rational(2) False >>> Square root of 2 is not a rational number. >> Nobody said it was. > > Your comment can be read as implying it. Yo

Re: general module auditing

2014-07-02 Thread Mark Lawrence
On 03/07/2014 02:17, Rita wrote: On Wed, Jul 2, 2014 at 2:46 PM, Irmen de Jong mailto:irmen.nos...@xs4all.nl>> wrote: On 2-7-2014 4:04, Rita wrote: > yes, this helps. But I want to know who uses the module, serpent. So, when > I upgrade it or remove it they won't be affected a