Re: XML Patch

2014-10-27 Thread Stefan Behnel
Hi, please keep this on-list. Nicholas Cole schrieb am 26.10.2014 um 22:43: > On Sun, Oct 26, 2014 at 6:30 PM, Stefan Behnel wrote: >> Nicholas Cole schrieb am 26.10.2014 um 18:00: >>> I'm looking for a python library that can parse XML Documents and >>> create xml-aware "diff" files, and then u

Re: XML Patch

2014-10-27 Thread Nicholas Cole
On Mon, Oct 27, 2014 at 7:28 AM, Stefan Behnel wrote: > Hi, > > please keep this on-list. Sorry about that. Wrong button! [snip] >> Yes - I want to store a series of XML diffs/patches and be able to >> generate documents by applying them. > > Could you be a little more specific? There are lots

Re: (test) ? a:b

2014-10-27 Thread ast
"Mark Lawrence" a écrit dans le message de news:mailman.15070.1413978605.18130.python-l...@python.org... Also would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seein

Callback functions arguments

2014-10-27 Thread ast
Hi In this web site at example n°5 http://fsincere.free.fr/isn/python/cours_python_tkinter.php A program is using the "Scale" widget from tkinter module. Here is a piece of code: Valeur = StringVar() echelle = Scale(Mafenetre, from_=-100, to=100, resolution=10, \ orient=HORIZONTAL, length=300,

asyncio: setting file permissions of a Unix socket?

2014-10-27 Thread Martin
Hi! :) I'm using the asyncio.Protocol interface to build a server which binds to a unix socket file. I want other system users to connect to the unix socket, so to communicate with the server. Where should I set the permissions of the file? The problem is that the socket file is created when th

Re: Callback functions arguments

2014-10-27 Thread Peter Otten
ast wrote: > Hi > > In this web site at example n°5 > http://fsincere.free.fr/isn/python/cours_python_tkinter.php > > A program is using the "Scale" widget from tkinter module. > Here is a piece of code: > > Valeur = StringVar() > > echelle = Scale(Mafenetre, from_=-100, to=100, resolution=10,

Re: (test) ? a:b

2014-10-27 Thread Gregory Ewing
Michael Torrie wrote: As far as I can tell, no BASIC dialect I've looked at (DOS and Linux worlds only), has ever had any logical operators like AND (&&), OR (||), and NOT (!). They only appear to have bitwise operators (&,|,~ C equivalent). The fact that comparison operators returned 0 and -1

Re: Callback functions arguments

2014-10-27 Thread Jean-Michel Pichavant
- Original Message - > From: "ast" > To: python-list@python.org > Sent: Monday, 27 October, 2014 9:16:26 AM > Subject: Callback functions arguments > > Hi > > In this web site at example n°5 > http://fsincere.free.fr/isn/python/cours_python_tkinter.php > > A program is using the "Scale"

Re: asyncio: setting file permissions of a Unix socket?

2014-10-27 Thread Michael Ströder
Martin wrote: > I'm using the asyncio.Protocol interface to build a server which binds > to a unix socket file. I want other system users to connect to the > unix socket, so to communicate with the server. > > Where should I set the permissions of the file? You should start the demon with a stri

Re: Classes and the command line

2014-10-27 Thread Jean-Michel Pichavant
- Original Message - > From: "Seymore4Head" > To: python-list@python.org > Sent: Monday, 27 October, 2014 3:27:18 AM > Subject: Classes and the command line > > I am trying to learn classes. > I am currently using Python 2.7 at the command line. > If you try to type commands at the comman

Re: Classes and the command line

2014-10-27 Thread alister
On Sun, 26 Oct 2014 23:32:08 -0400, Seymore4Head wrote: > On Mon, 27 Oct 2014 14:06:11 +1100, Ben Finney > wrote: > >>Seymore4Head writes: >> >>> I am trying to learn classes. >>> I am currently using Python 2.7 at the command line. >> >>(I think you mean “the interactive Python interpreter”, o

Re: Classes and the command line

2014-10-27 Thread Chris Angelico
On Mon, Oct 27, 2014 at 10:17 PM, alister wrote: > Notepad+ is also often suggested along with many other programmer editors/ > Integrated development environments (IDE). That would be Notepad++, and yes, it's fairly well recommended. It's based on the same edit component as SciTE, another good e

Re: Status of side-effecting functions in python

2014-10-27 Thread Steven D'Aprano
Roy Smith wrote: >> Yes and no. If something goes wrong in a .write() method, >> is not Python supposed to raise an error? (!) > > Define "wrong". It is not an error for a write() call to consume fewer > bytes than were requested. It's not? I'm asking a genuine question here, not a rhetorical

Re: Status of side-effecting functions in python

2014-10-27 Thread Chris Angelico
On Mon, Oct 27, 2014 at 10:30 PM, Steven D'Aprano wrote: > Roy Smith wrote: > >>> Yes and no. If something goes wrong in a .write() method, >>> is not Python supposed to raise an error? (!) >> >> Define "wrong". It is not an error for a write() call to consume fewer >> bytes than were requested.

Re: id == vs is

2014-10-27 Thread Roy Smith
In article , Cameron Simpson wrote: > The "is" test is more direct and less subject to iffiness because the longer > expression using id() leaves more scope/time for things to change, and of > course "id" itself can be rebound to something weird. Not to mention that Python is case-sensitive a

Re: Status of side-effecting functions in python

2014-10-27 Thread Roy Smith
In article <544e2cf2$0$13009$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Roy Smith wrote: > > >> Yes and no. If something goes wrong in a .write() method, > >> is not Python supposed to raise an error? (!) > > > > Define "wrong". It is not an error for a write() call to cons

Re: Classes and the command line

2014-10-27 Thread Seymore4Head
On Sun, 26 Oct 2014 23:32:08 -0400, Seymore4Head wrote: >On Mon, 27 Oct 2014 14:06:11 +1100, Ben Finney > wrote: > >>Seymore4Head writes: >> >>> I am trying to learn classes. >>> I am currently using Python 2.7 at the command line. >> >>(I think you mean “the interactive Python interpreter”, or

Re: Status of side-effecting functions in python

2014-10-27 Thread Grant Edwards
On 2014-10-25, Wolfgang Maier wrote: > It may be rare to use an expression both for its side-effects and its > return value, It's actually quite common. For example: f = open("filename") d = f.readline() In both of those lines, the side effects and return values are equally vital. The

Re: Status of side-effecting functions in python

2014-10-27 Thread Grant Edwards
On 2014-10-27, Steven D'Aprano wrote: > Roy Smith wrote: > >>> Yes and no. If something goes wrong in a .write() method, >>> is not Python supposed to raise an error? (!) >> >> Define "wrong". It is not an error for a write() call to consume fewer >> bytes than were requested. > > It's not? I'

Web services from python

2014-10-27 Thread loial
What is the best package to use with python 2.6 to access Web services. Is it ZSI? Can anyone recommend a good tutorial, preferably with a sandbox web service? -- https://mail.python.org/mailman/listinfo/python-list

Re: Lazy-evaluation lists/dictionaries

2014-10-27 Thread Jon Ribbens
On 2014-10-26, Terry Reedy wrote: > On 10/26/2014 10:14 AM, Jon Ribbens wrote: >> Is there any better way to do this other than simply re-implementing >> these types from scratch, emulating all their methods and operations? >> (i.e. using UserList/UserDict). I was under the impression that that >>

Anyone know the solution

2014-10-27 Thread emmanueloje
Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the application will display messages indicating whether the names were among the most popular. THIS IS THE LIST OF BOY NAM

Re: Lazy-evaluation lists/dictionaries

2014-10-27 Thread Jon Ribbens
On 2014-10-26, Tim Delaney wrote: > On 27 October 2014 01:14, Jon Ribbens wrote: >> I have a need, in a Python C extension I am writing, for lists and >> dictionaries with "lazy evaluation" - by which I mean that at least >> some of the values in the lists/dictionaries are "proxy objects" >> whic

Re: Status of side-effecting functions in python

2014-10-27 Thread Marko Rauhamaa
Grant Edwards : > If you really want to make sure that all bytes get written, you _must_ > put all write() calls in a loop that checks the return value and keeps > re-writing any unwritten data. > > And to answer your next question: yes, Unix application programmers > have been complaining about t

Re: Anyone know the solution

2014-10-27 Thread alister
On Mon, 27 Oct 2014 08:10:04 -0700, emmanueloje wrote: > Write a program that reads the contents of the two files into two > separate lists. The user should be able to enter a boy's name, a girl's > name or both, and the application will display messages indicating >

Re: Anyone know the solution

2014-10-27 Thread Joel Goldstick
2014-10-27 11:10 GMT-04:00 : > Write a program that reads the contents of the two files into two separate > lists. The user should be able to enter a boy's name, a girl's > name or both, and the application will display messages indicating whether > the names were among the most

Build Question: How to Add -Wl,--option Before Objects In Setup.py?

2014-10-27 Thread Cyd Haselton
I need to add a linker option to the command(s) run by setup.py when building various objects. I'm not familiar with Python at all, so I basically copied and modified a line from one area of the script to another ext_modules=[Extension('_struct', ['_struct.c'], extra_link_args = ['Wl,--allow-shl

A bug?

2014-10-27 Thread uma...@gmail.com
I use python 3.4.0 version. In the course of developing / running a python program, I have encountered a problem. I have reproduced below a simple program to bring it out. >>> d = [[0]*3]*4 >>> dd = [1,2,3,4,5,6,7,8,9,10,11,12] >>> for i in range(4): ... for j in range(3): d[i][j] = dd[i*3+j

Re: A bug?

2014-10-27 Thread Wolfgang Maier
On 10/27/2014 05:01 PM, uma...@gmail.com wrote: I use python 3.4.0 version. In the course of developing / running a python program, I have encountered a problem. I have reproduced below a simple program to bring it out. d = [[0]*3]*4 dd = [1,2,3,4,5,6,7,8,9,10,11,12] for i in range(4): ...

Re: A bug?

2014-10-27 Thread Ian Kelly
On Mon, Oct 27, 2014 at 10:17 AM, Wolfgang Maier wrote: > See > https://docs.python.org/3/library/stdtypes.html?highlight=list#common-sequence-operations > under Note 2 . > > Also asked and answered multiple times at stackoverflow, e.g., > http://stackoverflow.com/questions/6688223/ Also see htt

memory, PE files, etc...

2014-10-27 Thread kiuhnm03
Hi! I'd like to write one or more scripts that analyze processes in memory on Windows 7. I used to do these things in C++ by using native Win32 API calls. How should I proceed in python? Any pointers? -- https://mail.python.org/mailman/listinfo/python-list

Re: memory, PE files, etc...

2014-10-27 Thread Tim Golden
On 27/10/2014 17:16, kiuhn...@yahoo.it wrote: > Hi! I'd like to write one or more scripts that analyze processes in > memory on Windows 7. I used to do these things in C++ by using native > Win32 API calls. How should I proceed in python? Any pointers? > psutil is definitely your friend: https

variable attribute name

2014-10-27 Thread Harvey Greenberg
I want to let the name of an attribute be the string value of a variable. Here is some code: class Object(object): pass A = Object() s = 'attr' A. = 1 The last line denotes the variable value by (not a python form). What I want is to have A.attr = 1, but 'attr' determined by the value of s.

Re: variable attribute name

2014-10-27 Thread Larry Martell
On Mon, Oct 27, 2014 at 2:23 PM, Harvey Greenberg wrote: > I want to let the name of an attribute be the string value of a variable. > Here is some code: > > class Object(object): pass > A = Object() > s = 'attr' > A. = 1 > > The last line denotes the variable value by (not a python form). Wha

Re: memory, PE files, etc...

2014-10-27 Thread kiuhnm03
On Monday, October 27, 2014 6:24:19 PM UTC+1, Tim Golden wrote: > psutil is definitely your friend: > > https://github.com/giampaolo/psutil > > Although WMI can be quite handy too, depending on what you're trying to do: > > http://timgolden.me.uk/python/wmi/ > > TJG Thanks for answering. I

Re: variable attribute name

2014-10-27 Thread Ned Batchelder
On 10/27/14 2:32 PM, Larry Martell wrote: On Mon, Oct 27, 2014 at 2:23 PM, Harvey Greenberg wrote: I want to let the name of an attribute be the string value of a variable. Here is some code: class Object(object): pass A = Object() s = 'attr' A. = 1 The last line denotes the variable value

Re: Build Question: How to Add -Wl, --option Before Objects In Setup.py?

2014-10-27 Thread Ned Deily
In article , Cyd Haselton wrote: > I need to add a linker option to the command(s) run by setup.py when > building various objects. I'm not familiar with Python at all, so I > basically copied and modified a line from one area of the script to > another > > > ext_modules=[Extension('_struct',

Re: I am out of trial and error again Lists

2014-10-27 Thread giacomo boffi
Rustom Mody writes: > What would you say to a person who > - Buys a Lambhorgini I'd say: "Don't buy a Lambhorgini from that nice guy you met at a party, but buy a Lamborghini by an authorized dealer" ;-) -- I was a kid when Lamborghini launched the Miura! -- https://mail.python.org

different behavior from idle/pycharm and shell

2014-10-27 Thread kiuhnm03
Consider this code: --- from ctypes import * user32 = windll.user32 user32.MessageBoxA(0, 'ok', 'ok', 0) --- If I run it in idle or from pycharm, the messagebox shows 'o' instead of 'ok', but if I run it from shell, it shows 'ok' like it should. The same happens with msvcrt.printf(). Why? -- h

Re: different behavior from idle/pycharm and shell

2014-10-27 Thread sohcahtoa82
On Monday, October 27, 2014 3:38:31 PM UTC-7, kiuh...@yahoo.it wrote: > Consider this code: > > --- > from ctypes import * > > user32 = windll.user32 > user32.MessageBoxA(0, 'ok', 'ok', 0) > --- > > If I run it in idle or from pycharm, the messagebox shows 'o' instead of > 'ok', but if I run it

Re: different behavior from idle/pycharm and shell

2014-10-27 Thread MRAB
On 2014-10-27 22:38, kiuhn...@yahoo.it wrote: Consider this code: --- from ctypes import * user32 = windll.user32 user32.MessageBoxA(0, 'ok', 'ok', 0) --- If I run it in idle or from pycharm, the messagebox shows 'o' instead of 'ok', but if I run it from shell, it shows 'ok' like it should. T

Re: different behavior from idle/pycharm and shell

2014-10-27 Thread kiuhnm03
On Monday, October 27, 2014 11:55:44 PM UTC+1, MRAB wrote: > On 2014-10-27 22:38, kiuhnm wrote: > > Consider this code: > > > > --- > > from ctypes import * > > > > user32 = windll.user32 > > user32.MessageBoxA(0, 'ok', 'ok', 0) > > --- > > > > If I run it in idle or from pycharm, the messagebox sh

Re: Build Question: How to Add -Wl, --option Before Objects In Setup.py?

2014-10-27 Thread Cyd Haselton
On Mon, Oct 27, 2014 at 3:39 PM, Ned Deily wrote: > In article > , > Cyd Haselton wrote: >> I need to add a linker option to the command(s) run by setup.py when >> building various objects. I'm not familiar with Python at all, so I >> basically copied and modified a line from one area of the sc

Re: Anyone know the solution

2014-10-27 Thread Denis McMahon
On Mon, 27 Oct 2014 08:10:04 -0700, emmanueloje wrote: > Write a program that reads the contents of the two files into two > separate lists. Yep, know how to do that > The user should be able to enter a boy's name, a girl's > name or both Yep, know how to do that > and the application will dis

Re: Anyone know the solution

2014-10-27 Thread alex23
On 28/10/2014 1:10 AM, emmanuel...@gmail.com wrote: Write a program that reads the contents of the two files into two separate lists. The user should be able to enter a boy's name, a girl's name or both, and the application will display messages indicating whether the names wer

Re: A bug?

2014-10-27 Thread Denis McMahon
On Mon, 27 Oct 2014 09:01:57 -0700, uma...@gmail.com wrote: > I use python 3.4.0 version. In the course of developing / running a > python program, I have encountered a problem. I have reproduced below a > simple program to bring it out. > > d = [[0]*3]*4 dd = [1,2,3,4,5,6,7,8,9,10,11,12]

Re: A bug?

2014-10-27 Thread Rustom Mody
On Tuesday, October 28, 2014 6:07:14 AM UTC+5:30, Denis McMahon wrote: > On Mon, 27 Oct 2014 09:01:57 -0700, umatrp wrote: > > I use python 3.4.0 version. In the course of developing / running a > > python program, I have encountered a problem. I have reproduced below a > > simple program to bring

Re: A bug?

2014-10-27 Thread Chris Angelico
On Tue, Oct 28, 2014 at 12:12 PM, Rustom Mody wrote: > More generally for d being a 2-D reshape of dd (which may be anything > as long as the size matches) > dd = [1,2,3,4,5,6,7,8,9,10,11,12] d=[[dd[i*3+j] for j in range(3)] for i in range(4)] d > [[1, 2, 3], [4, 5, 6], [7, 8, 9], [

Re: A bug?

2014-10-27 Thread Joshua Landau
On 28 October 2014 00:36, Denis McMahon wrote: > > d = [[list(range(1,13))[i*3+j] for j in range(3)] for i in range(4)] A quick note. Ranges (even 2.7's xrange) are all indexable. The cast to a list isn't needed. -- https://mail.python.org/mailman/listinfo/python-list

Re: A bug?

2014-10-27 Thread Rustom Mody
On Tuesday, October 28, 2014 6:56:10 AM UTC+5:30, Chris Angelico wrote: > On Tue, Oct 28, 2014 at 12:12 PM, Rustom Mody wrote: > > More generally for d being a 2-D reshape of dd (which may be anything > > as long as the size matches) > > > dd = [1,2,3,4,5,6,7,8,9,10,11,12] > d=[[dd[i*3+j

Re: memory, PE files, etc...

2014-10-27 Thread Rustom Mody
On Tuesday, October 28, 2014 12:41:40 AM UTC+5:30, kiuh...@yahoo.it wrote: > On Monday, October 27, 2014 6:24:19 PM UTC+1, Tim Golden wrote: > > psutil is definitely your friend: > > > > https://github.com/giampaolo/psutil > > > > Although WMI can be quite handy too, depending on what you're tr

Re: Status of side-effecting functions in python

2014-10-27 Thread Nobody
On Mon, 27 Oct 2014 17:14:58 +0200, Marko Rauhamaa wrote: > In POSIX, a write(2) system call on file blocks until all bytes have been > passed on to the file system. The only exception (no pun intended) I know > is the reception of a signal. Writing to a file (or block device) will return a short

Re: Classes and the command line

2014-10-27 Thread Terry Reedy
On 10/26/2014 11:24 PM, Chris Angelico wrote: On Mon, Oct 27, 2014 at 2:18 PM, Rustom Mody wrote: On Monday, October 27, 2014 8:40:48 AM UTC+5:30, Chris Angelico wrote: You can get block-by-block history by using Idle. I find that fairly convenient for manipulating class/function definitions

Re: Classes and the command line

2014-10-27 Thread Terry Reedy
On 10/26/2014 11:28 PM, Seymore4Head wrote: I am going to be flexible on IDLE in the near future, but I wanted to try it the old fashion way. I already know using IDLE is better, but I am not sure using IDLE will invoke Python 2 and I am not sure how to change that at the moment. Currently, I

Re: Anyone know the solution

2014-10-27 Thread Terry Reedy
On 10/27/2014 11:10 AM, emmanuel...@gmail.com wrote: THIS IS THE LIST OF BOY NAMES > Jacob > ... Writing hundreds of unnecessary lines at minimum inconsiderate. Please don't do it. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Classes and the command line

2014-10-27 Thread Chris Angelico
On Tue, Oct 28, 2014 at 3:08 PM, Terry Reedy wrote: >> It's inconsistent only because the default sys.ps2 is those dots, >> which aren't necessary in Idle. You could make it consistent by simply >> changing sys.ps2. > > > Nope. User code is executed in the user process. Its only effect on the >

hotel management system

2014-10-27 Thread ngangsia akumbo
Please can someone look at my code and may be advice and may be help me with some correction. I have been learning python for some time now. This is my first project i wish to write. A hotel management system. http://pastebin.com/LMHmuTiC Thnaks -- https://mail.python.org/mailman/listinfo/pyt