Re: Unicode issue with Python v3.3

2013-04-10 Thread Antoine Pitrou
rusi gmail.com> writes: > > Hmm I see some cut-paste goofup on my part. > I was meaning to juxtapose this thread where we put up with inordinate > amount of nonsense from OP > along with the recent thread in which a newcomer who thinks he has > found a bug in pdb is made fun of. > > Then thought

Re: Unicode issue with Python v3.3

2013-04-10 Thread nagia . retsina
Τη Τετάρτη, 10 Απριλίου 2013 7:25:21 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε: > What does os.environ['REMOTE_ADDR'] give? Until you answer that question, > you won't make any progress. I insists stevv. Look at what 'python3 metrites.py' gives me -- http://mail.python.org/mailman/listi

Re: Unicode issue with Python v3.3

2013-04-10 Thread Νίκος Γκρ33κ
Here is the whole code for metrites.py in case someone wants to take allok. Everything is correct after altering it to meet python 3.3, everythign aprt from the weird unicode error thing. http://pastebin.com/5Mpjx5Fd please take a look. Thank you. -- http://mail.python.org/mailman/listinfo/py

Re: Unicode issue with Python v3.3

2013-04-10 Thread Steven D'Aprano
On Tue, 09 Apr 2013 23:04:35 -0700, rusi wrote: > Hmm I see some cut-paste goofup on my part. I was meaning to juxtapose > this thread where we put up with inordinate amount of nonsense from OP > along with the recent thread in which a newcomer who thinks he has found > a bug in pdb is made fun of

People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Steven D'Aprano
On Wed, 10 Apr 2013 08:28:55 +, Steven D'Aprano wrote: > If you want to be helpful, how about leading by example and taking on > some of the less coherent newbie questions [...] On that note, I think I'll take the opportunity to give thanks to Peter Otten, who (if I remember correctly) has

extract HTML table in a structured format

2013-04-10 Thread Jabba Laci
Hi, I wonder if there is a nice way to extract a whole HTML table and have the result in a nice structured format. What I want is to have the lifetime table at the bottom of this page: http://en.wikipedia.org/wiki/List_of_Ubuntu_releases (then figure out with a script until when my Ubuntu release

use a loop to create lists

2013-04-10 Thread martaamunar
Hi! I would like to create a list containing lists. I need each list to have a differente name and i would like to use a loop to name the list. But as the name, is a string, i cannot asign it to a value... how can I do that?? global_list=[] for i in range (20): ("list_"+i)=[] #These would

Re: use a loop to create lists

2013-04-10 Thread Chris Angelico
On Wed, Apr 10, 2013 at 6:40 PM, wrote: > Hi! > > I would like to create a list containing lists. I need each list to have a > differente name and i would like to use a loop to name the list. But as the > name, is a string, i cannot asign it to a value... how can I do that?? > > > global_list=[

name lookup failure using metaclasses with unittests

2013-04-10 Thread Ulrich Eckhardt
Hi! I'm having problems using a metaclass to generate test functions. This works when I try to run all tests from the module or test case, but it fails when I'm trying to specify a single test function. My environment is Python 2.7.3 on MS Windows 7 at the moment. It should be upgraded to at

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Mark Lawrence
On 10/04/2013 09:34, Steven D'Aprano wrote: On that note, I think I'll take the opportunity to give thanks to Peter Otten, who (if I remember correctly) has been here for longer than I have, and I've been here for a long time. In all that time, I don't think I've ever seen him snap at or be rude

guessthenumber print games left

2013-04-10 Thread eschneider92
Could anyone tell me how to make the program tell me how many games are left before the first game and second game? For example, after one game of guess the number, I want it to tell me that i get one more game. P.S. I'm totally new to python (obviously), and I just added numberofgames variable

Re: guessthenumber print games left

2013-04-10 Thread Chris Angelico
On Wed, Apr 10, 2013 at 7:39 PM, wrote: > Could anyone tell me how to make the program tell me how many games are left > before the first game and second game? For example, after one game of guess > the number, I want it to tell me that i get one more game. P.S. I'm totally > new to python (ob

Re: name lookup failure using metaclasses with unittests

2013-04-10 Thread Peter Otten
Ulrich Eckhardt wrote: > Hi! > > I'm having problems using a metaclass to generate test functions. This > works when I try to run all tests from the module or test case, but it > fails when I'm trying to specify a single test function. My environment > is Python 2.7.3 on MS Windows 7 at the momen

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Νίκος Γκρ33κ
os.environ['HTTP_USER_AGENT'] is only set when running from browser. so i faked it by using: userinfo = os.environ.get('HTTP_USER_AGENT', 'some default') but the encoding issues are still there. -- http://mail.python.org/mailman/listinfo/python-list

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Νίκος Γκρ33κ
Thank you just altered it but i still get the same encoding issues. please its only a matter of simple alternation that iam not able to see. When you have the time plz take a look. Thank you! -- http://mail.python.org/mailman/listinfo/python-list

pymysql KeyError

2013-04-10 Thread Chris Green
Hello everyone, greetings from Hong Kong. I'm a relative noob with Python and have managed to break it. I'm hoping someone would be kind enough to help out, or perhaps just point me in the right direction. I've written a program which pulls in an XML document from an API on a server and popula

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Peter Otten
Steven D'Aprano wrote: > On Wed, 10 Apr 2013 08:28:55 +, Steven D'Aprano wrote: > >> If you want to be helpful, how about leading by example and taking on >> some of the less coherent newbie questions > [...] > > > On that note, I think I'll take the opportunity to give thanks to Peter > Ot

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Peter Otten
Mark Lawrence wrote: > On 10/04/2013 09:34, Steven D'Aprano wrote: >> >> On that note, I think I'll take the opportunity to give thanks to Peter >> Otten, who (if I remember correctly) has been here for longer than I >> have, and I've been here for a long time. In all that time, I don't think >> I

Re: pymysql KeyError

2013-04-10 Thread Peter Otten
Chris Green wrote: > Hello everyone, greetings from Hong Kong. > > I'm a relative noob with Python and have managed to break it. I'm hoping > someone would be kind enough to help out, or perhaps just point me in the > right direction. > > I've written a program which pulls in an XML document fro

Re: use a loop to create lists

2013-04-10 Thread Dave Angel
On 04/10/2013 04:40 AM, martaamu...@gmail.com wrote: Hi! I would like to create a list containing lists. I need each list to have a differente name and i would like to use a loop to name the list. But as the name, is a string, i cannot asign it to a value... how can I do that?? global_list=[

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Νίκος Γκρ33κ
Anyone please? -- http://mail.python.org/mailman/listinfo/python-list

Re: xlrd 0.9.2 released!

2013-04-10 Thread nn
On Apr 9, 3:38 pm, Chris Withers wrote: > Hi All, > > I'm pleased to announce the release of xlrd 0.9.2: > > http://pypi.python.org/pypi/xlrd/0.9.2 > > This release includes the following changes: > > - Fix some packaging issues that meant docs and examples were missing > from the tarball. > > - F

Really throwing this out there - does anyone have a copy of my old Dancer web browser?

2013-04-10 Thread steven . miale
About... er, a few years ago (1994!) I wrote a very basic web browser called Dancer. My FTP site at Indiana is long gone. Grail is based on at least some of the ideas of Dancer (but not the code itself.) I'm wondering if anyone perchance has a copy of the code. I know it will not run in any

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Mark Lawrence
On 10/04/2013 15:43, Νίκος Γκρ33κ wrote: Anyone please? I have already shown my support for Peter Otten on this thread. Are you asking for more people to do so? -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence -- http://mail.

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 1:15 AM, Mark Lawrence wrote: > On 10/04/2013 15:43, Νίκος Γκρ33κ wrote: >> >> Anyone please? >> > > I have already shown my support for Peter Otten on this thread. Are you > asking for more people to do so? Sure, I can! He's one of the people who keeps this list/ng produ

Re: Really throwing this out there - does anyone have a copy of my old Dancer web browser?

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 1:03 AM, wrote: > About... er, a few years ago (1994!) I wrote a very basic web browser called > Dancer. My FTP site at Indiana is long gone. Grail is based on at least > some of the ideas of Dancer (but not the code itself.) > > I'm wondering if anyone perchance has a

Re: use a loop to create lists

2013-04-10 Thread rusi
On Apr 10, 1:40 pm, martaamu...@gmail.com wrote: > Hi! > > I would like to create a list containing lists. I need each list to have a > differente name and i would like to use a loop to name the list. But as the > name, is a string, i cannot asign it to a value... how can I do that?? > > global_l

Re: While loop help

2013-04-10 Thread rusi
On Apr 9, 8:47 pm, thomasancill...@gmail.com wrote: > ... and if you have any ideas for me to improve my coding that will prevent > me from learning > python in a sloppy way. I'd like to learn it correctly the first time! Not perhaps a direct answer... Anyways there is style in which python is b

RE: pymysql KeyError

2013-04-10 Thread Chris Green
> Add a > > print(newrecord) > > before the > > dbcur.execute(...) > > line and tell us what it shows. I'm guessing that for one of the values in > it you forgot to call a method written in C, e. g. > > >>> [42].pop > > >>> type(_) > > > instead of > > >>> [42].pop() > 42 > Thank you Peter - that

Re: People in the python community [was Re: Unicode issue with Python v3.3]

2013-04-10 Thread Νίκος Γκρ33κ
I'am not sure i follow you. How did my topic changed?! Is this possible? How about the oce i posted at patebin.com. Did anyone by any chnace had a look into? It's only a single thing iam missing for the encoding and the the script will load properly with python 3.3 -- http://mail.python.org/mai

Re: extract HTML table in a structured format

2013-04-10 Thread Arnaud Delobelle
On 10 April 2013 09:44, Jabba Laci wrote: > Hi, > > I wonder if there is a nice way to extract a whole HTML table and have the > result in a nice structured format. What I want is to have the lifetime > table at the bottom of this page: > http://en.wikipedia.org/wiki/List_of_Ubuntu_releases (then

Re: Unicode issue with Python v3.3

2013-04-10 Thread Nobody
On Wed, 10 Apr 2013 00:23:46 -0700, nagia.retsina wrote: > Look at what 'python3 metrites.py' gives me > File "/root/.local/lib/python2.7/lib/python3.3/os.py", line 669, ... ^^^ ^^^ -- http://mail.python.org/mailman/listinfo/python-list

Re: extract HTML table in a structured format

2013-04-10 Thread Jabba Laci
Hi, Thanks, it's a great idea to parse the wiki source. Since then I have found a command for this particular task called "ubuntu-support-status" that shows what I need. But the idea to extract an HTML table from a webpage in a structured format could be an interesting (and useful) project idea.

Re: Unicode issue with Python v3.3

2013-04-10 Thread Νίκος Γκρ33κ
Τη Τετάρτη, 10 Απριλίου 2013 9:08:38 μ.μ. UTC+3, ο χρήστης Nobody έγραψε: > On Wed, 10 Apr 2013 00:23:46 -0700, nagia.retsina wrote: > > > > > Look at what 'python3 metrites.py' gives me > > > > > File "/root/.local/lib/python2.7/lib/python3.3/os.py", line 669, ... > >

Re: Unicode issue with Python v3.3

2013-04-10 Thread Ian Kelly
On Wed, Apr 10, 2013 at 12:25 PM, Νίκος Γκρ33κ wrote: > Τη Τετάρτη, 10 Απριλίου 2013 9:08:38 μ.μ. UTC+3, ο χρήστης Nobody έγραψε: >> On Wed, 10 Apr 2013 00:23:46 -0700, nagia.retsina wrote: >> >> >> >> > Look at what 'python3 metrites.py' gives me >> >> >> >> > File "/root/.local/lib/python2.7/l

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
On Wednesday, April 10, 2013 5:44:20 AM UTC-4, Chris Angelico wrote: > On Wed, Apr 10, 2013 at 7:39 PM, wrote: > > > Could anyone tell me how to make the program tell me how many games are > > left before the first game and second game? For example, after one game of > > guess the number, I wa

Re: Strange files??

2013-04-10 Thread Rob Day
On Wednesday 10 Apr 2013 14:16:23 Joe Hill wrote: > Recently I installed Python 3.3 successfully. > > Yesterday - I have a bunch of PY files such as thesaurus.py, some *.p7s > files, some signature files and an index.fpickle. A total of 23 files. > > Where do they come from and how do they end u

Re: Print to an IPP printer (pkipplib?)

2013-04-10 Thread Adam Tauno Williams
On Wed, 2010-10-20 at 14:45 +, Martin Gregorie wrote: > On Fri, 15 Oct 2010 15:28:10 -0400, Adam Tauno Williams wrote: > > I've found the module pkipplib which seems to work well for things like > > interrogating an IPP (CUPS) server. But is there a way to send a print > > job to an IPP print

python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-10 Thread someone
Hi, Here's my data: --- 20130315T071500 39000. 10 26 48000. 1 40 20130315T071501 39000. 10 26 48000. 2 42 20130315T071501 39000. 10 26 47520. 15 69 20130315T071501 39000. 10 26 47160. 1 70 20130315T071501 3

Re: guessthenumber print games left

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 7:01 AM, wrote: > On Wednesday, April 10, 2013 5:44:20 AM UTC-4, Chris Angelico wrote: >> On Wed, Apr 10, 2013 at 7:39 PM, wrote: >> >> You have here a counter, but it's counting up. To figure out how many >> games are left, just subtract the numberofgames from the total

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-10 Thread Gregory Ewing
Ned Deily wrote: There is a meta tracker for problems with the Python issuer tracker itself: http://psf.upfronthosting.co.za/roundup/meta/ but you do have to register for that tracker (a separate registration). You mean there's no meta-meta-tracker for reporting problems registering with t

Re: Unicode issue with Python v3.3

2013-04-10 Thread Arnaud Delobelle
On 10 April 2013 09:28, Steven D'Aprano wrote: > On Tue, 09 Apr 2013 23:04:35 -0700, rusi wrote: [...] > I think it is quite unfair of you to mischaracterise the entire community > response in this way. One person made a light-hearted, silly, unhelpful > response. (As sarcasm, I'm afraid it missed

Functional vs. Object oriented API

2013-04-10 Thread Max Bucknell
Hi, I'm currently learning Python, and it's going great. I've dabbled before, but really getting into it is good fun. To test myself, and not detract too much from my actual studies (mathematics), I've been writing my own package to do linear algebra, and I am unsure about how best to structur

Re: Unicode issue with Python v3.3

2013-04-10 Thread Cameron Simpson
On 10Apr2013 01:06, Νίκος Γκρ33κ wrote: | Here is the whole code for metrites.py in case someone wants to take allok. | | Everything is correct after altering it to meet python 3.3, | everythign aprt from the weird unicode error thing. | | http://pastebin.com/5Mpjx5Fd | | please take a look. F

Re: Functional vs. Object oriented API

2013-04-10 Thread Xavier Ho
Hi Max, In Python, we prefer readability over anything else. The simpler you can write it, the better it can be understood. That said, I've never considered using (i, j, k) as a vector component before. I've always done something akin to: >>> vector = Vector(2, 4, 6) >>> print (vector.normaliz

Re: Functional vs. Object oriented API

2013-04-10 Thread Ian Kelly
On Wed, Apr 10, 2013 at 5:16 PM, Max Bucknell wrote: > I also have a function to generate the dot product of these two vectors. In > Java, such a function would be put as a method on the class and I would do > something like: > > >>> a.dot_product(b) > 7 > > and that would be the end of

Re: extract HTML table in a structured format

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 4:15 AM, Jabba Laci wrote: > Hi, > > Thanks, it's a great idea to parse the wiki source. Since then I have found > a command for this particular task called "ubuntu-support-status" that shows > what I need. That sounds like an even better option. Anything that depends on p

performance of script to write very long lines of random chars

2013-04-10 Thread gry
Dear pythonistas, I am writing a tiny utility to produce a file consisting of a specified number of lines of a given length of random ascii characters. I am hoping to find a more time and memory efficient way, that is still fairly simple clear, and _pythonic_. I would like to have something th

Re: python-noob - which container is appropriate for later exporting into mySql + matplotlib ?

2013-04-10 Thread Cousin Stanley
someone wrote: > > I want to put this table into an appropriate container > such that afterwards I want to: > > 1) Put the data into a mySql-table > 2) Be able to easily plot column 1 vs. either of the other columns > using matplotlib etc... > Consider editing your data file into

Re: performance of script to write very long lines of random chars

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 11:21 AM, gry wrote: > avail_chrs = > '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%& > \'()*+,-./:;<=>?@[\\]^_`{}' Is this exact set of characters a requirement? For instance, would it be acceptable to instead use this set of characters? avail_chrs

Re: performance of script to write very long lines of random chars

2013-04-10 Thread Michael Torrie
On 04/10/2013 07:21 PM, gry wrote: > from sys import stdout > from array import array > import random > nchars = 3200 > rows = 10 > avail_chrs = > '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%& > \'()*+,-./:;<=>?@[\\]^_`{}' > a = array('c', 'X' * nchars) > > for l in ran

Re: performance of script to write very long lines of random chars

2013-04-10 Thread gry
On Apr 10, 9:52 pm, Michael Torrie wrote: > On 04/10/2013 07:21 PM, gry wrote: > > > > > > > > > > > from sys import stdout > > from array import array > > import random > > nchars = 3200 > > rows = 10 > > avail_chrs = > > '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%& >

Re: While loop help

2013-04-10 Thread Larry Hudson
On 04/09/2013 11:44 PM, Larry Hudson wrote: On 04/09/2013 09:49 AM, thomasancill...@gmail.com wrote: So what would be the proper way to perform a loop of this program. I still can't quite figure out the best way to do it. My suggestion... (pseudocode) # Print a heading/introduction here w

Re: performance of script to write very long lines of random chars

2013-04-10 Thread MRAB
On 11/04/2013 02:21, gry wrote: Dear pythonistas, I am writing a tiny utility to produce a file consisting of a specified number of lines of a given length of random ascii characters. I am hoping to find a more time and memory efficient way, that is still fairly simple clear, and _pythonic_.

Re: performance of script to write very long lines of random chars

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 12:40 PM, gry wrote: > Appealing idea, but it's slower than the array solution: 5min 13 > secs. vs 4min 30sec for the array: > > for l in range(rows): > for i in xrange(nchars): > stdout.write(random.choice(avail_chrs)) > stdout.write('\n') > > > os.urandom

Re: Unicode issue with Python v3.3

2013-04-10 Thread nagia . retsina
Firtly thank uou for taking a look into the code. the doctype is coming form the attempt of script metrites.py to open and read the 'index.html' file. But i don't know how to try to open it as a byte file instead of an tetxt file. -- http://mail.python.org/mailman/listinfo/python-list

Re: performance of script to write very long lines of random chars

2013-04-10 Thread Steven D'Aprano
On Thu, 11 Apr 2013 11:45:31 +1000, Chris Angelico wrote: > On Thu, Apr 11, 2013 at 11:21 AM, gry wrote: >> avail_chrs = >> '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%& >> \'()*+,-./:;<=>?@[\\]^_`{}' > > Is this exact set of characters a requirement? For instance, would

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
On Wednesday, April 10, 2013 5:39:23 AM UTC-4, eschne...@comcast.net wrote: > Could anyone tell me how to make the program tell me how many games are left > before the first game and second game? For example, after one game of guess > the number, I want it to tell me that i get one more game. P.S

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
(Didn't mean to post the last bit.) Is this possibly what you meant? If it is I still can't figure out how to apply it to the guessthenumber program. numberofgames=1 while numberofgames<4: numberofgames=numberofgames+2 print (4-numberofgames) if numberofguesses>3: print(numb

Re: guessthenumber print games left

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 3:41 PM, wrote: > (Didn't mean to post the last bit.) Is this possibly what you meant? If it is > I still can't figure out how to apply it to the guessthenumber program. > numberofgames=1 > while numberofgames<4: > numberofgames=numberofgames+2 > print (4-numberof

Re: performance of script to write very long lines of random chars

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 3:33 PM, Steven D'Aprano wrote: > I was originally going to write that using the base64 module would > introduce bias into the random strings, but after a little investigation, > I don't think it does. Assuming that os.urandom() returns bytes with perfectly fair distributi

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
How do I make it say that I have one game left? I'm having trouble fitting it into my main code. Thanks a lot for the help btw. -- http://mail.python.org/mailman/listinfo/python-list

Re: guessthenumber print games left

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 3:56 PM, wrote: > How do I make it say that I have one game left? I'm having trouble fitting it > into my main code. Thanks a lot for the help btw. The main confusion seems to be over whether to add one or two. If you add one, it'll tell you you have just one game left (

Re: guessthenumber print games left

2013-04-10 Thread eschneider92
The 2 makes the game play twice instead of 3 times, right? I've tried it with the 1, but but I'm still having trouble. Again, to be exact, I want to somehow make it count down from 2 (the number of games)and print. If that's what this does, is it possible to insert it into my original main progr

Re: guessthenumber print games left

2013-04-10 Thread Chris Angelico
On Thu, Apr 11, 2013 at 4:15 PM, wrote: > The 2 makes the game play twice instead of 3 times, right? I've tried it with > the 1, but but I'm still having trouble. Again, to be exact, I want to > somehow make it count down from 2 (the number of games)and print. If that's > what this does, is it

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-10 Thread Ned Deily
In article , Gregory Ewing wrote: > Ned Deily wrote: > > There is a meta tracker for problems with the Python > > issuer tracker itself: > > http://psf.upfronthosting.co.za/roundup/meta/ > > but you do have to register for that tracker (a separate registration). > You mean there's no meta-meta