Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Steven D'Aprano
On Sat, 30 Nov 2013 00:37:17 -0500, Roy Smith wrote: > So, who am I to argue with the people who decided that I needed to be > able to type a "PILE OF POO" character. Blame the Japanese for that. Apparently some of the biggest users of Unicode are the various Japanese mobile phone manufacturers,

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Steven D'Aprano
On Fri, 29 Nov 2013 23:00:27 -0700, Ian Kelly wrote: > On Fri, Nov 29, 2013 at 10:37 PM, Roy Smith wrote: >> I was speaking specifically of "ligatures like fi" (or, if you prefer, >> "ligatures like ό". By which I mean those things printers invented >> because some letter combinations look funny

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Steven D'Aprano
On Sat, 30 Nov 2013 02:05:59 -0300, Zero Piraeus wrote: > (I happen to think the presence of ligatures in Unicode is insane, but > my dictator-of-the-world certificate appears to have gotten lost in the > post, so fixing that will have to wait). You're probably right, but we live in an insane wor

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Ian Kelly
On Fri, Nov 29, 2013 at 10:37 PM, Roy Smith wrote: > I was speaking specifically of "ligatures like fi" (or, if you prefer, > "ligatures like ό". By which I mean those things printers invented > because some letter combinations look funny when typeset as two distinct > letters. I think the encod

restype is None( something about ctypes)

2013-11-29 Thread april122409
There are two functions in the dll, The C code in the dll both like this: char * Login(char*host,int port,char* user, char *passwd,int loginSec) { return host /*……*/ } but when call the func, the result is different, the func1 ,the type of the result is bytes; the func2, the type

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article <529967dc$0$29993$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > > The whole idea of ligatures like fi is purely typographic. > > In English, that's correct. I'm not sure if we can generalise that to all > languages that have ligatures. It also partly depends on how y

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Gene Heskett
On Saturday 30 November 2013 00:23:22 Zero Piraeus did opine: > On Sat, Nov 30, 2013 at 04:21:49AM +, Steven D'Aprano wrote: > > On Fri, 29 Nov 2013 21:08:49 -0500, Roy Smith wrote: > > > The whole idea of ligatures like fi is purely typographic. > > > > In English, that's correct. I'm not su

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Zero Piraeus
: On Sat, Nov 30, 2013 at 04:21:49AM +, Steven D'Aprano wrote: > On Fri, 29 Nov 2013 21:08:49 -0500, Roy Smith wrote: > > The whole idea of ligatures like fi is purely typographic. > > In English, that's correct. I'm not sure if we can generalise that to > all languages that have ligatures. I

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article <529967dc$0$29993$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > You edited my text to remove the ligature? That's... unfortunate. It was un-ligated by the time it reached me. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Steven D'Aprano
On Fri, 29 Nov 2013 21:08:49 -0500, Roy Smith wrote: > In article <529934dc$0$29993$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> (8) What's the uppercase of "baffle" spelled with an ffl ligature? >> >> Like most other languages, Python 3.2 fails: >> >> py> 'baffle'.upper

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Dave Angel
On Fri, 29 Nov 2013 21:28:47 -0500, Roy Smith wrote: In article , Chris Angelico wrote: > On Sat, Nov 30, 2013 at 1:08 PM, Roy Smith wrote: > > I would certainly expect, x.lower() == x.upper().lower(), to be True for > > all values of x over the set of valid unicode codepoints. Having >

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article , Chris Angelico wrote: > On Sat, Nov 30, 2013 at 1:08 PM, Roy Smith wrote: > > I would certainly expect, x.lower() == x.upper().lower(), to be True for > > all values of x over the set of valid unicode codepoints. Having > > u"\uFB04".upper() ==> "FFL" breaks that. I would also ex

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Chris Angelico
On Sat, Nov 30, 2013 at 1:08 PM, Roy Smith wrote: > I would certainly expect, x.lower() == x.upper().lower(), to be True for > all values of x over the set of valid unicode codepoints. Having > u"\uFB04".upper() ==> "FFL" breaks that. I would also expect len(x) == > len(x.upper()) to be True. T

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article <529934dc$0$29993$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > (8) What's the uppercase of "baffle" spelled with an ffl ligature? > > Like most other languages, Python 3.2 fails: > > py> 'baffle'.upper() > 'BAfflE' > > but Python 3.3 passes: > > py> 'baffle'.upper

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Johannes Findeisen
On Sat, 30 Nov 2013 01:08:28 + Mark Lawrence wrote: > On 30/11/2013 01:06, Tim Chase wrote: > > On 2013-11-30 00:59, Mark Lawrence wrote: > >> Wrong again, or at least overengineered. > >> > >> print "The total rolled was:", number, " > > ^ > >> > >

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Mark Lawrence
On 30/11/2013 01:06, Tim Chase wrote: On 2013-11-30 00:59, Mark Lawrence wrote: Wrong again, or at least overengineered. print "The total rolled was:", number, " ^ You don't even need the spaces as print kindly does it for you :) but you could a

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Mark Lawrence
On 30/11/2013 00:44, Steven D'Aprano wrote: (5) What is the length of "😸😾"? Both characters U+1F636 (GRINNING CAT FACE WITH SMILING EYES) and U+1F63E (POUTING CAT FACE) are outside the Basic Multilingual Plane, which means they require more than two bytes each. Most programming languages using

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Tim Chase
On 2013-11-30 00:59, Mark Lawrence wrote: > Wrong again, or at least overengineered. > > print "The total rolled was:", number, " ^ > > You don't even need the spaces as print kindly does it for you :) but you could at least include the missing quotati

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Mark Lawrence
On 30/11/2013 00:49, Johannes Findeisen wrote: On Sat, 30 Nov 2013 01:38:36 +0100 Johannes Findeisen wrote: On Fri, 29 Nov 2013 16:31:21 -0800 (PST) farhan...@gmail.com wrote: print "The total rolled was: "number" " The above line is wrong. You did it right below: print "Thanks for playin

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Tim Chase
On 2013-11-29 16:31, farhan...@gmail.com wrote: > It's for a school assignment. Thanks for the honesty--you'll get far more helpful & useful replies because of that. :-) > put them into a variable I called "number" but it seems to glitch > out that variable is in any command other than "print num

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Johannes Findeisen
On Sat, 30 Nov 2013 01:38:36 +0100 Johannes Findeisen wrote: > On Fri, 29 Nov 2013 16:31:21 -0800 (PST) > farhan...@gmail.com wrote: > > > print "The total rolled was: "number" " > > The above line is wrong. You did it right below: > > > print "Thanks for playing, " + name + "." > > print "Yo

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Eduardo A . Bustamante López
On Fri, Nov 29, 2013 at 04:31:21PM -0800, farhan...@gmail.com wrote: > It's for a school assignment. Basically, I need to roll 5 dies with 6 sides > each. So basically, 6 random numbers. That part is easy. Then I need to add > it up. Ok, done that. However, I also need to say something along the

Python Unicode handling wins again -- mostly

2013-11-29 Thread Steven D'Aprano
There's a recent blog post complaining about the lousy support for Unicode text in most programming languages: http://mortoray.com/2013/11/27/the-string-type-is-broken/ The author, Mortoray, gives nine basic tests to understand how well the string type in a language works. The first four involv

Re: Need help with programming in python for class (beginner level)

2013-11-29 Thread Johannes Findeisen
On Fri, 29 Nov 2013 16:31:21 -0800 (PST) farhan...@gmail.com wrote: > print "The total rolled was: "number" " The above line is wrong. You did it right below: > print "Thanks for playing, " + name + "." > print "You bet the total would be at least " + value + "." Do this: print "The total ro

Need help with programming in python for class (beginner level)

2013-11-29 Thread farhanken
It's for a school assignment. Basically, I need to roll 5 dies with 6 sides each. So basically, 6 random numbers. That part is easy. Then I need to add it up. Ok, done that. However, I also need to say something along the lines of "your total number was X". That's what I'm having trouble with. I

Re: Jython - Can't access enumerations?

2013-11-29 Thread Tim Delaney
On 30 November 2013 03:15, Eamonn Rea wrote: > Ok, here's the code: > [elided] > As I said, please also show the *exact* error - copy and paste the stack trace. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: strip away html tags from extracted links

2013-11-29 Thread Gene Heskett
On Friday 29 November 2013 13:44:57 Chris Angelico did opine: > On Sat, Nov 30, 2013 at 4:33 AM, Mark Lawrence wrote: > > One last thing, I observe that you've a gmail address. This is > > currently guaranteed to send shivers down my spine. So if you're > > using google groups, would you be ki

Re: strip away html tags from extracted links

2013-11-29 Thread Joel Goldstick
On Fri, Nov 29, 2013 at 12:44 PM, Joel Goldstick wrote: > > > > On Fri, Nov 29, 2013 at 12:33 PM, Mark Lawrence > wrote: > >> On 29/11/2013 16:56, Max Cuban wrote: >> >>> I have the following code to extract certain links from a webpage: >>> >>> from bs4 import BeautifulSoup >>> import urllib2, s

Re: strip away html tags from extracted links

2013-11-29 Thread Joel Goldstick
On Fri, Nov 29, 2013 at 12:33 PM, Mark Lawrence wrote: > On 29/11/2013 16:56, Max Cuban wrote: > >> I have the following code to extract certain links from a webpage: >> >> from bs4 import BeautifulSoup >> import urllib2, sys >> import re >> >> def tonaton(): >> site = "http://tonaton.com/en/

Re: strip away html tags from extracted links

2013-11-29 Thread Chris Angelico
On Sat, Nov 30, 2013 at 4:33 AM, Mark Lawrence wrote: > One last thing, I observe that you've a gmail address. This is currently > guaranteed to send shivers down my spine. So if you're using google groups, > would you be kind enough to read and action this, > https://wiki.python.org/moin/Google

Re: strip away html tags from extracted links

2013-11-29 Thread Mark Lawrence
On 29/11/2013 16:56, Max Cuban wrote: I have the following code to extract certain links from a webpage: from bs4 import BeautifulSoup import urllib2, sys import re def tonaton(): site = "http://tonaton.com/en/job-vacancies-in-ghana"; hdr = {'User-Agent' : 'Mozilla/5.0'} req = ur

strip away html tags from extracted links

2013-11-29 Thread Max Cuban
I have the following code to extract certain links from a webpage: from bs4 import BeautifulSoup import urllib2, sys import re def tonaton(): site = "http://tonaton.com/en/job-vacancies-in-ghana"; hdr = {'User-Agent' : 'Mozilla/5.0'} req = urllib2.Request(site, headers=hdr) jobpas

Re: Managing Google Groups headaches

2013-11-29 Thread Grant Edwards
On 2013-11-29, Arif Khokar wrote: > On 11/28/2013 1:50 PM, Michael Torrie wrote: >> On 11/28/2013 11:37 AM, rusi wrote: > >>> 2. All kinds of people hop onto the list. In addition to genuine ones there >>> are >>> spammers, trolls, dicks, nuts, philosophers, help-vampires etc etc. >> >> What

Re: Jython - Can't access enumerations?

2013-11-29 Thread Eamonn Rea
Ok, here's the code: body_def = BodyDef() # Imports the BodyDef class fine. body_def.type = BodyDef.DynamicBody # Says it can't find a module from LibGDX called BodyDef. All my code: from com.badlogic.gdx import Game, Gdx, Screen from com.badlogic.gdx.backends.lwjgl import LwjglApplicationConf

Re: Managing Google Groups headaches

2013-11-29 Thread Grant Edwards
On 2013-11-28, Zero Piraeus wrote: >: > > On Thu, Nov 28, 2013 at 08:40:47AM -0700, Michael Torrie wrote: >> My opinion is that the Python list should dump the Usenet tie-in and >> just go straight e-mail. > > +1 Hell yes. I'd have to reluctantly agree. I've been using Usenet for 25 years, and I

Re: how to implement a queue-like container with sort function

2013-11-29 Thread Mark Lawrence
On 29/11/2013 12:33, iMath wrote: BTW ,the Queue object has an attribute 'queue' ,but I cannot find it described in the DOC ,what it means ? Really? AttributeError: type object 'Queue' has no attribute 'queue' -- Python is the second best programming language in the world. But the best has

Re: Managing Google Groups headaches

2013-11-29 Thread Mark Lawrence
On 29/11/2013 00:46, Arif Khokar wrote: On 11/28/2013 1:50 PM, Michael Torrie wrote: On 11/28/2013 11:37 AM, rusi wrote: 2. All kinds of people hop onto the list. In addition to genuine ones there are spammers, trolls, dicks, nuts, philosophers, help-vampires etc etc. What they have in

Re: Managing Google Groups headaches

2013-11-29 Thread Mark Lawrence
On 28/11/2013 16:29, Zero Piraeus wrote: : On Thu, Nov 28, 2013 at 08:40:47AM -0700, Michael Torrie wrote: My opinion is that the Python list should dump the Usenet tie-in and just go straight e-mail. +1 Hell yes. I'd happily use semaphore but given time you're bound to find someone who c

Re: Python application for rpm creation

2013-11-29 Thread Unix SA
Hello, Thanks Runge, I am not looking for tool which can help to create package for python code, but i am looking for tool which creates package or SPEC file for all kind of lib it's C or >NET, or JAVA or anything. Regards, DJ On Wed, Nov 27, 2013 at 2:41 PM, Matthias Runge wrote: > On 11/27/

Re: how to implement a queue-like container with sort function

2013-11-29 Thread iMath
it seems PriorityQueue satisfy my requirement here . BTW ,the Queue object has an attribute 'queue' ,but I cannot find it described in the DOC ,what it means ? -- https://mail.python.org/mailman/listinfo/python-list

Re: For-each behavior while modifying a collection

2013-11-29 Thread Ned Batchelder
On 11/28/13 5:14 PM, Valentin Zahnd wrote: 2013/11/28 Ned Batchelder : On 11/28/13 10:49 AM, Valentin Zahnd wrote: Hello For-each does not iterate ober all entries of collection, if one removes elements during the iteration. Example code: def keepByValue(self, key=None, value=[]): for

Re: For-each behavior while modifying a collection

2013-11-29 Thread Chris Angelico
On Fri, Nov 29, 2013 at 9:14 AM, Valentin Zahnd wrote: > def keepByValue(self, key=None, value=[]): > tmpFlows = [] > while len(self.flows) > 0: > row = self.flows.pop() > if row[key] in value: > tmpFlows.append(row) > self

Re: For-each behavior while modifying a collection

2013-11-29 Thread Valentin Zahnd
2013/11/28 Ned Batchelder : > On 11/28/13 10:49 AM, Valentin Zahnd wrote: >> >> Hello >> >> For-each does not iterate ober all entries of collection, if one >> removes elements during the iteration. >> >> Example code: >> >> def keepByValue(self, key=None, value=[]): >> for row in self.flows: