Updated Cygwin Package (experimental): python-2.7.3-1

2012-12-19 Thread Jason Tishler
*** Attention Cygwin Python module package maintainers *** *** Cygwin is migrating from Python 2.6 to 2.7... *** New News: === I have released Cygwin Python 2.7.3-1 as experimental. The tarballs should be available on a Cygwin mirror near you shortly. The main purpose of this release

Pattern-match Replace - help required

2012-12-19 Thread AT
Hi, I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. I've this string (basically an sql statement): stmnt = 'SELECT taxpayer.id, taxpayer.enc_name, taxpayer.age, taxpayer.occupation

counting how often the same word appears in a txt file...But my code only prints the last line entry in the txt file

2012-12-19 Thread dgcosgrave
Hi Iam just starting out with python...My code below changes the txt file into a list and add them to an empty dictionary and print how often the word occurs, but it only seems to recognise and print the last entry of the txt file. Any help would be great. tm =open('ask.txt', 'r') dict = {}

Re: Pattern-match Replace - help required

2012-12-19 Thread Steven D'Aprano
On Wed, 19 Dec 2012 02:42:26 -0800, AT wrote: Hi, I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. I've this string (basically an sql statement): stmnt = 'SELECT taxpayer.id, taxpayer.enc_name,

Re: counting how often the same word appears in a txt file...But my code only prints the last line entry in the txt file

2012-12-19 Thread Jussi Piitulainen
dgcosgr...@gmail.com writes: Hi Iam just starting out with python...My code below changes the txt file into a list and add them to an empty dictionary and print how often the word occurs, but it only seems to recognise and print the last entry of the txt file. Any help would be great. tm

Re: counting how often the same word appears in a txt file...But my code only prints the last line entry in the txt file

2012-12-19 Thread Steven D'Aprano
On Wed, 19 Dec 2012 02:45:13 -0800, dgcosgrave wrote: Hi Iam just starting out with python...My code below changes the txt file into a list and add them to an empty dictionary and print how often the word occurs, but it only seems to recognise and print the last entry of the txt file. Any

Re: Pattern-match Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 15:51:22 UTC+5, Steven D'Aprano wrote: On Wed, 19 Dec 2012 02:42:26 -0800, AT wrote: Hi, I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. I've this string

Re: Pattern-match Replace - help required

2012-12-19 Thread Steven D'Aprano
On Wed, 19 Dec 2012 03:01:32 -0800, AT wrote: I just wanted to change taxpayer.enc_name in stmnt to decrypt(taxpayer.enc_name) hope it clarifies? Maybe. Does this help? lunch = Bread, ham, cheese and tomato. # replace ham with spam offset = lunch.find('ham') if offset != -1: lunch =

Re: counting how often the same word appears in a txt file...But my code only prints the last line entry in the txt file

2012-12-19 Thread Thomas Bach
Hi, just as a side-note On Wed, Dec 19, 2012 at 02:45:13AM -0800, dgcosgr...@gmail.com wrote: for word in list: if word in dict: count = dict[word] count += 1 dict[word] = count else: dict[word] = 1

Re: Pattern-match Replace - help required

2012-12-19 Thread Thomas Bach
On Wed, Dec 19, 2012 at 02:42:26AM -0800, AT wrote: Hi, I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. Well, what about str.replace then? 'egg, ham, tomato'.replace('ham', 'spam, ham, spam') 'egg, spam, ham, spam,

Re: counting how often the same word appears in a txt file...But my code only prints the last line entry in the txt file

2012-12-19 Thread dgcosgrave
On Wednesday, December 19, 2012 11:55:28 PM UTC+13, Jussi Piitulainen wrote: Hi Iam just starting out with python...My code below changes the txt file into a list and add them to an empty dictionary and print how often the word occurs, but it only seems to recognise and print the

Re: counting how often the same word appears in a txt file...But my code only prints the last line entry in the txt file

2012-12-19 Thread dgcosgrave
On Thursday, December 20, 2012 12:03:21 AM UTC+13, Steven D'Aprano wrote: On Wed, 19 Dec 2012 02:45:13 -0800, dgcosgrave wrote: Hi Iam just starting out with python...My code below changes the txt file into a list and add them to an empty dictionary and print how often the word

Re: counting how often the same word appears in a txt file...But my code only prints the last line entry in the txt file

2012-12-19 Thread dgcosgrave
On Thursday, December 20, 2012 12:21:57 AM UTC+13, Thomas Bach wrote: Hi, just as a side-note On Wed, Dec 19, 2012 at 02:45:13AM -0800, : for word in list: if word in dict: count = dict[word] count += 1

YOU CAN EARN $200 Day.

2012-12-19 Thread freejobonline1
PART TIME JOBS You can join get free for $10 http://www.profitclicking.com/?r=J6pLs7V4sU Simple Work,No Experience Necessary, Excellent Rates of Pay,STEP by STEP INTRODUTION, http://www.profitclicking.com/?r=J6pLs7V4sU -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern-match Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 16:27:19 UTC+5, Thomas Bach wrote: On Wed, Dec 19, 2012 at 02:42:26AM -0800, AT wrote: Hi, I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. Well, what about

calculation on lists

2012-12-19 Thread loïc Lauréote
hi, I have a question, is there a tool to calculate on list ? something like : a= [1,1,1,1] b = [5,9,8,4] c = a+b*a print c [6,10,9,5] Thx -- http://mail.python.org/mailman/listinfo/python-list

Re: calculation on lists

2012-12-19 Thread Vlastimil Brom
2012/12/19 loïc Lauréote laureote-l...@hotmail.fr: hi, I have a question, is there a tool to calculate on list ? something like : a= [1,1,1,1] b = [5,9,8,4] c = a+b*a print c [6,10,9,5] Thx == Hi, for such simpler cases, you may try list comprehensions and probably the zip(...) function

Re: Pattern-match Replace - help required

2012-12-19 Thread Peter Otten
AT wrote: I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. I've this string (basically an sql statement): stmnt = 'SELECT taxpayer.id, taxpayer.enc_name, taxpayer.age, taxpayer.occupation

Re: Why Doesn't This MySQL Statement Execute?

2012-12-19 Thread Alister
On Tue, 18 Dec 2012 17:34:08 -0400, Tom Borkin wrote: Hi; I have this test code: if i_id == 1186: sql = 'insert into interactions values(Null, %s, Call Back,% s)' % (i_id, date_plus_2) cursor.execute(sql) Please don't build your sql strings like this but pass the data as

Re: Pattern-match Replace - help required

2012-12-19 Thread AT
On Wednesday, 19 December 2012 18:16:18 UTC+5, Peter Otten wrote: AT wrote: I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text. I've this string (basically an sql statement): stmnt = 'SELECT

[newbie] plotting pairs of data

2012-12-19 Thread hugocoolens
I have a data set for which x and y-values are presented as pairs of floating point numbers: e.g. 0.0364771 0.55569 is the first pair . 0.132688 0.808496 is the second pair . . The data is available in Python in this format: ['0.0364771 0.55569', '0.132688 0.808496', '0.232877 0.832833',

Re: Pattern-match Replace - help required

2012-12-19 Thread Alexander Blinne
Am 19.12.2012 14:41, schrieb AT: Thanks a million Can you recommend a good online book/tutorial on regular expr. in python? http://docs.python.org/3/howto/regex.html -- http://mail.python.org/mailman/listinfo/python-list

Virtualenv loses context

2012-12-19 Thread rhythmicdevil
I am somewhat new to Python and virtualenv. I have setup a virtualenv with no site packages under the assumption that all 3rd party packages will be installed into the site-packages directory for the virtualenv. Another assumption I have about virtualenv is that it's completely self contained.

Fuzzy Logic Library for Python 3

2012-12-19 Thread Alexsandro Soares
Hi all, I'm trying to build an fuzzy expert system in Python 3 and I need a good recommendation for a library/package for this, but working in Python 3.2. Some options are pyfuzzy and pyfuzzylib, but I was not succeed to install these packages with Python 3. Thanks in advance for any

Re: Pattern-match Replace - help required

2012-12-19 Thread MRAB
On 2012-12-19 14:11, Alexander Blinne wrote: Am 19.12.2012 14:41, schrieb AT: Thanks a million Can you recommend a good online book/tutorial on regular expr. in python? http://docs.python.org/3/howto/regex.html Another good resource is: http://www.regular-expressions.info/ --

Py 3.3, unicode / upper()

2012-12-19 Thread wxjmfauth
I was using the German word Straße (Strasse) — German translation from street — to illustrate the catastrophic and completely wrong-by-design Unicode handling in Py3.3, this time from a memory point of view (not speed): sys.getsizeof('Straße') 43 sys.getsizeof('STRAẞE') 50 instead of a sane

Re: Virtualenv loses context

2012-12-19 Thread rhythmicdevil
This may have something to do with it. I create the virtualenv in: /home/swright/workspace/botnet_etl/ After I install my app the directory structure looks like this: (botnet_etl)[swright@localhost botnet_etl]$ ll total 32 drwxrwxr-x 4 swright swright 4096 Dec 19 09:21 app drwxrwxr-x 3 swright

Re: Virtualenv loses context

2012-12-19 Thread rhythmicdevil
I wrote this little test script to prove my virtualenv is reading from global site packages: Script Content from distutils.sysconfig import get_python_lib print (get_python_lib()) Script Output (botnet_etl)[swright@localhost app]$ python test.py /usr/lib/python2.6/site-packages

Telnetlib and special quit characters with Ctrl, oh my!

2012-12-19 Thread winona_whitener
Greetings all, I am using telnetlib and the box that I'm connecting to has a special escape sequence--^]--to leave the prompt and go back to the regular telnet prompt. For example, from teh command line I do this: telnet 123.12.123.0 Login: xx Password: xxx Welcome. Connected to

Re: Virtualenv loses context

2012-12-19 Thread rhythmicdevil
This may have something to do with it. I create the virtualenv in: /home/swright/workspace/botnet_etl/ After I install my app the directory structure looks like this: (botnet_etl)[swright@localhost botnet_etl]$ ll total 32 drwxrwxr-x 4 swright swright 4096 Dec 19 09:21 app drwxrwxr-x 3

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Thomas Bach
On Wed, Dec 19, 2012 at 06:23:00AM -0800, wxjmfa...@gmail.com wrote: I was suprised to discover this: 'Straße'.upper() 'STRASSE' I really, really do not know what I should think about that. (It is a complex subject.) And the real question is why? Because there is no definition for

Re: [newbie] plotting pairs of data

2012-12-19 Thread Thomas Bach
On Wed, Dec 19, 2012 at 05:47:30AM -0800, hugocoolens wrote: The data is available in Python in this format: ['0.0364771 0.55569', '0.132688 0.808496', '0.232877 0.832833', '0.332702 0.849128', '0.432695 0.862158'] I suppose it is possible to plot x versus y using matplotlib, maybe

Re: Virtualenv loses context

2012-12-19 Thread rhythmicdevil
Just installed a brand new virtualenv along with two packages. Ran this and I got nothing: (venvtest)[swright@localhost venvtest]$ python -m site (venvtest)[swright@localhost venvtest]$ I expected to have at least one path in sys.path [swright@localhost workspace]$ virtualenv

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Christian Heimes
Am 19.12.2012 15:23, schrieb wxjmfa...@gmail.com: But, this is not the problem. I was suprised to discover this: 'Straße'.upper() 'STRASSE' I really, really do not know what I should think about that. (It is a complex subject.) And the real question is why? It's correct. LATIN SMALL

Re: Telnetlib and special quit characters with Ctrl, oh my!

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 1:28 AM, winona_white...@yahoo.com wrote: I am using telnetlib and the box that I'm connecting to has a special escape sequence--^]--to leave the prompt and go back to the regular telnet prompt. For example, from teh command line I do this: ... When I pressing and

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Stefan Krah
wxjmfa...@gmail.com wxjmfa...@gmail.com wrote: But, this is not the problem. I was suprised to discover this: 'Straße'.upper() 'STRASSE' I really, really do not know what I should think about that. (It is a complex subject.) And the real question is why?

Re: Virtualenv loses context

2012-12-19 Thread rhythmicdevil
So I reinstalled the virtualenv for my project from scratch. Application runs as expected. Here are the notes that I took while installing. Interestingly the command 'python -m site' produces no output now. Notice that before I reinstalled the virtualenv I got a bunch of paths from that

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 1:23 AM, wxjmfa...@gmail.com wrote: But, this is not the problem. I was suprised to discover this: 'Straße'.upper() 'STRASSE' I really, really do not know what I should think about that. (It is a complex subject.) And the real question is why? Not all strings can

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Johannes Bauer
On 19.12.2012 15:23, wxjmfa...@gmail.com wrote: I was using the German word Straße (Strasse) — German translation from street — to illustrate the catastrophic and completely wrong-by-design Unicode handling in Py3.3, this time from a memory point of view (not speed):

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Johannes Bauer
On 19.12.2012 16:18, Johannes Bauer wrote: How do those arbitrary numbers prove anything at all? Why do you draw the conclusion that it's broken by design? What do you expect? You're very vague here. Just to show how ridiculously pointless your numers are, your example gives 84 on Python3.2

calculation on lists

2012-12-19 Thread loïc Lauréote
Thank for your answer, I found something allowing to avoid loops. I use operator overloading. import math class Vector: def __init__(self, x=0, y=0): self.x=x self.y=y def __eq__(self, vB): return (self.x==vB.x) and (self.y==vB.y) def __add__(self, vB):

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Christian Heimes
Am 19.12.2012 16:01, schrieb Stefan Krah: The uppercase ß isn't really needed, since ß does not occur at the beginning of a word. As far as I know, most Germans wouldn't even know that it has existed at some point or how to write it. I think Python 3.3+ is using uppercase mapping (uc) instead

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 2:18 AM, Johannes Bauer dfnsonfsdu...@gmx.de wrote: On 19.12.2012 15:23, wxjmfa...@gmail.com wrote: I was using the German word Straße (Strasse) — German translation from street — to illustrate the catastrophic and completely wrong-by-design Unicode handling in Py3.3,

context aware execution

2012-12-19 Thread Bart Thate
Hi All ! Is is possible and if yes, is it more easily possible (i am thinking f_back maybe) to get the context of the caller when in a function ? Like to which variable name is this object assigned ? Or whatever of the callers context that might be of interest. I want in a function or method

Re: context aware execution

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 2:57 AM, Bart Thate feedbackf...@gmail.com wrote: Hi All ! Is is possible and if yes, is it more easily possible (i am thinking f_back maybe) to get the context of the caller when in a function ? Like to which variable name is this object assigned ? Or whatever of

Re: [newbie] plotting pairs of data

2012-12-19 Thread Miki Tebeka
On Wednesday, December 19, 2012 6:38:30 AM UTC-8, Thomas Bach wrote: On Wed, Dec 19, 2012 at 05:47:30AM -0800, hugocoolens wrote: ['0.0364771 0.55569', '0.132688 0.808496', '0.232877 0.832833', '0.332702 0.849128', '0.432695 0.862158'] xs = [ float(x) for x, _ in map(str.split, l) ] ys = [

Re: context aware execution

2012-12-19 Thread Wayne Werner
On Thu, 20 Dec 2012, Chris Angelico wrote: On Thu, Dec 20, 2012 at 2:57 AM, Bart Thate feedbackf...@gmail.com wrote: I want in a function or method determine the context of my caller and adapt the functionality accordingly. First off, please don't! Your code will be *extremely* confusing.

Problem with Threads

2012-12-19 Thread Kwnstantinos Euaggelidis
I have this code for Prime Numbers and i want to do it with Threads.. Any idea.?? # prime numbers are only divisible by unity and themselves # (1 is not considered a prime number by convention) import time def isprime(n): if n == 2: return 1 if n % 2 == 0: return 0

Re: context aware execution

2012-12-19 Thread Bart Thate
Thanks for your response Chris ! Ha ! the job of the mad man is todo the things the are not advisable and see what gives. Like why it is not advisable and, if possible, their are ways to achieve things that are previously overseen. i already do a lot of travelling of the callstack to see from

Re: calculation on lists

2012-12-19 Thread Vlastimil Brom
2012/12/19 loïc Lauréote laureote-l...@hotmail.fr: hi, I have a question, is there a tool to calculate on list ? something like : a= [1,1,1,1] b = [5,9,8,4] c = a+b*a print c [6,10,9,5] Thx -- http://mail.python.org/mailman/listinfo/python-list Hi, I guess, if you are interested in

Brython - Python in the browser

2012-12-19 Thread Pierre Quentel
Hi, The objective of Brython is to replace Javascript by Python as the scripting language for web browsers, making it usable on all terminals including smartphones, tablets, connected TVs, etc. Please forgive the lack of ambition ;-) The best introduction is to visit the Brython site

Re: calculation on lists

2012-12-19 Thread Tim Chase
On 12/19/12 09:24, loïc Lauréote wrote: is there a tool to calculate on list ? something like : a= [1,1,1,1] b = [5,9,8,4] c = a+b*a print c [6,10,9,5] Thx == Hi, for such simpler cases, you may try list comprehensions and probably the zip(...) function [a+b*a for a,b in

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Ian Kelly
On Wed, Dec 19, 2012 at 8:40 AM, Chris Angelico ros...@gmail.com wrote: You may not be familiar with jmf. He's one of our resident trolls, and he has a bee in his bonnet about PEP 393 strings, on the basis that they take up more space in memory than a narrow build of Python 3.2 would, for a

Re: Problem with Threads

2012-12-19 Thread Dave Angel
On 12/19/2012 12:11 PM, Kwnstantinos Euaggelidis wrote: I have this code for Prime Numbers and i want to do it with Threads.. Any idea.?? Why do you want to do it with threads? Is it to speed up the processing? (Guessing that partly because of your printing elapsed time. Chances are running

Re: Problem with Threads

2012-12-19 Thread Hans Mulder
On 19/12/12 18:11:37, Kwnstantinos Euaggelidis wrote: I have this code for Prime Numbers and i want to do it with Threads.. Any idea.?? Why would you want to do that? It's not going to be any faster, since your code is CPU-bound. You may have several CPUs, but CPython is going to use only one

Re: Virtualenv loses context

2012-12-19 Thread Hans Mulder
On 19/12/12 15:38:01, rhythmicde...@gmail.com wrote: Just installed a brand new virtualenv along with two packages. Ran this and I got nothing: (venvtest)[swright@localhost venvtest]$ python -m site (venvtest)[swright@localhost venvtest]$ I expected to have at least one path in sys.path

Re: Virtualenv loses context

2012-12-19 Thread rhythmicdevil
Thanks for the information Hans, I will double check that stuff. I am positive however that the environment was active. In addition that fact that I get different responses from python -m site from the botnet_etl virtual environment before I blew it away and after I rebuilt it really concerns

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Benjamin Peterson
wxjmfauth at gmail.com writes: I really, really do not know what I should think about that. (It is a complex subject.) And the real question is why? Because that's what the Unicode spec says to do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy Logic Library for Python 3

2012-12-19 Thread Grant Rettke
I also pondered this, though not intensely or urgently. I felt like Jython and Jess with FuzzyJess might be interesting http://www.jessrules.com/FAQ.shtml#Q13 though I didn't dig any further. On Wed, Dec 19, 2012 at 8:22 AM, Alexsandro Soares prof.asoa...@gmail.com wrote: Hi all, I'm

Re: plotting pairs of data

2012-12-19 Thread hugocoolens
On 19 dec, 15:38, Thomas Bach thb...@students.uni-mainz.de wrote: On Wed, Dec 19, 2012 at 05:47:30AM -0800,hugocoolenswrote: The data is available in Python in this format: ['0.0364771 0.55569', '0.132688 0.808496', '0.232877 0.832833', '0.332702 0.849128', '0.432695 0.862158'] I suppose

Re: Py 3.3, unicode / upper()

2012-12-19 Thread wxjmfauth
Le mercredi 19 décembre 2012 15:52:23 UTC+1, Christian Heimes a écrit : Am 19.12.2012 15:23, schrieb wxjmfa...@gmail.com: But, this is not the problem. I was suprised to discover this: 'Straße'.upper() 'STRASSE' I really, really do not know what I should think about

Re: Py 3.3, unicode / upper()

2012-12-19 Thread wxjmfauth
Le mercredi 19 décembre 2012 19:27:38 UTC+1, Ian a écrit : On Wed, Dec 19, 2012 at 8:40 AM, Chris Angelico ros...@gmail.com wrote: You may not be familiar with jmf. He's one of our resident trolls, and he has a bee in his bonnet about PEP 393 strings, on the basis that they take up

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Ian Kelly
On Wed, Dec 19, 2012 at 1:55 PM, wxjmfa...@gmail.com wrote: Yes, it is correct (or can be considered as correct). I do not wish to discuss the typographical problematic of Das Grosse Eszett. The web is full of pages on the subject. However, I never succeeded to find an official position from

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Ian Kelly
On Wed, Dec 19, 2012 at 2:18 PM, wxjmfa...@gmail.com wrote: latin-1 (iso-8859-1) ? are you sure ? Yes. sys.getsizeof('a') 26 sys.getsizeof('ab') 27 sys.getsizeof('aé') 39 Compare to: sys.getsizeof('a\u0100') 42 The reason for the difference you posted is that pure ASCII strings have

Why does os.stat() tell me that my file-group has no members?

2012-12-19 Thread saqib . ali . 75
I'm using python 2.6.4 on Solaris 5-10. I have a file named myFile. It is owned by someone else, by I (myuser) am in the file's group (mygrp). Below is my python code. Why does it tell me that mygrp has no members??? import os, pwd, grp stat_info = os.stat(myFile) fileUID =

Re: calculation on lists

2012-12-19 Thread Chris Kaynor
Chris On Wed, Dec 19, 2012 at 7:24 AM, loïc Lauréote laureote-l...@hotmail.frwrote: Thank for your answer, I found something allowing to avoid loops. I use operator overloading. import math class Vector: def __init__(self, x=0, y=0): self.x=x self.y=y def

Re: Brython - Python in the browser

2012-12-19 Thread jkn
Hi Pierre this looks very interesting, thanks. But I wonder ... do you know of pyjs (pyjamas as-was)? http://pyjs.org/ I would be interested in a comparison between (the aims of) Brython and pyjs. Either way, thanks for the info. Regards Jon N --

Re: Why does os.stat() tell me that my file-group has no members?

2012-12-19 Thread Hans Mulder
On 19/12/12 22:40:00, saqib.ali...@gmail.com wrote: I'm using python 2.6.4 on Solaris 5-10. I have a file named myFile. It is owned by someone else, by I (myuser) am in the file's group (mygrp). Below is my python code. Why does it tell me that mygrp has no members??? import os,

Re: Brython - Python in the browser

2012-12-19 Thread Terry Reedy
On 12/19/2012 1:19 PM, Pierre Quentel wrote: The objective of Brython is to replace Javascript by Python as the scripting language for web browsers, making it usable on all terminals including smartphones, tablets, connected TVs, etc. Please forgive the lack of ambition ;-) This sounds

Re: calculation on lists

2012-12-19 Thread Chris Kaynor
On Wed, Dec 19, 2012 at 4:38 AM, Vlastimil Brom vlastimil.b...@gmail.comwrote: 2012/12/19 loïc Lauréote laureote-l...@hotmail.fr: hi, I have a question, is there a tool to calculate on list ? something like : a= [1,1,1,1] b = [5,9,8,4] c = a+b*a print c [6,10,9,5] Thx ==

Re: Fuzzy Logic Library for Python 3

2012-12-19 Thread Terry Reedy
On 12/19/2012 9:22 AM, Alexsandro Soares wrote: Hi all, I'm trying to build an fuzzy expert system in Python 3 and I need a good recommendation for a library/package for this, but working in Python 3.2. Some options are pyfuzzy and pyfuzzylib, Please tell the authors that you would like

Re: context aware execution

2012-12-19 Thread Michael Torrie
On 12/19/2012 09:51 AM, Bart Thate wrote: Think of sending JSON over the wire, reconstruct an object with it and then let the object figure out what it can and cannot do in this external environment. Probably the better way to do it is to formally define an API that lets an object discover

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Terry Reedy
On 12/19/2012 10:40 AM, Chris Angelico wrote: Interestingly, IDLE on my Windows box can't handle the bolded characters very well... s=\U0001d407\U0001d41e\U0001d425\U0001d425\U0001d428, \U0001d430\U0001d428\U0001d42b\U0001d425\U0001d41d! print(s) Traceback (most recent call last): File

Re: Brython - Python in the browser

2012-12-19 Thread Ian Kelly
On Wed, Dec 19, 2012 at 5:07 PM, Terry Reedy tjre...@udel.edu wrote: That says that my browser, Firefox 17, does not support HTML5. Golly gee. I don't think any browser support5 all of that moving target, and Gecko apparently supports about as large a subset as most.

Re: Why does os.stat() tell me that my file-group has no members?

2012-12-19 Thread saqib . ali . 75
Thanks!! This was very helpful. It worked perfectly. I had no clue about the intricacies of how python represents the group data from the underlying OS. This page doesn't go into to detailed explanation like you did: http://docs.python.org/2/library/grp.html On Wednesday, December 19, 2012

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 8:23 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Dec 19, 2012 at 1:55 PM, wxjmfa...@gmail.com wrote: Yes, it is correct (or can be considered as correct). I do not wish to discuss the typographical problematic of Das Grosse Eszett. The web is full of pages on

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 5:27 AM, Ian Kelly ian.g.ke...@gmail.com wrote: From what I've been able to discern, [jmf's] actual complaint about PEP 393 stems from misguided moral concerns. With PEP-393, strings that can be fully represented in Latin-1 can be stored in half the space (ignoring

Re: Why does os.stat() tell me that my file-group has no members?

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 12:23 PM, saqib.ali...@gmail.com wrote: Thanks!! This was very helpful. It worked perfectly. I had no clue about the intricacies of how python represents the group data from the underlying OS. This page doesn't go into to detailed explanation like you did:

Re: Brython - Python in the browser

2012-12-19 Thread Terry Reedy
On 12/19/2012 7:54 PM, Ian Kelly wrote: On Wed, Dec 19, 2012 at 5:07 PM, Terry Reedy tjre...@udel.edu wrote: That says that my browser, Firefox 17, does not support HTML5. Golly gee. I don't think any browser support5 all of that moving target, and Gecko apparently supports about as large a

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Westley Martínez
On Wed, Dec 19, 2012 at 02:23:15PM -0700, Ian Kelly wrote: On Wed, Dec 19, 2012 at 1:55 PM, wxjmfa...@gmail.com wrote: If wrong, this can be considered as programmatically correct or logically acceptable (Py3.2) 'Straße'.upper().lower().capitalize() == 'Straße' True while this

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Terry Reedy
On 12/19/2012 9:03 PM, Chris Angelico wrote: On Thu, Dec 20, 2012 at 5:27 AM, Ian Kelly ian.g.ke...@gmail.com wrote: From what I've been able to discern, [jmf's] actual complaint about PEP 393 stems from misguided moral concerns. With PEP-393, strings that can be fully represented in Latin-1

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Westley Martínez
On Wed, Dec 19, 2012 at 09:54:20PM -0500, Terry Reedy wrote: On 12/19/2012 9:03 PM, Chris Angelico wrote: On Thu, Dec 20, 2012 at 5:27 AM, Ian Kelly ian.g.ke...@gmail.com wrote: From what I've been able to discern, [jmf's] actual complaint about PEP 393 stems from misguided moral concerns.

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Chris Angelico
On Thu, Dec 20, 2012 at 2:12 PM, Westley Martínez aniko...@gmail.com wrote: Really, why should we be so obsessed with speed anyways? Isn't improving the language and fixing bugs far more important? Because speed is very important in certain areas. Python can be used in many ways: *

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Terry Reedy
On 12/19/2012 10:12 PM, Westley Martínez wrote: On Wed, Dec 19, 2012 at 09:54:20PM -0500, Terry Reedy wrote: On 12/19/2012 9:03 PM, Chris Angelico wrote: On Thu, Dec 20, 2012 at 5:27 AM, Ian Kelly ian.g.ke...@gmail.com wrote: From what I've been able to discern, [jmf's] actual complaint

Re: Py 3.3, unicode / upper()

2012-12-19 Thread Steven D'Aprano
On Thu, 20 Dec 2012 00:32:42 -0500, Terry Reedy wrote: In the unicode case, Jim discovered that find was several times slower in 3.3 than 3.2 and claimed that that was a reason to not use 3.2. I ran the complete stringbency.py and discovered that find (and consequently find and replace) are

Determining if any threads are waiting for GIL

2012-12-19 Thread Rouslan Korneychuk
I'm working on a package that can compile CPython byte-code into native machine code (so far: x86 and x86_64 are supported). I have support for almost every byte-code instruction implemented already, but to fully emulate the interpreter, I need an efficient way to determine two things: when to

Re: Why does os.stat() tell me that my file-group has no members?

2012-12-19 Thread Kushal Kumaran
saqib.ali...@gmail.com writes: Thanks!! This was very helpful. It worked perfectly. I had no clue about the intricacies of how python represents the group data from the underlying OS. This page doesn't go into to detailed explanation like you did: http://docs.python.org/2/library/grp.html

[issue8853] getaddrinfo should accept port of type long

2012-12-19 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8853 ___ ___ Python-bugs-list

[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread anatoly techtonik
New submission from anatoly techtonik: http://docs.python.org/3/library/binascii - binascii.hexlify(data) + binascii.hexlify(bytes) tag:easy -- assignee: docs@python components: Documentation messages: 177727 nosy: docs@python, techtonik priority: normal severity: normal status: open

[issue16724] Rename `data` argument names to `bytes`

2012-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Why? The binascii module consistently uses data to refer to binary data. For example: Return the hexadecimal representation of the binary data. Every byte of data is converted ... -- nosy: +amaury.forgeotdarc

[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Hum, io objects are not supposed to close themselves when they run out of data. Even if HTTPResponse chooses to close the underlying socket (to clean unused resources?), it should not report itself as a closed io.IOBase. Subsequent calls read() should

[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as a known bug in io.TextIOWrapper which call read() even previous read() returned an empty data. There was a related issue, I can't found it now. -- nosy: +serhiy.storchaka ___ Python tracker

[issue15112] argparse: nargs='*' positional argument doesn't accept any items if preceded by an option and another positional

2012-12-19 Thread Tim Cuthbertson
Changes by Tim Cuthbertson tim3d.j...@gmail.com: -- nosy: +gfxmonk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15112 ___ ___ Python-bugs-list

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2012-12-19 Thread Tim Cuthbertson
Changes by Tim Cuthbertson tim3d.j...@gmail.com: -- nosy: +gfxmonk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list

[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2012-12-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: buffer.read() never returns empty data in this case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16723 ___

[issue16725] Add 'ident' property to SysLogHandler like in Python 3.x

2012-12-19 Thread Jakob Eriksson
New submission from Jakob Eriksson: Can we have the same ident property for the SysLogHandler in the Python 2.7 library, like it was introduced in the 3.x library? ( Like http://hg.python.org/cpython/rev/6baa90fa2b6d ) -- components: Library (Lib) hgrepos: 165 messages: 177732 nosy:

[issue16725] Add 'ident' property to SysLogHandler like in Python 3.x

2012-12-19 Thread Jakob Eriksson
Changes by Jakob Eriksson ja...@aurorasystems.eu: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16725 ___ ___

[issue16726] expat ParseFile expects bytes, not string

2012-12-19 Thread Michiel de Hoon
New submission from Michiel de Hoon: The expat parser in xml.parsers.expat has a Parse method and a ParseFile method. The Parse method parses a string, however the ParseFile method wants bytes. This is a minimal example of the Parse method: import xml.parsers.expat p =

[issue16725] Add 'ident' property to SysLogHandler like in Python 3.x

2012-12-19 Thread R. David Murray
R. David Murray added the comment: No, that would be a feature addition, and we don't do those in bug fix releases. -- nosy: +r.david.murray resolution: - rejected stage: - committed/rejected status: open - closed ___ Python tracker

[issue15565] pdb displays runt Exception strings

2012-12-19 Thread Hamish Downer
Hamish Downer added the comment: The bug affects me on python 2.7, as described by the original reporter. I am using Ubuntu 12.04 which comes with python 2.7.3 - was this fixed for 2.7 quite recently? However the python 3.2 that is packaged for Ubuntu 12.04 does not suffer from this bug.

  1   2   >