Re: What does "pip install" do?

2015-01-13 Thread Chris Angelico
On Tue, Jan 13, 2015 at 6:51 PM, Fabien wrote: > Thanks Chris. I should then rephrase my question to "what does python > setup.pt do?" ;-). My point was also that I think that this information > (mostly: what will change on my system or my virtual env when I install a > python package?) could/shou

Re: I must be missing something obvious in installing Python 3.4.2...

2015-01-13 Thread Tim Golden
On 13/01/2015 07:05, cjgoh...@gmail.com wrote: > On Monday, January 12, 2015 at 10:09:03 PM UTC-8, Tim Golden wrote: >> On 12/01/2015 23:12, Andrew Koenig wrote: >>> Fixed it! >>> >>> The aforementioned article is correct. I downloaded the RegDelNull >>> program mentioned in the article >>> (http:/

Re: Using a ChangeLog as a canonical source of package metadata

2015-01-13 Thread Steven D'Aprano
On Tue, 13 Jan 2015 00:09:04 -0800, wxjmfauth wrote: > Le mardi 13 janvier 2015 08:00:06 UTC+1, Steven D'Aprano a écrit : >> On Mon, 12 Jan 2015 05:24:00 -0800, wxjmfauth wrote: >> >> > To tell you the truth, I'm unable to >> > put your product to work. >> >> >> If you follow the instructions i

Re: class-based class decorator

2015-01-13 Thread Albert-Jan Roskam
- Original Message - > From: Jean-Michel Pichavant > To: Albert-Jan Roskam > Cc: Python > Sent: Monday, January 12, 2015 4:20 PM > Subject: Re: class-based class decorator > > - Original Message - >> From: "Albert-Jan Roskam" > >> import functools >> import inspect >>

How can i use a dictionnary

2015-01-13 Thread brice DORA
i consume a web service that return a element whose the type is "instance". but this element seem be a dictionary but when i want to use it like a dictionary, i got some errors. so this is the element and please someone can tell me how can i use it. tkanks in advance. (tCountryInfo){ sISOCo

Python 2.7, on windows7 64 bit development machine, inconsistent issue on similar machines

2015-01-13 Thread Jacob Kruger
Trying to run through all steps in data conversion app, and, up to last point, it's fine, but, if I try to handle direct execution of data structure, and data insertion scripts against a mySQL database, hosted locally here on same machine, running under wamp, then after code has completely finis

Re: class-based class decorator

2015-01-13 Thread Albert-Jan Roskam
On Tue, Jan 13, 2015 6:31 AM CET Ian Kelly wrote: >On Jan 12, 2015 6:47 AM, "Albert-Jan Roskam" wrote: >> Thanks for your replies. I changed it into a regular decorator (not a class >> decorator). It would have been even nicer if I only needed to specify it >> once

Re: Broken IF statement

2015-01-13 Thread Maxime S
2015-01-12 22:19 GMT+01:00 : > > https://bpaste.net/show/93be9e15634b <--- Line 19 through 22 > > At all times, my program is assigning the object priority of 0, even if one already exists in the database with a priority of 0 (it's supposed to be assigning it a priority of 1 in those cases). > > I'

Re: Comparisons and sorting of a numeric class....

2015-01-13 Thread Terry Reedy
On 1/13/2015 1:13 AM, Chris Angelico wrote: On Tue, Jan 13, 2015 at 4:32 PM, Steven D'Aprano wrote: Crashing the interpreter from pure Python code is *absolutely not allowed*, so anything which would allow that is forbidden. Except when you willingly shoot yourself in the foot. rosuav@sikors

Re: Comparisons and sorting of a numeric class....

2015-01-13 Thread Chris Angelico
On Tue, Jan 13, 2015 at 9:49 PM, Terry Reedy wrote: > I would have expected an out-of-memory error. If there is not already a > crash issue on the tracker for this, you could add one. It's a stack fault, and it's a documented possibility: https://docs.python.org/2/library/sys.html#sys.setrecurs

Re: Comparisons and sorting of a numeric class....

2015-01-13 Thread Marko Rauhamaa
Terry Reedy : > On 1/13/2015 1:13 AM, Chris Angelico wrote: > def f(): sys.setrecursionlimit(sys.getrecursionlimit()+1) or f() >> ... > f() >> Segmentation fault >> >> But otherwise, yes. You shouldn't be able to segfault Python with >> Python code. > > I would have expected an out-of-memo

Re: Comparisons and sorting of a numeric class....

2015-01-13 Thread Chris Angelico
On Tue, Jan 13, 2015 at 10:00 PM, Marko Rauhamaa wrote: > Terry Reedy : > >> On 1/13/2015 1:13 AM, Chris Angelico wrote: >> def f(): sys.setrecursionlimit(sys.getrecursionlimit()+1) or f() >>> ... >> f() >>> Segmentation fault >>> >>> But otherwise, yes. You shouldn't be able to segfault P

Re: Python 3 regex woes (parsing ISC DHCPD config)

2015-01-13 Thread Thomas 'PointedEars' Lahn
Jason Bailey wrote: > My script first reads the DHCPD configuration file into memory - > variable "filebody". It then utilizes the re module to find the > configuration details for the wanted "shared network". > > The config file might look something like this: > > ##

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-13 Thread stephen . boulet
I found a solution that I'm happy with. from datetime import datetime from easygui_qt import * datestring = get_date() mydate = datetime.strptime(datestring, '%b %d %Y') On Saturday, January 10, 2015 at 1:02:30 AM UTC, André Roberge wrote: > On Friday, 9 January 2015 19:09:15 UTC-4, stephen...@g

Help understanding list operatoins inside functions in python 3

2015-01-13 Thread stephen . boulet
I'm a bit confused why in the second case x is not [1,2,3]: x = [] def y(): x.append(1) def z(): x = [1,2,3] y() print(x) z() print(x) Output: [1] [1] -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 regex?

2015-01-13 Thread alister
On Tue, 13 Jan 2015 04:36:38 +, Steven D'Aprano wrote: > On Mon, 12 Jan 2015 19:48:18 +, Ian wrote: > >> My recommendation would be to write a recursive decent parser for your >> files. >> >> That way will be easier to write, > > I know that writing parsers is a solved problem in comput

Re: Help understanding list operatoins inside functions in python 3

2015-01-13 Thread Joel Goldstick
On Tue, Jan 13, 2015 at 7:51 AM, wrote: > I'm a bit confused why in the second case x is not [1,2,3]: > > x = [] > > def y(): > x.append(1) > > def z(): > x = [1,2,3] > > y() > print(x) > z() > print(x) > > Output: > [1] > [1] > x in the outer scope is not x in the z() scope > -- > http

Re: Help understanding list operatoins inside functions in python 3

2015-01-13 Thread Laurent Pointal
Hello, stephen.bou...@gmail.com wrote: > I'm a bit confused why in the second case x is not [1,2,3]: > > x = [] > > def y(): > x.append(1) > > def z(): > x = [1,2,3] Here x is a local, so global x is not modified. If you want to modify gobal x, write: def z(): global x x = [1,

Re: Python 3 regex?

2015-01-13 Thread Jussi Piitulainen
alister writes: > On Tue, 13 Jan 2015 04:36:38 +, Steven D'Aprano wrote: > > > On Mon, 12 Jan 2015 19:48:18 +, Ian wrote: > > > >> My recommendation would be to write a recursive decent parser for > >> your files. > >> > >> That way will be easier to write, > > > > I know that writing

Re: Help understanding list operatoins inside functions in python 3

2015-01-13 Thread mortoxa
On 01/13/15 23:51, stephen.bou...@gmail.com wrote: I'm a bit confused why in the second case x is not [1,2,3]: x = [] def y(): x.append(1) def z(): x = [1,2,3] y() print(x) z() print(x) Output: [1] [1] In your y() function, as you are appending data, the list must already exist

what would be the regular expression for null byte present in a string

2015-01-13 Thread Shambhu Rajak
I have a string that I get as an output of a command as: '\x01\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x0010232ae8944a\x02\x00\x00\x00\x00\x00\x00\x00\n' I want to fetch '10232ae8944a' from the above string. I want to find a re pattern that could replace all the \x01..\x0z to be replace by empty

Re: Broken IF statement

2015-01-13 Thread joboppsgpp
On Monday, January 12, 2015 at 4:55:43 PM UTC-5, jobop...@gmail.com wrote: > Thanks Chris. This definitely helps. I will test it and see what happens. In > terms of the previous code, what it was intended to do wasn't actually > happening. Thanks Chris. Your change worked. -- https://mail.pytho

Re: Broken IF statement

2015-01-13 Thread joboppsgpp
On Tuesday, January 13, 2015 at 4:57:50 AM UTC-5, Maxime S wrote: > 2015-01-12 22:19 GMT+01:00 : > > > > https://bpaste.net/show/93be9e15634b <--- Line 19 through 22 > > > > At all times, my program is assigning the object priority of 0, even if one > > already exists in the database with a priori

Re: what would be the regular expression for null byte present in a string

2015-01-13 Thread Peter Otten
Shambhu Rajak wrote: > I have a string that I get as an output of a command as: > '\x01\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x0010232ae8944a\x02\x00\x00\x00\x00\x00\x00\x00\n' > > I want to fetch '10232ae8944a' from the above string. > > I want to find a re pattern that could replace all the

Re: How can i use a dictionnary

2015-01-13 Thread Novocastrian_Nomad
On Tuesday, January 13, 2015 at 2:03:30 AM UTC-7, brice DORA wrote: > i consume a web service that return a element whose the type is "instance". > but this element seem be a dictionary but when i want to use it like a > dictionary, i got some errors. so this is the element and please someone can

Re: How can i use a dictionnary

2015-01-13 Thread random832
On Tue, Jan 13, 2015, at 04:03, brice DORA wrote: > i consume a web service that return a element whose the type is > "instance". but this element seem be a dictionary but when i want to use > it like a dictionary, i got some errors. so this is the element and > please someone can tell me how can i

Re: Python 3 regex?

2015-01-13 Thread Rick Johnson
On Monday, January 12, 2015 at 11:34:57 PM UTC-6, Mark Lawrence wrote: > You snipped the bit that says [normal cobblers snipped]. Oh my, where are my *manners* today? Tell you what, next time when your sneaking up behind me with a knife in hand, do be a friend and tap me on the shoulder first, so

ANN: Python Meeting Düsseldorf - 20.01.2014

2015-01-13 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] ANKÜNDIGUNG Python Meeting Düsseldorf http://pyddf.de/ Ein Treffen v

Re: Python 3 regex woes (parsing ISC DHCPD config)

2015-01-13 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > Jason Bailey wrote: >> shared-network My-Network-MOHE { >>[…] { >> >> I compile my regex: >> m = re.compile(r"^(shared\-network (" + re.escape(shared_network) + r") >> \{((\n|.|\r\n)*?)(^\}))", re.MULTILINE|re.UNICODE) > > This code does not run as posted.

how can I create a class and decode/encode as json?

2015-01-13 Thread robertchen117
I want to send Message to rabbitmq and receive from rabbitmq, message format is below. how can I create a class and decode/encode as json? { "message":{ "dateCreated": "1417713299", "sourceApplication": "ID", "destinationApplication": "Name", "messageUUID": "sdafda

Re: class-based class decorator

2015-01-13 Thread Jean-Michel Pichavant
- Original Message - > From: "Albert-Jan Roskam" > > From: Jean-Michel Pichavant > > I don't really understand how you successfuly manage positional > > parameters, > > since the caller may not name them. > > I'm asking because if your intend to check only the keyword > > parameters, > >

Performance in exec environnements

2015-01-13 Thread Jean-Baptiste Braun
Hi, I'm working on auto-generated python code with the exec function. I've done some performance benches : % python -m timeit '1 + 1' 1000 loops, best of 3: 0.0229 usec per loop % python -m timeit "exec('1 + 1')" 10 loops, best of 3: 11.6 usec per loop -> Maybe creating an exec environn

Re: Track down SIGABRT

2015-01-13 Thread Israel Brewster
On Jan 12, 2015, at 5:51 PM, Jason Friedman wrote: >> I have a long-running python/CherryPy Web App server process that I am >> running on Mac OS X 10.8.5. Python 2.7.2 running in 32-bit mode (for now, I >> have the code in place to change over to 64 bit, but need to schedule the >> downtime to d

Re: Track down SIGABRT

2015-01-13 Thread Israel Brewster
On Jan 13, 2015, at 6:27 AM, William Ray Wing wrote: > >> On Jan 9, 2015, at 12:40 PM, Israel Brewster wrote: >> >> I have a long-running python/CherryPy Web App server process that I am >> running on Mac OS X 10.8.5. Python 2.7.2 running in 32-bit mode (for now, I >> have the code in place

Re: Python 3 regex?

2015-01-13 Thread Rick Johnson
On Tuesday, January 13, 2015 at 12:39:55 AM UTC-6, Steven D'Aprano wrote: > On Mon, 12 Jan 2015 15:47:08 -0800, Rick Johnson wrote: > [...] > > [...] > > > > #Ironic Twist (Reformatted)# > > ###

Re: Track down SIGABRT

2015-01-13 Thread Skip Montanaro
Assuming you have gdb available, you should be able to attach to the running process, then set a breakpoint in relevant functions (like exit() or abort()). Once there, you can pick through the C stack manually (kind of tedious) or use the gdbinit file which comes with Python to get a Python stack t

Re: what would be the regular expression for null byte present in a string

2015-01-13 Thread Denis McMahon
On Tue, 13 Jan 2015 13:40:52 +, Shambhu Rajak wrote: > I have a string that I get as an output of a command as: > '\x01\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x0010232ae8944a\x02\x00 \x00\x00\x00\x00\x00\x00\n' > > I want to fetch '10232ae8944a' from the above string. > > I want to find a r

Re: Track down SIGABRT

2015-01-13 Thread Israel Brewster
On Jan 13, 2015, at 8:26 AM, Skip Montanaro wrote: > Assuming you have gdb available, you should be able to attach to the > running process, then set a breakpoint in relevant functions (like > exit() or abort()). Once there, you can pick through the C stack > manually (kind of tedious) or use the

Re: Track down SIGABRT

2015-01-13 Thread Paul Rubin
Israel Brewster writes: > when it again crashed with a SIGABRT. The crash dump the > system gave me doesn't tell me much, other than that it looks > like python is calling some C function when it crashes. I've > attached the crash report, in case it can mean somethi

Re: how can I create a class and decode/encode as json?

2015-01-13 Thread Denis McMahon
On Tue, 13 Jan 2015 08:17:18 -0800, robertchen117 wrote: > I want to send Message to rabbitmq and receive from rabbitmq, message > format is below. > > how can I create a class and decode/encode as json? It may be easier to use dictionaries than classes. >>> import json >>> thing = {} >>> thing

Re: Python 3 regex?

2015-01-13 Thread Rick Johnson
On Tuesday, January 13, 2015 at 11:09:17 AM UTC-6, Rick Johnson wrote: > [...] > DO YOU NEED ME TO DRAW YOU A PICTURE? I don't normally do this, but in the interest of education i feel i must bear the burdens for which all professional educators like myself are responsible. https://plus.go

Re: How can i use a dictionnary

2015-01-13 Thread Dan Sommers
On Tue, 13 Jan 2015 06:56:11 -0800, Novocastrian_Nomad wrote: > On Tuesday, January 13, 2015 at 2:03:30 AM UTC-7, brice DORA wrote: >> i consume a web service that return a element whose the type is >> "instance". but this element seem be a dictionary but when i want to >> use it like a dictionar

Re: Python 2.7, on windows7 64 bit development machine, inconsistent issue on similar machines

2015-01-13 Thread Jacob Kruger
See answers below. Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." - Original Message - From: "Dennis Lee Bieber" The very first hit /I/ get is: https://social.technet.microsoft.com/Forums/windows/en-US/3932e3eb-c034-4eb

Re: Comparisons and sorting of a numeric class....

2015-01-13 Thread Ian Kelly
On Tue, Jan 13, 2015 at 4:20 AM, Chris Angelico wrote: > On Tue, Jan 13, 2015 at 10:00 PM, Marko Rauhamaa wrote: >> The code above, though, shouldn't consume memory since it is a simple >> tail-recursive loop. > > Only if the interpreter can optimize it away. Bear in mind that it > doesn't _retur

Re: Comparisons and sorting of a numeric class....

2015-01-13 Thread Chris Angelico
On Wed, Jan 14, 2015 at 5:56 AM, Ian Kelly wrote: > On Tue, Jan 13, 2015 at 4:20 AM, Chris Angelico wrote: >> On Tue, Jan 13, 2015 at 10:00 PM, Marko Rauhamaa wrote: >>> The code above, though, shouldn't consume memory since it is a simple >>> tail-recursive loop. >> >> Only if the interpreter c

Re: Python 2.7, on windows7 64 bit development machine, inconsistent issue on similar machines

2015-01-13 Thread Jacob Kruger
Ok, and just tested MySQLdb connection to both XAMPP server instance on same machine, as well as slightly remote connection to other machine over wifi, and same error - so, seems issue is invoked/caused by MySQLdb connection closing - if just put process to sleep for 30 seconds, nothing happens,

Re: Performance in exec environnements

2015-01-13 Thread Ian Kelly
On Tue, Jan 13, 2015 at 10:02 AM, Jean-Baptiste Braun wrote: > Hi, > > I'm working on auto-generated python code with the exec function. I've done > some performance benches : > > % python -m timeit '1 + 1' > 1000 loops, best of 3: 0.0229 usec per loop > > % python -m timeit "exec('1 + 1')" >

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-13 Thread André Roberge
On Tuesday, 13 January 2015 08:23:30 UTC-4, stephen...@gmail.com wrote: > I found a solution that I'm happy with. > > from datetime import datetime > from easygui_qt import * > > datestring = get_date() > mydate = datetime.strptime(datestring, '%b %d %Y') I'm thinking of having the new version

ANN: Python Events Calendar - Please submit your 2015 events

2015-01-13 Thread M.-A. Lemburg
[Please help spread the word by forwarding to other relevant mailing lists, user groups, etc. world-wide; thanks :-)] ANNOUNCING Python Events Calendars - Please submit your 2015 events maintained by th

Re: Python Events Calendar - Please submit your 2015 events

2015-01-13 Thread Stéphane Wirtel
Hi Marc-André, In fact, during the PythonFOSDEM 2015, there will be a presentation with the future events in 2015. I will use the python-events calendar for that. So, in this case, I propose to all the organisers of conferences to submit as soon as possible the calendar of their events. Tha

Re: Python Events Calendar - Please submit your 2015 events

2015-01-13 Thread M.-A. Lemburg
On 13.01.2015 22:24, =?utf-8?q?St=C3=A9phane?= Wirtel wrote: > Hi Marc-André, > > In fact, during the PythonFOSDEM 2015, there will be a presentation with the > future events in 2015. > I will use the python-events calendar for that. > > So, in this case, I propose to all the organisers of confe

Re: Performance in exec environnements

2015-01-13 Thread Steven D'Aprano
Jean-Baptiste Braun wrote: > Hi, > > I'm working on auto-generated python code with the exec function. I've > done some performance benches : [snip timing results] > Am I missing something or should I expect that result ? What does using > exec imply that causes such a difference ? exec'ing a

Re: List of "python -m" tools

2015-01-13 Thread Irmen de Jong
On 12-1-2015 5:17, Miki Tebeka wrote: > Greetings, > > I've compiled a list of "python -m" tools at > pythonwise.blogspot.com/2015/01/python-m.html. > > Did I miss something? What are your favorite "python -m" tools? > > Thanks, > -- > Miki > python -m calendar python -m test.pystone python

Re: Comparisons and sorting of a numeric class....

2015-01-13 Thread Andrew Robinson
On 01/12/2015 09:32 PM, Steven D'Aprano wrote: On Mon, 12 Jan 2015 17:59:42 -0800, Andrew Robinson wrote: [...] What I am wanting to know is WHY did Guido think it so important to do that ? Why was he so focused on a strict inability to have any instances of a bool subclass at all -- that he

Compiling multiple python scripts into an exe file

2015-01-13 Thread no nein
Basically, is it possible to compile multiple unrelated python scripts into a single exe file, so when execute it several python programs are run at once. In order to use this on another machine without python installed and only by using one single file. -- https://mail.python.org/mailman/listin

UnicodeEncodeError: 'ascii' codec can't encode character u'\ua000' in position 0: ordinal not in range(128)

2015-01-13 Thread Peng Yu
Hi, I am trying to understand what does encode() do. What are the hex representations of "u" in main.py? Why there is UnicodeEncodeError when main.py is piped to xxd? Why there is no such error when it is not piped? Thanks. ~$ cat main.py #!/usr/bin/env python u = unichr(40960) + u'abcd' + unich

[RELEASE] ‘python-daemon’ version 2.0.3 released

2015-01-13 Thread Ben Finney
Howdy all, I am pleased to announce the release of version 2.0.3 of the ‘python-daemon’ library. The current release is always available at https://pypi.python.org/pypi/python-daemon/>. The project's forums and VCS are hosted at Alioth https://alioth.debian.org/projects/python-daemon/>. Signif

Re: Python 2.7, on windows7 64 bit development machine, inconsistent issue on similar machines

2015-01-13 Thread Jacob Kruger
Ok, and just tested MySQLdb connection to both XAMPP server instance on same machine, as well as slightly remote connection to other machine over wifi, and same error - so, seems issue is invoked/caused by MySQLdb connection closing - if just put process to sleep for 30 seconds, nothing happens

Threading in Python, Please check the script

2015-01-13 Thread Robert Clove
Hi All, I have made a script in which i have started two thread named thread 1 and thread 2. In thread 1 one function will run named func1 and in thread 2 function 2 will run named func 2. Thread 1 will execute a command and wait for 60 seconds. Thread 2 will run only till thread 1 is running . Ag

Re: Compiling multiple python scripts into an exe file

2015-01-13 Thread dieter
no nein writes: > Basically, is it possible to compile multiple unrelated python scripts into a > single exe file, so when execute it several python programs are run at once. These are two distinct problems: * for doing things in paralell, look at "threading" or "multiprocessing" * for g