Re: Unicode in Python

2014-04-22 Thread Ben Finney
Devin Jeanpierre writes: > But yes, typing out the special characters is annoying. I just use > words. I use words that describe the meaning, where feasible. > The only downside to using words is, how do you specify capital > versus lowercase letters? Why do you need to, for an identifier? If

Re: Unicode in Python

2014-04-22 Thread Devin Jeanpierre
On Tue, Apr 22, 2014 at 10:52 PM, Steven D'Aprano wrote: > There's not just the keyboard mapping. There's the mental cost of knowing > which keyboard mapping you need ("is it Greek, Hebrew, or maths > symbols?"), the cost of remembering the mapping from the keys you see on > the keyboard to the ke

Re: object().__dict__

2014-04-22 Thread Cameron Simpson
On 23Apr2014 09:39, Pavel Volkov wrote: There are some basics about Python objects I don't understand. Consider this snippet: class X: pass ... x = X() dir(x) ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__h

Re: object().__dict__

2014-04-22 Thread Ben Finney
Pavel Volkov writes: > The attribute list is different now and there's no __dict__ and the > object does not accept new attributes. > Please explain what's going on. It's a leaky abstraction, unfortunately. By default, all user-defined types will provide their instances with a ‘__dict__’ attrib

Re: Unicode in Python

2014-04-22 Thread Steven D'Aprano
On Tue, 22 Apr 2014 22:31:41 -0700, Rustom Mody wrote: > Chris Angelico wrote: >> it's impossible for most people to type (and programming with a palette >> of arbitrary syntactic tokens isn't my idea of fun)... > > Where's the suggestion to use a "palette of arbitrary tokens" ? > > I just tried

Re: Unicode in Python

2014-04-22 Thread Chris Angelico
On Wed, Apr 23, 2014 at 3:31 PM, Rustom Mody wrote: > Chris Angelico wrote: >> it's impossible for most people to type (and programming with a palette >> of arbitrary syntactic tokens isn't my idea of fun)... > > Where's the suggestion to use a "palette of arbitrary tokens" ? > > I just tried a gr

object().__dict__

2014-04-22 Thread Pavel Volkov
There are some basics about Python objects I don't understand. Consider this snippet: class X: pass ... x = X() dir(x) ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '_

Unicode in Python

2014-04-22 Thread Rustom Mody
Chris Angelico wrote: > it's impossible for most people to type (and programming with a palette > of arbitrary syntactic tokens isn't my idea of fun)... Where's the suggestion to use a "palette of arbitrary tokens" ? I just tried a greek keyboard; ie do $ setxkbmap -option "grp:switch,grp:alt_shi

Re: Why does isoformat() optionally not print the fractional seconds?

2014-04-22 Thread MRAB
On 2014-04-23 01:05, Travis Griggs wrote: Python(3) let me down today. Better to be explicit, and all that, didn’t pan out for me. I have time series data being recorded in a mongo database (I love pymongo). I have an iOS app that consumes the data. Since JSON doesn’t have a time format, I ha

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Andrew Cooper
On 22/04/2q014 13:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > > Excellent! Shebangs are *extremely* specific, so you may want to > cons

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Andrew Cooper
On 22/04/2q014 13:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > > Excellent! Shebangs are *extremely* specific, so you may want to > cons

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Andrew Cooper
On 22/04/2014 13:52, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:36 PM, Steven D'Aprano > wrote: >>> These are the 15 first lines of the script: >>> >>> #! /opt/local/bin/python >> >> This being Solaris, what happens if you remove the space between the hash- >> bang and the path? On Linux i

Why does isoformat() optionally not print the fractional seconds?

2014-04-22 Thread Travis Griggs
Python(3) let me down today. Better to be explicit, and all that, didn’t pan out for me. I have time series data being recorded in a mongo database (I love pymongo). I have an iOS app that consumes the data. Since JSON doesn’t have a time format, I have to stringify the times when transmitting

Glade on Windows using Python

2014-04-22 Thread mbg1708
Using Windows 8.1 Update. I've loaded ActiveState python (version 2.7) --- installed OK. I don't need Glade, but I do want to use some Glade XML and run the python application. To run a Glade application this needs: from gi.repository import Gtk gi.repository is not available to import. Wh

Re: analyse Chinese language using Python code

2014-04-22 Thread haiticare2011
On Tuesday, April 22, 2014 3:04:39 PM UTC-4, linda.s wrote: > How to analyse Chinese language using Python code? You will need to program a pattern recognizer system. Are you interested in spoken chinese or written Kanji? xie xie JB -- https://mail.python.org/mailman/listinfo/python-list

analyse Chinese language using Python code

2014-04-22 Thread linda.s
How to analyse Chinese language using Python code? -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode in Python

2014-04-22 Thread Rustom Mody
On Tuesday, April 22, 2014 12:01:06 PM UTC+5:30, Ian wrote: > On Apr 22, 2014 12:01 AM, "Rustom Mody" wrote: > > As a unicode user (ok wannabe unicode user :D ) Ive > > written up some unicode ideas that have been discussed here in the > > last couple of weeks: > > http://blog.languager.org/2014/0

Re: Running programs on mobile phones

2014-04-22 Thread Miki Tebeka
> I have seen by chance a number of years ago a book on Python programming > for running on mobile phones (of a certain producer only). What is the > current state of the art in that? Could someone kindly give a few good > literature references? Thanks in advance. I'm not an expert, but take a look

Re: Unicode in Python

2014-04-22 Thread wxjmfauth
Le mardi 22 avril 2014 14:21:40 UTC+2, Steven D'Aprano a écrit : > On Tue, 22 Apr 2014 02:07:58 -0700, wxjmfauth wrote: > > > > > Le mardi 22 avril 2014 08:30:45 UTC+2, Rustom Mody a écrit : > > >> > > >> > > >> > > >> > > > @ rusy > > > > > >> "Ive reworded it to make it clear that

Re: Best Website Design Services by Professional Web Designing Company

2014-04-22 Thread alister
On Wed, 23 Apr 2014 00:35:37 +1000, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 11:40 PM, alister > wrote: >> Considering the poor quality of your own site it is hardly surprising >> that you have to resorts to spamming a totally unrelated newsgroup/ >> mailing list. > > If you *must* respon

Re: Best Website Design Services by Professional Web Designing Company

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 11:40 PM, alister wrote: > Considering the poor quality of your own site it is hardly surprising > that you have to resorts to spamming a totally unrelated newsgroup/ > mailing list. If you *must* respond to spam, please at least trim out the URLs so they don't get free ex

Google open positions at Shanghai/China ?

2014-04-22 Thread Wesley
Hi guys, Anybody know if there are openning positions at Shanghai, China? Just ask for one of my friend in case someone here woring for Google:-) Although see some opened positions from google career, seems no actaully hire going on. Thanks. Wesley -- https://mail.python.org/mailman/listinfo/p

Re: Best Website Design Services by Professional Web Designing Company

2014-04-22 Thread alister
On Tue, 22 Apr 2014 02:21:01 -0700, aveinfosys wrote: > Ave Infosys is a leading professional in Web Designing Company in > Hyderabad India for the > > E-Business Industry.Ave Infosys are providing Best Website Development > and Design Services > > in Hyderabad.Our company offers the Best Web De

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 11:22 PM, Tim Chase wrote: > On 2014-04-22 22:52, Chris Angelico wrote: >> I'm pretty sure the POSIX standard stipulates that a space there is >> optional. Should be no difference between "#!/" and "#! /" on any >> compliant OS. (But I can't right now find a citation for th

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Tim Chase
On 2014-04-22 22:52, Chris Angelico wrote: > I'm pretty sure the POSIX standard stipulates that a space there is > optional. Should be no difference between "#!/" and "#! /" on any > compliant OS. (But I can't right now find a citation for that, so I > may be wrong.) I wondered this too, so went r

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 11:01 PM, Antoon Pardon wrote: > On 22-04-14 14:26, Chris Angelico wrote: > >> On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon >> wrote: >>> Yes that was it. I changed the first line of my script to: >>> >>> #!/opt/local/bin/python2.7 >>> >>> and it now works. >> Excellent

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Antoon Pardon
On 22-04-14 14:26, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon > wrote: >> Yes that was it. I changed the first line of my script to: >> >> #!/opt/local/bin/python2.7 >> >> and it now works. > Excellent! Shebangs are *extremely* specific, so you may want to > consider

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 10:36 PM, Steven D'Aprano wrote: >> These are the 15 first lines of the script: >> >> #! /opt/local/bin/python > > This being Solaris, what happens if you remove the space between the hash- > bang and the path? On Linux it makes no difference, but Solaris tends to > be a bi

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Steven D'Aprano
On Tue, 22 Apr 2014 12:29:56 +0200, Antoon Pardon wrote: > I am workin on a solaris 11 machine. The python version is 2.7.6 path to > python is /opt/local/bin/python. Are you sure about that? You ought to double check that /opt/local/bin/ python is what you think it is, and not (say) a symlink to

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 10:21 PM, Antoon Pardon wrote: > Yes that was it. I changed the first line of my script to: > > #!/opt/local/bin/python2.7 > > and it now works. Excellent! Shebangs are *extremely* specific, so you may want to consider using "/usr/bin/env python" to get a bit more flexibil

Re: Unicode in Python

2014-04-22 Thread Steven D'Aprano
On Tue, 22 Apr 2014 02:07:58 -0700, wxjmfauth wrote: > Le mardi 22 avril 2014 08:30:45 UTC+2, Rustom Mody a écrit : >> >> >> >> > @ rusy > >> "Ive reworded it to make it clear that I am referring to the > character-sets and not encodings." > > Very good, excellent, comment. An healthy coding

Re: Strange syntax error, occurs only when script is executed directly [solved]

2014-04-22 Thread Antoon Pardon
On 22-04-14 14:09, Chris Angelico wrote: > On Tue, Apr 22, 2014 at 8:29 PM, Antoon Pardon > wrote: >> However if I call the script directly and want the #! line do its work I get >> the following error. >> >> # /usr/local/bin/ldapwatch /opt/local/log/openldap.log | head >> /usr/local/bin/ldapwatc

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Chris Angelico
On Tue, Apr 22, 2014 at 8:29 PM, Antoon Pardon wrote: > However if I call the script directly and want the #! line do its work I get > the following error. > > # /usr/local/bin/ldapwatch /opt/local/log/openldap.log | head > /usr/local/bin/ldapwatch: line 3: syntax error near unexpected token `('

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Antoon Pardon
On 22-04-14 12:42, Frank Millman wrote: > "Antoon Pardon" wrote in message > news:535644a4.6060...@rece.vub.ac.be... >> I am workin on a solaris 11 machine. The python version is 2.7.6 >> path to python is /opt/local/bin/python. >> > [...] >> Now if I execute the script by explicitly calling the

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Frank Millman
"Antoon Pardon" wrote in message news:535644a4.6060...@rece.vub.ac.be... >I am workin on a solaris 11 machine. The python version is 2.7.6 > path to python is /opt/local/bin/python. > [...] > > Now if I execute the script by explicitly calling the interpreter > everything works fine. > [...] > >

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Tim Golden
On 22/04/2014 11:29, Antoon Pardon wrote: > I am workin on a solaris 11 machine. The python version is 2.7.6 > path to python is /opt/local/bin/python. > > These are the 15 first lines of the script: > > #! /opt/local/bin/python > > class vslice(object): > > def __init__(self, fun): >

Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Antoon Pardon
I am workin on a solaris 11 machine. The python version is 2.7.6 path to python is /opt/local/bin/python. These are the 15 first lines of the script: #! /opt/local/bin/python class vslice(object): def __init__(self, fun): self.fun = fun def __getitem__(self, inx

[ANN] Pylint 1.2 released

2014-04-22 Thread Sylvain Thénault
Hi there, Pylint 1.2 has been uploaded to pypi by the end of the last week! More info on this heavy release on http://www.logilab.org/blogentry/240019. As usual, feedback and comments welcome. Enjoy! -- Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42) Formations Py

Re: Unicode in Python

2014-04-22 Thread Rustom Mody
On Tuesday, April 22, 2014 12:01:06 PM UTC+5:30, Ian wrote: > On Apr 22, 2014 12:01 AM, "Rustom Mody" wrote: > > As a unicode user (ok wannabe unicode user :D ) Ive > > written up some unicode ideas that have been discussed here in the > > last couple of weeks: > > http://blog.languager.org/2014/0

Best Website Design Services by Professional Web Designing Company

2014-04-22 Thread aveinfosys
Ave Infosys is a leading professional in Web Designing Company in Hyderabad India for the E-Business Industry.Ave Infosys are providing Best Website Development and Design Services in Hyderabad.Our company offers the Best Web Design & Development services, Web Hosting Services,Responsive a

Re: How to properly get the microseconds from the timestamps?

2014-04-22 Thread Vlastimil Brom
2014-04-22 4:38 GMT+02:00 Igor Korot : ... datetime.datetime.fromtimestamp(1092787200/1000.0) > datetime.datetime(1970, 1, 13, 7, 33, 7, 20) > > Is there a way to know if the timestamp has a microseconds? > > Thank you. > -- Hi, I believe, in these cases, you can just test, whether there i

Re: Unicode in Python

2014-04-22 Thread wxjmfauth
Le mardi 22 avril 2014 08:30:45 UTC+2, Rustom Mody a écrit : > > > @ rusy > "Ive reworded it to make it clear that I am referring to the character-sets and not encodings." Very good, excellent, comment. An healthy coding scheme can only work properly with a unique characters set and the codin

Running programs on mobile phones

2014-04-22 Thread Mok-Kong Shen
I have seen by chance a number of years ago a book on Python programming for running on mobile phones (of a certain producer only). What is the current state of the art in that? Could someone kindly give a few good literature references? Thanks in advance. M. K. Shen -- https://mail.python.org/m