Re: Combining lists to dictionary

2014-11-11 Thread Dave Angel
Ben Finney Wrote in message: > Denis McMahon writes: > >> Hi >> >> Given x,y are a lists of keys and value that I wish to combine to a >> dictionary, such that x[n] is the key for value y[n], which is preferred: >> >> z = {a:b for (a,b) in zip(x,y)} > > This one, with the caveat to use PEP-8 c

Re: I love assert

2014-11-11 Thread Chris Angelico
On Wed, Nov 12, 2014 at 1:35 PM, Ben Finney wrote: > The more things people need to keep in mind when reading my code that > isn't stated explicitly in the code, the worse I consider the code to > be. Then the ternary if/else operator should also be abolished. track["APIC:"].data if "APIC:" in t

Re: I love assert

2014-11-11 Thread Ben Finney
Chris Angelico writes: > On Wed, Nov 12, 2014 at 7:03 AM, Ben Finney > wrote: > > An ‘assert’ statement in the code will sometimes be active, and > > sometimes be a no-op, for *exactly* the same code under different > > circumstances. That's a trap for the reader, and I'd rather not set > > it.

Re: html page mail link to webmail program

2014-11-11 Thread Chris Angelico
On Wed, Nov 12, 2014 at 12:42 PM, Ben Finney wrote: > Ethan Furman writes: > >> Okay, the explicit Python question: Clicking on a mail link in a web >> browser can start an external program. I would like that external >> program to be a Python script that [controls an already-running web >> brows

Re: I love assert

2014-11-11 Thread Chris Angelico
On Wed, Nov 12, 2014 at 7:03 AM, Ben Finney wrote: > An ‘assert’ statement in the code will sometimes be active, and > sometimes be a no-op, for *exactly* the same code under different > circumstances. That's a trap for the reader, and I'd rather not set it. This is no worse than other forms of p

Re: I love assert

2014-11-11 Thread Dan Stromberg
On Tue, Nov 11, 2014 at 11:40 AM, Peter Cacioppi wrote: > I get the impression that most Pythonistas aren't as habituated with assert > statements as I am. Is that just a misimpression on my part? If not, is there > a good reason to assert less with Python than other languages? > > As far as I c

Re: html page mail link to webmail program

2014-11-11 Thread Ben Finney
Ethan Furman writes: > Okay, the explicit Python question: Clicking on a mail link in a web > browser can start an external program. I would like that external > program to be a Python script that [controls an already-running web > browser to visit a URL and operate a web application]. > > Surely

Re: html page mail link to webmail program

2014-11-11 Thread Ethan Furman
On 11/11/2014 05:08 PM, Ben Finney wrote: Ethan Furman writes: My wife (using a Win7 machine) will be on a web page that has a link to mail somebody. She clicks on it, and it opens the currently installed but unused Thunderbird. Ideally, what would happen is a new window/tab would open to gm

Re: I love assert

2014-11-11 Thread Ethan Furman
On 11/11/2014 01:46 PM, Albert-Jan Roskam wrote: Ethan Furman wrote: I don't know, haven't used it nor read the code. It would certainly not be good if it failed in optimized mode. antonia@antonia-HP-2133 /tmp $ python -O test.py Ran 2 tests in 0.015s OK antonia@antonia-HP-2133 /tmp $ pytho

Re: Combining lists to dictionary

2014-11-11 Thread Ben Finney
Denis McMahon writes: > Hi > > Given x,y are a lists of keys and value that I wish to combine to a > dictionary, such that x[n] is the key for value y[n], which is preferred: > > z = {a:b for (a,b) in zip(x,y)} This one, with the caveat to use PEP-8 compatible formatting:: z = {a: b for (a

Re: Combining lists to dictionary

2014-11-11 Thread Roy Smith
In article , Denis McMahon wrote: > Hi > > Given x,y are a lists of keys and value that I wish to combine to a > dictionary, such that x[n] is the key for value y[n], which is preferred: > > z = {a:b for (a,b) in zip(x,y)} > z = {x[n]:y[n] for n in range(min(len(x),len(y)))} > > The zip feel

Re: html page mail link to webmail program

2014-11-11 Thread Ben Finney
Ethan Furman writes: > My wife (using a Win7 machine) will be on a web page that has a link > to mail somebody. She clicks on it, and it opens the currently > installed but unused Thunderbird. > > Ideally, what would happen is a new window/tab would open to gmail > with a new compose window with

html page mail link to webmail program

2014-11-11 Thread Ethan Furman
Just in case that subject line is not perfectly clear: ;) My wife (using a Win7 machine) will be on a web page that has a link to mail somebody. She clicks on it, and it opens the currently installed but unused Thunderbird. Ideally, what would happen is a new window/tab would open to gmail w

pip Install errors for bcrypt on OSX 10.10 Yosemite

2014-11-11 Thread Michael Weems
$ sudo pip install bcrypt Downloading/unpacking bcrypt Downloading bcrypt-1.0.2.tar.gz (40kB): 40kB downloaded Running setup.py (path:/private/tmp/pip_build_root/bcrypt/setup.py) egg_info for package bcrypt Package libffi was not found in the pkg-config search path. Perhaps you should

Re: I love assert

2014-11-11 Thread Ethan Furman
On 11/11/2014 03:02 PM, Peter Cacioppi wrote: On Tue, Nov 11, 2014 at 12:57 PM, TP wrote: PyCharm uses docstrings to accomplish the same task [2] but can also use asserts/isinstance [3]. [2] https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html

Re: I love assert

2014-11-11 Thread Peter Cacioppi
On Tue, Nov 11, 2014 at 12:57 PM, TP wrote: > On Tue, Nov 11, 2014 at 11:40 AM, Peter Cacioppi > wrote: > >> I think one needs to take care with some basic assert coding - it's not a >> substitute for unit tests, it doesn't absolve you of normal exception >> responsibilities, and, most of all, i

Re: I love assert

2014-11-11 Thread Tim Chase
On 2014-11-11 11:40, Peter Cacioppi wrote: > I get the impression that most Pythonistas aren't as habituated > with assert statements as I am. Is that just a misimpression on my > part? I tend to use it to catch my bone-headedness rather than actual tests. I'm particularly fond of one that catche

Re: I love assert

2014-11-11 Thread Ben Finney
Terry Reedy writes: > We love 'assert' so much that we have 20-30 'assertXYZ' variations in > unittest. A function will not be disabled by a run-time option to the Python interpreter. > The statement 'assert expression' is almost equivalent to > > if not expression: raise AssertionError('expres

Re: I love assert

2014-11-11 Thread Terry Reedy
On 11/11/2014 2:40 PM, Peter Cacioppi wrote: I get the impression that most Pythonistas aren't as habituated with assert statements as I am. Is that just a misimpression on my part? If not, is there a good reason to assert less with Python than other languages? We love 'assert' so much that we

Re: Python modules

2014-11-11 Thread Ben Finney
Will Acheson writes: > I have had a lot of trouble with executing relative imports with some > of my projects in python. > > Are there any best practices or methods besides '../../' type > hard-coding? The important point to learn with Python's import system, as contrasted with various other la

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Chris Angelico
On Wed, Nov 12, 2014 at 4:55 AM, Ethan Furman wrote: > On 11/11/2014 09:30 AM, Larry Martell wrote: >> >> >> They are technically savvy. They are a 100% PHP shop. They have a big, >> complicated app that they've been working on for 10 years. No one >> there knows python or django. They want to put

Re: I love assert

2014-11-11 Thread Albert-Jan Roskam
- Original Message - > From: Ethan Furman > To: Albert-Jan Roskam > Cc: "python-list@python.org" > Sent: Tuesday, November 11, 2014 10:15 PM > Subject: Re: I love assert > > On 11/11/2014 01:09 PM, Albert-Jan Roskam wrote: >> Ethan Furman wrote: >>> >>> asserts are a specialized t

Re: I love assert

2014-11-11 Thread Grant Edwards
On 2014-11-11, Ben Finney wrote: > An ‘assert’ statement in the code will sometimes be active, and > sometimes be a no-op, for *exactly* the same code under different > circumstances. Yep, it's the same in C, C++, Java, PHP, and other languages. I think most people know that asserts can be disa

Re: Combining lists to dictionary

2014-11-11 Thread Rob Gaddi
On Tue, 11 Nov 2014 20:43:01 + (UTC) Denis McMahon wrote: > Hi > > Given x,y are a lists of keys and value that I wish to combine to a > dictionary, such that x[n] is the key for value y[n], which is preferred: > > z = {a:b for (a,b) in zip(x,y)} > z = {x[n]:y[n] for n in range(min(len(x),

PDF Library with full CSS3 Support

2014-11-11 Thread mojo
Looking for a Python PDF Generation library that supports CSS3. Suggestions? -- https://mail.python.org/mailman/listinfo/python-list

Re: I love assert

2014-11-11 Thread Ethan Furman
On 11/11/2014 01:09 PM, Albert-Jan Roskam wrote: Ethan Furman wrote: asserts are a specialized tool, easily abused. Sounds like you are using them exactly as intended. Would you say that assert is baaadly abused in nose?*) I never tried it, but probably all tests pass when Python is run wit

Re: I love assert

2014-11-11 Thread Albert-Jan Roskam
- Original Message - > From: Ethan Furman > To: python-list@python.org > Cc: > Sent: Tuesday, November 11, 2014 9:08 PM > Subject: Re: I love assert > > On 11/11/2014 11:40 AM, Peter Cacioppi wrote: >> >> I get the impression that most Pythonistas aren't as habituated with > assert

Re: Combining lists to dictionary

2014-11-11 Thread Gary Herron
On 11/11/2014 12:43 PM, Denis McMahon wrote: Hi Given x,y are a lists of keys and value that I wish to combine to a dictionary, such that x[n] is the key for value y[n], which is preferred: z = {a:b for (a,b) in zip(x,y)} z = {x[n]:y[n] for n in range(min(len(x),len(y)))} The zip feels more el

Re: I love assert

2014-11-11 Thread TP
On Tue, Nov 11, 2014 at 11:40 AM, Peter Cacioppi wrote: > I think one needs to take care with some basic assert coding - it's not a > substitute for unit tests, it doesn't absolve you of normal exception > responsibilities, and, most of all, it should be used for passive > inspection and not acti

Combining lists to dictionary

2014-11-11 Thread Denis McMahon
Hi Given x,y are a lists of keys and value that I wish to combine to a dictionary, such that x[n] is the key for value y[n], which is preferred: z = {a:b for (a,b) in zip(x,y)} z = {x[n]:y[n] for n in range(min(len(x),len(y)))} The zip feels more elegant, but it seems clunky to use the zip meth

Re: I love assert

2014-11-11 Thread Mark Lawrence
On 11/11/2014 19:40, Peter Cacioppi wrote: I get the impression that most Pythonistas aren't as habituated with assert statements as I am. Is that just a misimpression on my part? If not, is there a good reason to assert less with Python than other languages? As far as I can tell, Python suppo

Re: I love assert

2014-11-11 Thread Rob Gaddi
On Tue, 11 Nov 2014 11:40:38 -0800 (PST) Peter Cacioppi wrote: > I get the impression that most Pythonistas aren't as habituated with assert > statements as I am. Is that just a misimpression on my part? If not, is there > a good reason to assert less with Python than other languages? > > As f

Re: Python modules

2014-11-11 Thread Will Acheson
On Sunday, November 9, 2014 11:51:41 PM UTC-5, Steve Hayes wrote: > I have a book on Python that advocates dividing programs into modules, and > importing them when needed. > > I have a question about this. > > I can understand doing that in a compiled language, where different modules > can be

Re: I love assert

2014-11-11 Thread Ethan Furman
On 11/11/2014 11:40 AM, Peter Cacioppi wrote: I get the impression that most Pythonistas aren't as habituated with assert statements as I am. Is that just a misimpression on my part? If not, is there a good reason to assert less with Python than other languages? As far as I can tell, Python

Re: Python script that does batch find and replace in txt files

2014-11-11 Thread Denis McMahon
On Sun, 09 Nov 2014 11:58:49 -0800, Syed Khalid wrote: > Python script that does batch find and replace in txt files Need a > python script that opens all .txt files in a folder find replace/delete > text and save files. Sounds like you need sed, not python. -- Denis McMahon, denismfmcma...@gma

Re: I love assert

2014-11-11 Thread Ben Finney
Peter Cacioppi writes: > I get the impression that most Pythonistas aren't as habituated with > assert statements as I am. Is that just a misimpression on my part? If > not, is there a good reason to assert less with Python than other > languages? I don't know about comparisons like “use less wi

Re: What is rstrip() in python?

2014-11-11 Thread Will Acheson
On Sunday, November 9, 2014 6:12:24 AM UTC-5, satish...@gmail.com wrote: > What is rstrip() in python? > > What does it do in the following piece of code? > > import sqlite3 > conn = sqlite3.connect('dbase1') > curs = conn.cursor() > > file = open('data.txt') > rows = [line.rstrip().split(',') f

I love assert

2014-11-11 Thread Peter Cacioppi
I get the impression that most Pythonistas aren't as habituated with assert statements as I am. Is that just a misimpression on my part? If not, is there a good reason to assert less with Python than other languages? As far as I can tell, Python supports assert perfectly well. When run with the

Re: Advice

2014-11-11 Thread Rob Gaddi
On Tue, 11 Nov 2014 16:53:18 + Mary-Frances McNamee wrote: > To whom it may concern, > > I am currently working on a bit of coding for a raspberry pi, I was wondering > maybe I could get some advice? I want my program to run for a certain time, > for example 7am-2.30am everyday. Is this po

Re: Advice

2014-11-11 Thread Ian Kelly
On Tue, Nov 11, 2014 at 9:53 AM, Mary-Frances McNamee < maryfrances.mcna...@epas-ltd.com> wrote: > > I am currently working on a bit of coding for a raspberry pi, I was wondering maybe I could get some advice? I want my program to run for a certain time, for example 7am-2.30am everyday. Is this pos

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Joel Goldstick
On Tue, Nov 11, 2014 at 12:55 PM, Ethan Furman wrote: > On 11/11/2014 09:30 AM, Larry Martell wrote: >> >> >> They are technically savvy. They are a 100% PHP shop. They have a big, >> complicated app that they've been working on for 10 years. No one >> there knows python or django. They want to pu

Advice

2014-11-11 Thread Mary-Frances McNamee
To whom it may concern, I am currently working on a bit of coding for a raspberry pi, I was wondering maybe I could get some advice? I want my program to run for a certain time, for example 7am-2.30am everyday. Is this possible? I would appreciate any help. Thank you for your time. Regards Ma

Re: "Natural" use of cmp= in sort

2014-11-11 Thread Ian Kelly
On Tue, Nov 11, 2014 at 2:21 AM, Paddy wrote: > On Tuesday, 11 November 2014 09:07:14 UTC, Ian wrote: >> On Tue, Nov 11, 2014 at 12:44 AM, Paddy wrote: >> > Thanks Ian. The original author states "...and it is sure that the given >> > inputs will give an output, i.e., the inputs will always be

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Ethan Furman
On 11/11/2014 09:30 AM, Larry Martell wrote: They are technically savvy. They are a 100% PHP shop. They have a big, complicated app that they've been working on for 10 years. No one there knows python or django. They want to put some new frontends on their app. I was bought in for another projec

Re: What is \1 here?

2014-11-11 Thread Mark Lawrence
On 11/11/2014 15:20, Albert-Jan Roskam wrote: - Original Message - From: Ned Batchelder To: python-list@python.org Cc: Sent: Tuesday, November 11, 2014 12:52 PM Subject: Re: What is \1 here? You need to learn how to find this stuff out for yourself. Ben Finney even gave you a poin

Re: What is \1 here?

2014-11-11 Thread Denis McMahon
On Tue, 11 Nov 2014 01:18:02 -0800, satishmlmlml wrote: > What does \1 do in the following piece of code(fourth line)? It tells you to learn about regex. http://www.pcre.org/pcre.txt -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: What is ?s here?

2014-11-11 Thread Denis McMahon
On Tue, 11 Nov 2014 01:37:21 -0800, satishmlmlml wrote: > What does ?s do in the following piece of code? It tells you to learn about regex. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Denis McMahon
On Tue, 11 Nov 2014 10:48:41 -0500, Larry Martell wrote: > Is there some way python can communicate like curl ... it needs to send > the request string in the body of a POST request to the URL that will > route to the PHP script and get the output back. http://www.lmgtfy.com/?q=python+http+reques

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
On Tue, Nov 11, 2014 at 12:31 PM, Marc Aymerich wrote: > On Tue, Nov 11, 2014 at 6:26 PM, Larry Martell > wrote: >> On Tue, Nov 11, 2014 at 12:18 PM, Marc Aymerich wrote: >>> On Tue, Nov 11, 2014 at 5:43 PM, Larry Martell >>> wrote: On Tue, Nov 11, 2014 at 11:00 AM, Marc Aymerich

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Marc Aymerich
On Tue, Nov 11, 2014 at 6:26 PM, Larry Martell wrote: > On Tue, Nov 11, 2014 at 12:18 PM, Marc Aymerich wrote: >> On Tue, Nov 11, 2014 at 5:43 PM, Larry Martell >> wrote: >>> On Tue, Nov 11, 2014 at 11:00 AM, Marc Aymerich wrote: On Tue, Nov 11, 2014 at 4:48 PM, Larry Martell wrote

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
On Tue, Nov 11, 2014 at 11:43 AM, Joel Goldstick wrote: > On Tue, Nov 11, 2014 at 11:37 AM, Larry Martell > wrote: >> On Tue, Nov 11, 2014 at 10:54 AM, Chris Angelico wrote: >>> On Wed, Nov 12, 2014 at 2:48 AM, Larry Martell >>> wrote: Is there some way python can communicate like curl .

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
On Tue, Nov 11, 2014 at 12:18 PM, Marc Aymerich wrote: > On Tue, Nov 11, 2014 at 5:43 PM, Larry Martell > wrote: >> On Tue, Nov 11, 2014 at 11:00 AM, Marc Aymerich wrote: >>> On Tue, Nov 11, 2014 at 4:48 PM, Larry Martell >>> wrote: I have a PHP app that I want to convert to django.

Re: locale.getlocale() in cmd.exe vs. Idle

2014-11-11 Thread random832
On Tue, Nov 11, 2014, at 09:47, Albert-Jan Roskam wrote: > - Original Message - > > From: Terry Reedy > > To: python-list@python.org > > Cc: > > Sent: Monday, November 10, 2014 9:31 PM > > Subject: Re: locale.getlocale() in cmd.exe vs. Idle > > > > On 11/10/2014 4:22 AM, Albert-Jan Ros

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Marc Aymerich
On Tue, Nov 11, 2014 at 5:43 PM, Larry Martell wrote: > On Tue, Nov 11, 2014 at 11:00 AM, Marc Aymerich wrote: >> On Tue, Nov 11, 2014 at 4:48 PM, Larry Martell >> wrote: >>> >>> I have a PHP app that I want to convert to django. But I want to do it >>> stages. All the heavy lifting is in the P

Re: locale.getlocale() in cmd.exe vs. Idle

2014-11-11 Thread random832
On Tue, Nov 11, 2014, at 09:47, Albert-Jan Roskam wrote: > - Original Message - > > From: Terry Reedy > > To: python-list@python.org > > Cc: > > Sent: Monday, November 10, 2014 9:31 PM > > Subject: Re: locale.getlocale() in cmd.exe vs. Idle > > > > On 11/10/2014 4:22 AM, Albert-Jan Ros

Problem with autopy and a specific app

2014-11-11 Thread Luis Roberto Romano
Hi. I need to manipulate the mouse. I found the "autopy" package. It's working perfectly with any application, except in one of them. The software's name is: AVerMedia Capture Studio. Did anybody use this module? Did anybody get any trouble with some app? Thanks --

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Joel Goldstick
On Tue, Nov 11, 2014 at 11:37 AM, Larry Martell wrote: > On Tue, Nov 11, 2014 at 10:54 AM, Chris Angelico wrote: >> On Wed, Nov 12, 2014 at 2:48 AM, Larry Martell >> wrote: >>> Is there some way python can communicate like curl ... it needs to >>> send the request string in the body of a POST r

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
On Tue, Nov 11, 2014 at 11:00 AM, Marc Aymerich wrote: > On Tue, Nov 11, 2014 at 4:48 PM, Larry Martell > wrote: >> >> I have a PHP app that I want to convert to django. But I want to do it >> stages. All the heavy lifting is in the PHP code, so first, I want to >> just use templates and views t

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
On Tue, Nov 11, 2014 at 10:54 AM, Chris Angelico wrote: > On Wed, Nov 12, 2014 at 2:48 AM, Larry Martell > wrote: >> Is there some way python can communicate like curl ... it needs to >> send the request string in the body of a POST request to the URL that >> will route to the PHP script and get

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Marc Aymerich
On Tue, Nov 11, 2014 at 4:48 PM, Larry Martell wrote: > > I have a PHP app that I want to convert to django. But I want to do it > stages. All the heavy lifting is in the PHP code, so first, I want to > just use templates and views to generate the HTML, but still call the > PHP code. Then later co

Re: Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Chris Angelico
On Wed, Nov 12, 2014 at 2:48 AM, Larry Martell wrote: > Is there some way python can communicate like curl ... it needs to > send the request string in the body of a POST request to the URL that > will route to the PHP script and get the output back. That is possible, but probably more effort tha

Communicating with a PHP script (and pretending I'm a browser)

2014-11-11 Thread Larry Martell
I have a PHP app that I want to convert to django. But I want to do it stages. All the heavy lifting is in the PHP code, so first, I want to just use templates and views to generate the HTML, but still call the PHP code. Then later convert the PHP to python. My issue is that the PHP code expects t

Re: What is \1 here?

2014-11-11 Thread Albert-Jan Roskam
- Original Message - > From: Ned Batchelder > To: python-list@python.org > Cc: > Sent: Tuesday, November 11, 2014 12:52 PM > Subject: Re: What is \1 here? > You need to learn how to find this stuff out for yourself. Ben Finney > even gave you a pointer to a helpful site for experim

Re: Need some help with NetGroupAddUser

2014-11-11 Thread MRAB
On 2014-11-11 04:30, Jaimin Ajmeri wrote: cfl.rr.com> writes: New B question -- Need help with win32net.NetGroupAddUser. I used Mark Hammond sample code to create a new user from his book Python Programming on Win32. I then added one line to add the newuser to a group. def CreateUserAndS

Re: locale.getlocale() in cmd.exe vs. Idle

2014-11-11 Thread Albert-Jan Roskam
- Original Message - > From: Terry Reedy > To: python-list@python.org > Cc: > Sent: Monday, November 10, 2014 9:31 PM > Subject: Re: locale.getlocale() in cmd.exe vs. Idle > > On 11/10/2014 4:22 AM, Albert-Jan Roskam wrote: >> Hi, >> >> Why do I get different output for locale.getloca

Re: Trouble with python

2014-11-11 Thread Joel Goldstick
On Tue, Nov 11, 2014 at 6:53 AM, Ben Finney wrote: > Ashleigh Deal writes: > >> I am trying to use python as part of my part 3 project but my coding >> has suddenly stopped working. I am using python(x,y) and it was >> working perfectly a couple of weeks ago but recently it hasn't been. > > What

Re: Need some help with NetGroupAddUser

2014-11-11 Thread Jaimin Ajmeri
cfl.rr.com> writes: > > New B question -- Need help with win32net.NetGroupAddUser. I used Mark Hammond > sample code to create a new user from his book Python Programming on Win32. I > then added one line to add the newuser to a group. > def CreateUserAndShare(userName, fullName): > home

Re:What is \1 here?

2014-11-11 Thread Dave Angel
satishmlm...@gmail.com Wrote in message: > What does \1 do in the following piece of code(fourth line)? > import re > print(re.sub('[ABC]', '*', 'XAXAXBXBXCXC')) > print(re.sub('[ABC]_', '*', 'XA-XA_XB-XB_XC-XC_')) > print(re.sub('(.) spam', 'spam\\1', 'x spam, y spam')) > def mapper(matchobj): >

Re: Trouble with python

2014-11-11 Thread Ben Finney
Ashleigh Deal writes: > I am trying to use python as part of my part 3 project but my coding > has suddenly stopped working. I am using python(x,y) and it was > working perfectly a couple of weeks ago but recently it hasn't been. What has changed in the meantime, which could conceivably affect t

Re: What is \1 here?

2014-11-11 Thread Ned Batchelder
On 11/11/14 4:18 AM, satishmlm...@gmail.com wrote: What does \1 do in the following piece of code(fourth line)? import re print(re.sub('[ABC]', '*', 'XAXAXBXBXCXC')) print(re.sub('[ABC]_', '*', 'XA-XA_XB-XB_XC-XC_')) print(re.sub('(.) spam', 'spam\\1', 'x spam, y spam')) def mapper(matchobj):

Trouble with python

2014-11-11 Thread Ashleigh Deal
To whom it may concern, I am trying to use python as part of my part 3 project but my coding has suddenly stopped working. I am using python(x,y) and it was working perfectly a couple of weeks ago but recently it hasn't been. Every time it runs, the program crashes and becomes unresponsive res

FW: Trouble with Python

2014-11-11 Thread Ashleigh .
To whom it may concern, I am currently trying to run some code in python(x,y). It was working perfectly a couple of weeks ago but recently it hasn't been. Every time it runs, the program crashes and becomes unresponsive resulting in me having to exit. It has happened on multiple computers,

Re: What is \1 here?

2014-11-11 Thread Mark Lawrence
On 11/11/2014 09:18, satishmlm...@gmail.com wrote: What does \1 do in the following piece of code(fourth line)? import re print(re.sub('[ABC]', '*', 'XAXAXBXBXCXC')) print(re.sub('[ABC]_', '*', 'XA-XA_XB-XB_XC-XC_')) print(re.sub('(.) spam', 'spam\\1', 'x spam, y spam')) def mapper(matchobj):

What is ?s here?

2014-11-11 Thread satishmlmlml
What does ?s do in the following piece of code? import re, pprint text = open('books.xml').read() pattern = '(?s)isbn="(.*?)".*?(.*?)' found = re.findall(pattern, text) mapping = {isbn: title for (isbn, title) in found} pprint.pprint(mapping) Here is books.xml Python & XML

Re: "Natural" use of cmp= in sort

2014-11-11 Thread Paddy
On Tuesday, 11 November 2014 09:07:14 UTC, Ian wrote: > On Tue, Nov 11, 2014 at 12:44 AM, Paddy wrote: > > Thanks Ian. The original author states "...and it is sure that the given > > inputs will give an output, i.e., the inputs will always be valid.", which > > could be taken as meaning that a

What is \1 here?

2014-11-11 Thread satishmlmlml
What does \1 do in the following piece of code(fourth line)? import re print(re.sub('[ABC]', '*', 'XAXAXBXBXCXC')) print(re.sub('[ABC]_', '*', 'XA-XA_XB-XB_XC-XC_')) print(re.sub('(.) spam', 'spam\\1', 'x spam, y spam')) def mapper(matchobj): return 'spam' + matchobj.group(1) print(re.sub('(

Re: "Natural" use of cmp= in sort

2014-11-11 Thread Ian Kelly
On Tue, Nov 11, 2014 at 12:44 AM, Paddy wrote: > Thanks Ian. The original author states "...and it is sure that the given > inputs will give an output, i.e., the inputs will always be valid.", which > could be taken as meaning that all inputs are sufficient, well formed, and > contain all relat

Re: A syntax question

2014-11-11 Thread alister
On Mon, 10 Nov 2014 19:53:56 -0500, Dennis Lee Bieber wrote: > On Mon, 10 Nov 2014 14:56:11 GMT, alister > declaimed the following: > >>On Mon, 10 Nov 2014 14:54:55 +, alister wrote: >> >>> On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: >>> On 2014-11-10, David Palao wrote:

ANN: eGenix pyOpenSSL Distribution 0.13.6

2014-11-11 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.13.6 An easy-to-install and easy-to-use distribution of the pyOpenSSL Python interface for Op

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-11 Thread alister
On Mon, 10 Nov 2014 21:36:54 +, Denis McMahon wrote: > On Mon, 10 Nov 2014 10:56:18 -0800, sohcahtoa82 wrote: > >> ... I know software engineers make lots of money so I want to be one. > > I hear that pretty boy male escorts can make even more money than > software engineers. > > They also

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-11 Thread Chris Angelico
On Tue, Nov 11, 2014 at 10:21 AM, Clayton Kirkwood wrote: > Uh, how are you going to maintain a programming job if you don't know how to > program? I don't want to act but I know Brad Pitt makes lots of money doing > it, so I want to be Brad Pitt. Not! Not going to happen. Although I suspect > for

RE: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-11 Thread Clayton Kirkwood
>-Original Message- >From: Python-list [mailto:python-list- >bounces+crk=godblessthe...@python.org] On Behalf Of Grant Edwards >Sent: Monday, November 10, 2014 1:01 PM >To: python-list@python.org >Subject: Re: I don't read docs and don't know how to use Google. What >does the print functi

RE: Python script that does batch find and replace in txt files

2014-11-11 Thread Clayton Kirkwood
>-Original Message- >From: Python-list [mailto:python-list- >bounces+crk=godblessthe...@python.org] On Behalf Of Syed Khalid >Sent: Sunday, November 09, 2014 1:08 PM >To: python-list@python.org >Subject: Re: Python script that does batch find and replace in txt files > >My Script, > >I ha

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-11 Thread Manolo Martínez
On 11/10/14 at 09:00pm, Grant Edwards wrote: > That's the saddest troll I've seen in ages. That, on the other hand, is a pretty decent bit of trolling. -- https://mail.python.org/mailman/listinfo/python-list