Re: Understanding http proxies

2012-10-15 Thread Olive
Thank you for all yours answers. There are very usefull! Olive -- http://mail.python.org/mailman/listinfo/python-list

Python stand alone Android Apps:)

2012-10-15 Thread michaeldavid1234567
Hi, Cote here, and I'm very pleased to announce that I've ported ALL my sl4a apps to eclipse apk, it embeds with the python interpreter, no need to install anything but the app off google play! I have completed: A) Android Eye (Computer Vision), that takes a picture and tells you what it is

What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-15 Thread tinnews
I want to fix an error in some code I have installed, however I don't really want to just bodge it. The function producing the error is:- def get_text(self, idx): # override ! node = self.items[idx] a= [ , .join(node.tags), node.comment,

Re: What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-15 Thread Paul Rubin
tinn...@isbd.co.uk writes: I want to fix an error in some code I have installed, however I don't really want to just bodge it. ... Now its *probably* something higher up the tree causing the problem (it's only one particular image in 20 thousand or so that breaks things) but I really want to

Re: pyw program not displaying unicode characters properly

2012-10-15 Thread Roy Smith
In article mailman.2191.1350265325.27098.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: Classically, NNTP did not have attachments as seen in MIME email. NNTP (Network News Transport Protocol) and SMTP (Simple Mail Transfer Protocol) are both just ways of

Re: What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-15 Thread Chris Rebert
On Mon, Oct 15, 2012 at 4:23 AM, tinn...@isbd.co.uk wrote: I want to fix an error in some code I have installed, however I don't really want to just bodge it. bodge. Well, I learned a new word this morning! The function producing the error is:- def get_text(self, idx): #

Re: What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-15 Thread Roy Smith
In article 1b8tk9-un9@chris.zbmc.eu, tinn...@isbd.co.uk wrote: The function producing the error is:- def get_text(self, idx): # override ! node = self.items[idx] a= [ , .join(node.tags), node.comment,

simple string format question

2012-10-15 Thread Neal Becker
Is there a way to specify to format I want a floating point written with no more than e.g., 2 digits after the decimal? I tried {:.2f}, but then I get all floats written with 2 digits, even if they are 0: 2.35 yes, that's what I want 2.00 no, I want just 2 or 2. --

Re: simple string format question

2012-10-15 Thread Chris Rebert
On Mon, Oct 15, 2012 at 5:12 AM, Neal Becker ndbeck...@gmail.com wrote: Is there a way to specify to format I want a floating point written with no more than e.g., 2 digits after the decimal? I tried {:.2f}, but then I get all floats written with 2 digits, even if they are 0: 2.35 yes,

Re: simple string format question

2012-10-15 Thread Kamlesh Mutha
There doesn't seem to be any direct way to achieve this. Maybe you can do something like this: import math x = 3.05 if math.modf(x)[0] != 0.0: print x Cheers, -Kamlesh On Mon, Oct 15, 2012 at 5:59 PM, Chris Rebert c...@rebertia.com wrote: On Mon, Oct 15, 2012 at 5:12 AM, Neal Becker

Re: simple string format question

2012-10-15 Thread Adrien
Le 15/10/2012 14:12, Neal Becker a écrit : Is there a way to specify to format I want a floating point written with no more than e.g., 2 digits after the decimal? I tried {:.2f}, but then I get all floats written with 2 digits, even if they are 0: 2.35 yes, that's what I want 2.00 no, I want

Re: simple string format question

2012-10-15 Thread Dave Angel
On 10/15/2012 08:29 AM, Chris Rebert wrote: On Mon, Oct 15, 2012 at 5:12 AM, Neal Becker ndbeck...@gmail.com wrote: Is there a way to specify to format I want a floating point written with no more than e.g., 2 digits after the decimal? I tried {:.2f}, but then I get all floats written with

portable unicode literals

2012-10-15 Thread Ulrich Eckhardt
Hi! I need a little nudge in the right direction, as I'm misunderstanding something concerning string literals in Python 2 and 3. In Python 2.7, b'' and '' are byte strings, while u'' is a unicode literal. In Python 3.2, b'' is a byte string and '' is a unicode literal, while u'' is a syntax

Re: portable unicode literals

2012-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2012 15:05:01 +0200, Ulrich Eckhardt wrote: Hi! I need a little nudge in the right direction, as I'm misunderstanding something concerning string literals in Python 2 and 3. In Python 2.7, b'' and '' are byte strings, while u'' is a unicode literal. In Python 3.2, b'' is a

Re: portable unicode literals

2012-10-15 Thread Dave Angel
On 10/15/2012 09:05 AM, Ulrich Eckhardt wrote: Hi! I need a little nudge in the right direction, as I'm misunderstanding something concerning string literals in Python 2 and 3. In Python 2.7, b'' and '' are byte strings, while u'' is a unicode literal. In Python 3.2, b'' is a byte string and

Re: What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-15 Thread Miki Tebeka
I want to fix an error in some code I have installed, ... Apart from all the reasons why it's bad (see the Python Zen #10). One way to do it is: return [i or '' for i in a] -- http://mail.python.org/mailman/listinfo/python-list

RE: Fastest web framework

2012-10-15 Thread Andriy Kornatskyy
How fast python web frameworks reverse urls? While routing is a mapping of incoming request to a handler, url reverse function is designed to build urls for those handlers. A web page may have a number of urls from few dozen to hundreds... all related to your web site (e.g. links between

Re: portable unicode literals

2012-10-15 Thread Alex Strickland
On 2012/10/15 03:05 PM, Ulrich Eckhardt wrote: This actually came as a surprise to me, I assumed that using b'' I could portably create a byte string (which is true) and using u'' I could portably create a unicode string (which is not true). This feature would help porting code between both

MySQL with Python

2012-10-15 Thread রুদ্র ব্যাণার্জী
Dear friends, I am starting a project of creating a database using mySQL(my first project with database). I went to my institute library and find that, all books are managing mySQL with perl and php I am new to python itself and gradually loving it. I mostly use it as an alternative of

how to insert random error in a programming

2012-10-15 Thread Debashish Saha
how to insert random error in a programming? -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQL with Python

2012-10-15 Thread Anurag Chourasia
Yes you can. There are libraries available in python to make this happen. Read this for a starter http://dev.mysql.com/usingmysql/python/ Regards, Anurag On Oct 15, 2012 10:53 AM, রুদ্র ব্যাণার্জী bnrj.ru...@gmail.com wrote: Dear friends, I am starting a project of creating a database using

Re: MySQL with Python

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 12:45 AM, রুদ্র ব্যাণার্জী bnrj.ru...@gmail.com wrote: Dear friends, I am starting a project of creating a database using mySQL(my first project with database). I went to my institute library and find that, all books are managing mySQL with perl and php I am new to

Re: MySQL with Python

2012-10-15 Thread Demian Brecht
On 12-10-15 06:45 AM, রুদ্র ব্যাণার্জী wrote: if yes, can you kindly suggest a book/reference on this? There are a few different ways to connect to MySQL, two of which are: For reference on connecting and querying MySQL through mysql-python, take a read through

Re: how to insert random error in a programming

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha silid...@gmail.com wrote: how to insert random error in a programming? how to ask question good in forumming? http://www.catb.org/~esr/faqs/smart-questions.html But here's one way to do it: raise

Re: how to insert random error in a programming

2012-10-15 Thread Jean-Michel Pichavant
- Original Message - how to insert random error in a programming? -- http://mail.python.org/mailman/listinfo/python-list Here's an example from random raise Except(randome.randinteger(0,10,'error']): return -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Dave Angel
On 10/15/2012 09:55 AM, Debashish Saha wrote: how to insert random error in a programming? I don't see how this phrase makes any sense without a lot more context. If I add the words I'd like to know in front of the phrase, and session. at the end (and add the word a as appropriate), the best

Re: MySQL with Python

2012-10-15 Thread রুদ্র ব্যাণার্জী
On Tue, 2012-10-16 at 01:01 +1100, Chris Angelico wrote: But you may wish to consider using PostgreSQL instead. Thanks, as I am very much new in database thing, I am not very aware of the options I have. But in my library, I did not found any thing on PostgreSQL. Though, I will google its

Re: MySQL with Python

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 1:47 AM, রুদ্র ব্যাণার্জী bnrj.ru...@gmail.com wrote: On Tue, 2012-10-16 at 01:01 +1100, Chris Angelico wrote: But you may wish to consider using PostgreSQL instead. Thanks, as I am very much new in database thing, I am not very aware of the options I have. But in my

Re: MySQL with Python

2012-10-15 Thread Anurag Chourasia
Don't worry about what book you have (or don't have) in your Library..And let this not dictate your technology stack. PostgreSQL is one of the popular choice and you will never be short of documentation...Just Google and you will find lot of helpful tutorials... Regards, Anurag On Mon, Oct

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 14:55, Debashish Saha wrote: how to insert random error in a programming? Just use some of my code, it's far more random than that suggested by others who've replied to your query. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Neal Becker
Debashish Saha wrote: how to insert random error in a programming? Apparently, giving it to Microsoft will work. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-15 Thread Terry Reedy
On 10/15/2012 7:23 AM, tinn...@isbd.co.uk wrote: I want to fix an error in some code I have installed, however I don't really want to just bodge it. The function producing the error is:- def get_text(self, idx): # override ! node = self.items[idx] a= [

Exception Messages

2012-10-15 Thread Wanderer
How do you get Exceptions to print messages? I have an exception defined like this class PvCamError(Exception): def __init__(self, msg): self.msg = msg But when the error is raised I get this: Traceback (most recent call last): File

Re: how to insert random error in a programming

2012-10-15 Thread John Gordon
In mailman.2205.1350309347.27098.python-l...@python.org Debashish Saha silid...@gmail.com writes: how to insert random error in a programming? Open the program source file and replace the Nth character with a random character. -- John Gordon A is for Amy, who fell down the

Re: Exception Messages

2012-10-15 Thread MRAB
On 2012-10-15 17:00, Wanderer wrote: How do you get Exceptions to print messages? I have an exception defined like this class PvCamError(Exception): def __init__(self, msg): self.msg = msg But when the error is raised I get this: Traceback (most recent call last): File

Re: Exception Messages

2012-10-15 Thread John Gordon
In mailman.2217.1350317845.27098.python-l...@python.org MRAB pyt...@mrabarnett.plus.com writes: Why wasn't the message printed out? You didn't add a __str__ method: class PvCamError(Exception): def __init__(self, msg): self.msg = msg def __str__(self):

Re: Exception Messages

2012-10-15 Thread MRAB
On 2012-10-15 17:22, John Gordon wrote: In mailman.2217.1350317845.27098.python-l...@python.org MRAB pyt...@mrabarnett.plus.com writes: Why wasn't the message printed out? You didn't add a __str__ method: class PvCamError(Exception): def __init__(self, msg): self.msg = msg

Re: Exception Messages

2012-10-15 Thread Dave Angel
On 10/15/2012 12:34 PM, MRAB wrote: On 2012-10-15 17:22, John Gordon wrote: In mailman.2217.1350317845.27098.python-l...@python.org MRAB pyt...@mrabarnett.plus.com writes: Why wasn't the message printed out? You didn't add a __str__ method: class PvCamError(Exception): def

Re: how to insert random error in a programming

2012-10-15 Thread Jean-Michel Pichavant
- Original Message - [snip a huge list of advices example and insights] Then list the description on the homework assignment. -- DaveA Like the youngsters write: /bow JM -- http://mail.python.org/mailman/listinfo/python-list

Re: portable unicode literals

2012-10-15 Thread Serhiy Storchaka
On 15.10.12 16:05, Ulrich Eckhardt wrote: I need a little nudge in the right direction, as I'm misunderstanding something concerning string literals in Python 2 and 3. In Python 2.7, b'' and '' are byte strings, while u'' is a unicode literal. In Python 3.2, b'' is a byte string and '' is a

Re: Exception Messages

2012-10-15 Thread Wanderer
On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote: Yes, but you've put the message in msg, and Exception doesn't have that attribute. That's weird. I got this Exception class definition idea from this post by Guido van Rostrum, Where he gives this main function to look like

Re: how to insert random error in a programming

2012-10-15 Thread Serhiy Storchaka
On 15.10.12 17:04, Chris Angelico wrote: On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha silid...@gmail.com wrote: how to insert random error in a programming? how to ask question good in forumming? http://www.catb.org/~esr/faqs/smart-questions.html But here's one way to do it: raise

Re: Exception Messages

2012-10-15 Thread Wanderer
On Monday, October 15, 2012 1:18:52 PM UTC-4, Wanderer wrote: On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote: Yes, but you've put the message in msg, and Exception doesn't have that attribute. That's weird. I got this Exception class definition idea

Re: Feedback on my python framework I'm building.

2012-10-15 Thread Roel Schroeven
MRAB schreef: On 2012-10-14 23:38, Dave Angel wrote: On 10/14/2012 08:48 AM, Roy Smith wrote: In article 507a3365$0$6574$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Remember using PEEK and POKE commands with BASIC back in 1978? Pretty much

Re: Exception Messages

2012-10-15 Thread MRAB
On 2012-10-15 18:18, Wanderer wrote: On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote: Yes, but you've put the message in msg, and Exception doesn't have that attribute. That's weird. I got this Exception class definition idea from this post by Guido van Rostrum, Where he gives

Re: Exception Messages

2012-10-15 Thread Wanderer
On Monday, October 15, 2012 1:34:24 PM UTC-4, MRAB wrote: On 2012-10-15 18:18, Wanderer wrote: On Monday, October 15, 2012 12:34:53 PM UTC-4, MRAB wrote: Yes, but you've put the message in msg, and Exception doesn't have that attribute. That's weird. I got this

Re: how to insert random error in a programming

2012-10-15 Thread Gary Herron
On 10/15/2012 06:55 AM, Debashish Saha wrote: how to insert random error in a programming? Drink several beers before you start programming. :-) -- Dr. Gary Herron Department of Computer Science DigiPen Institute of Technology (425) 895-4418 --

Re: how to insert random error in a programming

2012-10-15 Thread Emile van Sebille
Debashish Saha wrote: how to insert random error in a programming? Make the changes late in the day then leave for the weekend? Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: how to insert random error in a programming

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 4:18 AM, Serhiy Storchaka storch...@gmail.com wrote: On 15.10.12 17:04, Chris Angelico wrote: On Tue, Oct 16, 2012 at 12:55 AM, Debashish Saha silid...@gmail.com wrote: how to insert random error in a programming? how to ask question good in forumming?

Re: how to insert random error in a programming

2012-10-15 Thread Joshua Landau
On 15 October 2012 14:55, Debashish Saha silid...@gmail.com wrote: how to insert random error in a programming? You could always just *write* the code with random errors from the start. Try random code, like this: from collections import defaultdict as ð def ire(ł, æ=[]): yield [ð(bool, {æ

Re: Exception Messages

2012-10-15 Thread Terry Reedy
On 10/15/2012 12:22 PM, John Gordon wrote: In mailman.2217.1350317845.27098.python-l...@python.org MRAB pyt...@mrabarnett.plus.com writes: Why wasn't the message printed out? You didn't add a __str__ method: class PvCamError(Exception): def __init__(self, msg): self.msg =

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 20:10, Joshua Landau wrote: On 15 October 2012 14:55, Debashish Saha silid...@gmail.com wrote: how to insert random error in a programming? You could always just *write* the code with random errors from the start. Try random code, like this: from collections import

Re: MySQL with Python

2012-10-15 Thread Roy Smith
In article mailman.2233.1350328857.27098.python-l...@python.org, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: For routine database /access/ (that is, someone has created the database user account that will be used), MySQLdb is the Python adapter to connect to the server. For using THAT, you

Re: how to insert random error in a programming

2012-10-15 Thread Chris Angelico
On Tue, Oct 16, 2012 at 6:28 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I like clearly written code like this d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print .join([d.get(c, c) for c in s]) Surely there's a shorter way to rot13 a

Re: how to insert random error in a programming

2012-10-15 Thread Mark Lawrence
On 15/10/2012 20:51, Chris Angelico wrote: On Tue, Oct 16, 2012 at 6:28 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I like clearly written code like this d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print .join([d.get(c, c) for c in s])

Re: how to insert random error in a programming

2012-10-15 Thread Victor Stinner
Try fuzzing. Examples: http://pypi.python.org/pypi/fusil/ http://peachfuzzer.com/ Victor -- http://mail.python.org/mailman/listinfo/python-list

numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread someone
See this: == In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5; 0 -0.5 1.5') In [6]: Dx Out[6]: matrix([[ 1. , 0. , 0. ], [ 0. , 0.5, -0.5], [ 0. , -0.5, 1.5]]) ==

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread Ian Kelly
On Oct 15, 2012 3:12 PM, someone newsbo...@gmail.com wrote: How to initialize my array directly using variables ? Why not just use the list-of-lists constructor instead of the string constructor? m = numpy.matrix([[1,2,3],[4,5,6],[7,8,test]]) --

Re: How to use while within the command in -c option of python?

2012-10-15 Thread Joshua Landau
On 13 October 2012 17:38, Joshua Landau joshua.landau...@gmail.com wrote: This here isn't a flaw in Python, though. It's a flaw in the command-line interpreter. By putting it all on one line, you are effectively saying: group these. Which is the same as an if True: block, and some things like

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread MRAB
On 2012-10-15 22:09, someone wrote: See this: == In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5; 0 -0.5 1.5') In [6]: Dx Out[6]: matrix([[ 1. , 0. , 0. ], [ 0. , 0.5, -0.5], [ 0. , -0.5, 1.5]])

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread Joshua Landau
On 15 October 2012 22:09, someone newsbo...@gmail.com wrote: See this: ==** In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5; 0 -0.5 1.5') In [6]: Dx Out[6]: matrix([[ 1. , 0. , 0. ], [ 0. , 0.5, -0.5], [ 0. , -0.5,

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread Emile van Sebille
someone wrote: How to initialize my array directly using variables ? It could also be that I wanted: test11 = 1 test12 = 1.5 test13 = 2 test21 = 0 test22 = 5 Dx = numpy.matrix('test11 test12 test13; test21 test22 -0.5; 0 -0.5 1.5') Etc... for many variables... Appreciate ANY help, thank you

RE: Tkinter how to access the widget by name

2012-10-15 Thread Prasad, Ramit
? wrote: I'm a little teapot ... himself the question: if I want to appeal to the widget, knowing his name... ? # appropriated the name of the widget label = Label(frame, width = 40, text='text', name = 'name') ... name_='name' configure(name_) ... def configure(name_)

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-15 Thread someone
On 10/15/2012 11:26 PM, MRAB wrote: On 2012-10-15 22:09, someone wrote: See this: == In [5]: Dx = numpy.matrix('1 0 0; 0 0.5 -0.5; 0 -0.5 1.5') In [6]: Dx Out[6]: matrix([[ 1. , 0. , 0. ], [ 0. , 0.5, -0.5], [ 0.

Re: how to insert random error in a programming

2012-10-15 Thread Joshua Landau
On 15 October 2012 20:51, Chris Angelico ros...@gmail.com wrote: On Tue, Oct 16, 2012 at 6:28 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I like clearly written code like this d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c)

Using pipe_controller to swap pipe components at runtime

2012-10-15 Thread vasudevram
I added a couple of methods / functions to my pipe_controller Python module, the Python tool to experiment with pipelined functions within a program. With these additions, it is now possible to swap the components of a pipe_controller 'pipe' programmatically, at runtime (*), and then run the

Re: how to insert random error in a programming

2012-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2012 19:25:38 +0530, Debashish Saha wrote: how to insert random error in a programming? While editing the source code, have your cat walk across the keyboard. I really think you need to explain your question better. -- Steven --

Re: Exception Messages

2012-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2012 09:00:15 -0700, Wanderer wrote: How do you get Exceptions to print messages? I have an exception defined like this class PvCamError(Exception): def __init__(self, msg): self.msg = msg Please don't invent yet another interface for exception messages.

Re: how to insert random error in a programming

2012-10-15 Thread alex23
On Oct 16, 5:52 am, Chris Angelico ros...@gmail.com wrote: Surely there's a shorter way to rot13 a piece of text? CODE GOLF! In Python2: a piece of string.encode('rot13') :) At very least, a single cryptic expression in place of your nice clear loops MUST be an improvement. d =

Re: Fastest web framework

2012-10-15 Thread alex23
On Oct 15, 11:40 pm, Andriy Kornatskyy andriy.kornats...@live.com wrote: Comments or suggestions are welcome. Performance speed is possibly the least interesting aspect of web frameworks; ease of use readily re-usable 3rd party code figures much higher, IMO. Rather than constantly hammer on

Re: how to insert random error in a programming

2012-10-15 Thread rusi
On Oct 15, 9:00 pm, John Gordon gor...@panix.com wrote: In mailman.2205.1350309347.27098.python-l...@python.org Debashish Saha silid...@gmail.com writes: how to insert random error in a programming? Open the program source file and replace the Nth character with a random character. I'm

Re: how to insert random error in a programming

2012-10-15 Thread Roy Smith
In article d391c7a4-41ab-4992-84cb-cacd1550d...@a4g2000pbc.googlegroups.com, rusi rustompm...@gmail.com wrote: On Oct 15, 9:00 pm, John Gordon gor...@panix.com wrote: In mailman.2205.1350309347.27098.python-l...@python.org Debashish Saha silid...@gmail.com writes: how to insert

easy_install says not a recognized archive type Windows Py3

2012-10-15 Thread Noah Coad
Hello, I'm new to Python, have v3.0 32bit installed on Windows 7, installed distribute, now trying to install pymysql and am getting the below error. Any pointers on how to fix? thanks!! -Noah [C:\Python32]pip install --upgrade distribute Real name of requirement distribute is distribute

Re: LinkedIn Python group discussions

2012-10-15 Thread Dwight Hutto
On Sun, Oct 14, 2012 at 7:42 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I've been sparked into raising the subject as this has just come up Does Jython/Python fall short of true POSIX thread parallelism?. I'm not qualified to comment and I recognise relatively few names amongst the

Is there a way to create kernel log messages via Python?

2012-10-15 Thread J
Hi... I have a bit of code that does the following: uses the syslog module to inject a LOG_INFO message into the syslog on my linux machine runs a suspend/resume cycle uses the syslog module to inkect a LOG_INFO message marking the end of test. Then I parse everything between the start and stop

Re: how to insert random error in a programming

2012-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2012 18:21:55 -0700, alex23 wrote: On Oct 16, 5:52 am, Chris Angelico ros...@gmail.com wrote: Surely there's a shorter way to rot13 a piece of text? CODE GOLF! In Python2: a piece of string.encode('rot13') :) And in Python 3, unfortunately there has been a right-royal mess

Re: OT Questions

2012-10-15 Thread Dwight Hutto
On Tue, Oct 16, 2012 at 12:05 AM, Dwight Hutto dwightdhu...@gmail.com wrote: Like a lot of people here, I'm trying to build a web development business. I'm starting off by building a profile on a freelance site. I would like some honest opinions(don't be too harsh, or you can be, that's what

Re: Which book is the best?

2012-10-15 Thread Dwight Hutto
On Tue, Oct 16, 2012 at 12:27 AM, 老爷 yujian4newsgr...@gmail.com wrote: I have strong c++ development experience. But now I want to study the python to do some windows setting task, such as editing file, changing the system setting, doing some network processing. Please help me which book is

Re: delete xml elements - using xpath search

2012-10-15 Thread Stefan Behnel
Tharanga Abeyseela, 16.10.2012 05:57: i need to delete the following pattern and its parent node from my xml file (IF THE SEARCH STRING FOUND) RatingNC/Rating if i find the above particular string , i need to delete the XML elements (parent of the Rating element. problem is i have

[issue15936] Add link from os.urandom to random.SystemRandom

2012-10-15 Thread Bryce Verdier
Bryce Verdier added the comment: Ramchandra, doesn't the description of os.urandom already imply that it's a low-level interface? Or are you saying that you want this to be explicitly stated? I would also like to work on this bug -- nosy: +louiscipher

[issue13454] crash when deleting one pair from tee()

2012-10-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file27568/itertools_tee_nonrecursive_clear.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___

[issue13454] crash when deleting one pair from tee()

2012-10-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file27578/itertools_tee_nonrecursive_clear.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___

[issue11009] urllib.splituser is not documented

2012-10-15 Thread anatoly techtonik
anatoly techtonik added the comment: Why not to follow the convention and add underscore _ to the names to remove the ambiguity and future reports and confusion about that thees functions are not documented? -- status: closed - pending ___ Python

[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The attached patch adds support for '\\' escaping to fnmatch, and consequently to glob. This is a backward incompatible change. For example glob.glob(r'C:\Program Files\*') will be broken. As flacs says a way to escape metacharacters in glob/fnmatch

[issue16211] MacInstalls break PyDev

2012-10-15 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm closing this as invalid as the python sources for the stdlib are installed by the python.org installer, and this is probably a problem with PyDev. It is lame that Apple doesn't install the python sources anymore, but there is nothing we can do about

[issue14329] proxy_bypass_macosx_sysconf does not handle singel ip addresses correctly

2012-10-15 Thread Ronald Oussoren
Changes by Ronald Oussoren ronaldousso...@mac.com: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14329 ___ ___

[issue16229] Module *redemo.py* lacking in recent Python distributions

2012-10-15 Thread Francisco Gracia
Francisco Gracia added the comment: You are right. I am referring to the Windows installer. I forgot to mention that I am using Windows XP. Thank you. 2012/10/14 Ned Deily rep...@bugs.python.org Ned Deily added the comment: The demo scripts in the Tools directory were cleaned up earlier

[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which add fnmatch.escape() function. -- Added file: http://bugs.python.org/file27579/fnmatch_escape.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8402

[issue16220] wsgiref does not call close() on iterable response

2012-10-15 Thread Graham Dumpleton
Graham Dumpleton added the comment: That's right, the Django bug report I filed was actually for Django 1.3, which didn't use wsgiref. I wasn't using Django 1.4 at the time so didn't bother to check its new implementation based on wsgiref. Instead I just assumed wsgiref would be right.

[issue16200] Setting .posix=True for shlex object causes infinite loop in __next__

2012-10-15 Thread Ezio Melotti
Ezio Melotti added the comment: Making .posix read-only is technically backward-incompatible, but I'm not sure if there are cases where people might have changed its value without incurring in the bug. Leaving .posix read/writable and changing .eof accordingly might be a better solution. As

[issue10836] TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread anatoly techtonik
anatoly techtonik added the comment: Looks like a regression - I can't remember such messages in Python 2. -- nosy: +techtonik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10836 ___

[issue5256] rlcompleter adds builtins when custom dict is used

2012-10-15 Thread Ezio Melotti
Ezio Melotti added the comment: I would make the argument keyword-only. Changing the logic to avoid eval() might be OK, but IIUC is not related to this issue, and it should be done separately. The markup in the doc could be better (`...` should be ``...`` or a more specific directive that

[issue16106] antigravity tests

2012-10-15 Thread Ezio Melotti
Ezio Melotti added the comment: The test could be made CPython-specific, but if you think it's not necessary I'll just close the issue. The main reason I wrote this was to experiment a bit with unittest.mock :) -- resolution: - rejected stage: patch review - committed/rejected

[issue16222] some terms not found by devguide's search box

2012-10-15 Thread Ezio Melotti
Ezio Melotti added the comment: See also #15871. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16222 ___ ___ Python-bugs-list mailing list

[issue8402] Add a way to escape metacharacters in glob/fnmatch

2012-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure if escape() should support bytes. translate() doesn't. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8402 ___

[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread anatoly techtonik
anatoly techtonik added the comment: Clearly regressing. In Python 2 it was IOError exception: import urllib urllib.urlretrieve('missing') Traceback (most recent call last): File stdin, line 1, in module File C:\pp\lib\urllib.py, line 93, in urlretrieve return _urlopener.retrieve(url,

[issue13538] Improve doc for str(bytesobject)

2012-10-15 Thread Ezio Melotti
Ezio Melotti added the comment: Instead of documenting what *encoding* and *errors* do, I would just say that str(bytesobj, encoding, errors) is equivalent to bytesobj.decode(encoding, errors) (assuming it really is). I don't like encodings/decodings done via the str/bytes constructors, and

[issue16238] Automatically remove build directory when build options changed

2012-10-15 Thread anatoly techtonik
New submission from anatoly techtonik: After build options in setup.py is edited, command `python setup.py install` doesn't remove build directory and uses its cached content. This behavior is non-obvious and leads to errors. The proposal is to calculate hash from build configuration, save it

[issue10060] python.exe crashes or hangs on help() modules when bad modules found

2012-10-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10060 ___

[issue10836] regression: TypeError during exception handling in urllib.request.urlretrieve

2012-10-15 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc amaur...@gmail.com: -- keywords: +easy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10836 ___ ___

  1   2   >