Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 6:30 PM, Mark Lawrence wrote: >> From what I've seen, a lot of software can't get [Unicode] right anyway. >> > > Are you referring to PEP393 having taken notice of the RUE? Even with PEP 393, there's no guarantee that a Python program will get Unicode right. The bytes/tex

Re: Text input with keyboard, via input methods (was: turtle ??)

2016-03-09 Thread Rustom Mody
On Thursday, March 10, 2016 at 12:59:10 PM UTC+5:30, Ben Finney wrote: > Marko Rauhamaa writes: > > > BTW, typing any useful Unicode character is a major unsolved problem. > > You typed a good number of Unicode characters in that sentence alone. > ASCII is a simple subset of Unicode. > > I supp

Installing ibm_db package on Windows 7, 64-bit problem

2016-03-09 Thread Alexander Shmugliakov
Hello, has anybody successfully installed ibm_db package in the 32-bit Python 3.5.0 environment? This is the error messages I'm receiving: I know that the message about vcvarsall.bat is related to the Visual Studio configuration -- I don't have it on my computer. I have no 64-bit IBM Data Server

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Ben Finney
Mark Lawrence writes: > Yes I am, as you appear to know squat. Cut it out, please. This is now bullying. Bart is interested in things that don't interest you; if you can't engage him cordially, please desist. -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\

Re: turtle ??

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 5:14 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> A Turkish keyboard should have dotless and dotted, uppercase and >> lowercase, all easily typed. > > BTW, typing any useful Unicode character is a major unsolved problem. I > have created this text file that contains a

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Mark Lawrence
On 10/03/2016 00:58, BartC wrote: On 09/03/2016 23:35, Mark Lawrence wrote: On 09/03/2016 23:14, BartC wrote: (The byte-code compiler for the current version is written in itself. It can compile itself (some 25Kloc) in about 1 second (that's running interpreted, dynamic byte-code on a not-ver

Text input with keyboard, via input methods (was: turtle ??)

2016-03-09 Thread Ben Finney
Marko Rauhamaa writes: > BTW, typing any useful Unicode character is a major unsolved problem. You typed a good number of Unicode characters in that sentence alone. ASCII is a simple subset of Unicode. I suppose you meant to refer to typing some character not mapped to a single keystroke on a U

Re: turtle ??

2016-03-09 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Chris Angelico : > >> A Turkish keyboard should have dotless and dotted, uppercase and >> lowercase, all easily typed. > > BTW, typing any useful Unicode character is a major unsolved > problem. I have created this text file that contains a lot of unicode > characters with

Re: turtle ??

2016-03-09 Thread Marko Rauhamaa
Chris Angelico : > A Turkish keyboard should have dotless and dotted, uppercase and > lowercase, all easily typed. BTW, typing any useful Unicode character is a major unsolved problem. I have created this text file that contains a lot of unicode characters with their code points. Every once in a

Re: A mistake which almost went me mad

2016-03-09 Thread Rustom Mody
On Wednesday, March 9, 2016 at 10:04:35 PM UTC+5:30, Rick Johnson wrote: > On Thursday, March 3, 2016 at 4:22:07 AM UTC-6, ast wrote: > > Hello > > > > This has to be told > > > > I created a file pickle.py in order to test some files > > read/write with objects and put it in a directory > > whic

Re: turtle ??

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 1:45 PM, Steven D'Aprano wrote: > On Thu, 10 Mar 2016 05:14 am, MRAB wrote: > >> FYI, the uppercase of "ı" is "I" and the lowercase of "İ" is "i". > > Very true. Does that tell us anything about the placement and ease of > getting I on a Turkish keyboard? > > I'm just givin

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 1:38 PM, Jon Ribbens wrote: > On 2016-03-10, Chris Angelico wrote: >> On Thu, Mar 10, 2016 at 10:48 AM, Jon Ribbens >> wrote: >>> On 2016-03-09, Chris Angelico wrote: Then *get interested*. Unicode is the only way that you'll ever not be parochially bound to a s

Re: turtle ??

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 05:14 am, MRAB wrote: > FYI, the uppercase of "ı" is "I" and the lowercase of "İ" is "i". Very true. Does that tell us anything about the placement and ease of getting I on a Turkish keyboard? I'm just giving the OP the benefit of the doubt. Maybe they have a good reason for

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 12:30 pm, BartC wrote: > But the attitude in this group has been very different; Python is > slow, but so what? Just a general shrug. I think that sometimes people here get a bit defensive because they've experienced too many people making snap dismissals of Python due to some

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Jon Ribbens
On 2016-03-10, Chris Angelico wrote: > On Thu, Mar 10, 2016 at 10:48 AM, Jon Ribbens > wrote: >> On 2016-03-09, Chris Angelico wrote: >>> Then *get interested*. Unicode is the only way that you'll ever not be >>> parochially bound to a subset of English - or, worse, bound to an >>> arbitrary eigh

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Ben Finney
BartC writes: > But, someone had to write that Image.PNG.encode() function at some > time. What language did they use? If it wasn't Python, then why not? Because some operations actually need to be very fast, even at the expense of difficult-to-maintain code in a difficult-to-use language. > Wh

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 10:35 am, Mark Lawrence wrote: > On 09/03/2016 23:14, BartC wrote: >> (The byte-code compiler for the current version is written in itself. It >> can compile itself (some 25Kloc) in about 1 second (that's running >> interpreted, dynamic byte-code on a not-very-fast PC). > > P

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread BartC
On 09/03/2016 23:38, Chris Angelico wrote: On Thu, Mar 10, 2016 at 10:14 AM, BartC wrote: program to be actually written in Python. Sometimes you want to understand how code works or what it does or simply to learn from it. (Or sometimes, to rip bits off.) Then it's frustrating when you come

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 11:58 AM, BartC wrote: >>> I'm not much interested in Unicode at the minute. I'll pass. > > >> Your final comment sums up perfectly your knowledge of computing in >> 2016. > > > You're utterly determined to belittle everything I do aren't you! > > But, yeah, I was writing i

Re: Pickle __getstate__ __setstate__ and restoring n/w - beazley pg 172

2016-03-09 Thread Veek. M
Ian Kelly wrote: > On Wed, Mar 9, 2016 at 2:14 AM, Veek. M wrote: >> what i wanted to know was, x = Client('192.168.0.1') will create an >> object 'x' with the IP inside it. When I do: >> pickle.dump(x) >> pickle doesn't know where in the object the IP is, so he'll call >> __getstate__ and expect

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread BartC
On 09/03/2016 23:35, Mark Lawrence wrote: On 09/03/2016 23:14, BartC wrote: (The byte-code compiler for the current version is written in itself. It can compile itself (some 25Kloc) in about 1 second (that's running interpreted, dynamic byte-code on a not-very-fast PC). Please answer my ques

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Ben Finney
Chris Angelico writes: > On Thu, Mar 10, 2016 at 10:14 AM, BartC wrote: > > I'm not much interested in Unicode at the minute. I'll pass. > > Then *get interested*. Unicode is the only way that you'll ever not be > parochially bound to a subset of English - or, worse, bound to an > arbitrary eigh

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 10:48 AM, Jon Ribbens wrote: > On 2016-03-09, Chris Angelico wrote: >> Then *get interested*. Unicode is the only way that you'll ever not be >> parochially bound to a subset of English - or, worse, bound to an >> arbitrary eight-bit codepage that you don't even control th

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Jon Ribbens
On 2016-03-09, Chris Angelico wrote: > Then *get interested*. Unicode is the only way that you'll ever not be > parochially bound to a subset of English - or, worse, bound to an > arbitrary eight-bit codepage that you don't even control the choice > of, such that your program behaves differently o

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 10:14 AM, BartC wrote: > On 09/03/2016 21:13, Mark Lawrence wrote: >> >> On 09/03/2016 12:02, BartC wrote: >>> >>> On 09/03/2016 08:40, Mark Lawrence wrote: >>> >>> Here's another: you have a program in Python that you'd quite like to >>> port to another dynamic language. T

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Mark Lawrence
On 09/03/2016 23:14, BartC wrote: On 09/03/2016 21:13, Mark Lawrence wrote: On 09/03/2016 12:02, BartC wrote: On 09/03/2016 08:40, Mark Lawrence wrote: Here's another: you have a program in Python that you'd quite like to port to another dynamic language. Transcribing actual Python code is str

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread BartC
On 09/03/2016 21:13, Mark Lawrence wrote: On 09/03/2016 12:02, BartC wrote: On 09/03/2016 08:40, Mark Lawrence wrote: Here's another: you have a program in Python that you'd quite like to port to another dynamic language. Transcribing actual Python code is straightforward. Until you come to an

Re: Pickle __getstate__ __setstate__ and restoring n/w - beazley pg 172

2016-03-09 Thread Ian Kelly
On Wed, Mar 9, 2016 at 2:14 AM, Veek. M wrote: > what i wanted to know was, x = Client('192.168.0.1') will create an > object 'x' with the IP inside it. When I do: > pickle.dump(x) > pickle doesn't know where in the object the IP is, so he'll call > __getstate__ and expect the return value to be t

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Mark Lawrence
On 09/03/2016 12:02, BartC wrote: On 09/03/2016 08:40, Mark Lawrence wrote: Here's another: you have a program in Python that you'd quite like to port to another dynamic language. Transcribing actual Python code is straightforward. Until you come to an import of a module that you can't find, bec

Re: Improving performance in matrix operations

2016-03-09 Thread Fabien
On 03/09/2016 09:09 PM, Drimades wrote: Another thing to consider is that matrices I'm processing are heavily sparse. Did you look at scipy.sparse.linalg ? http://docs.scipy.org/doc/scipy/reference/sparse.linalg.html -- https://mail.python.org/mailman/listinfo/python-list

Improving performance in matrix operations

2016-03-09 Thread Drimades
I'm doing some tests with operations on numpy matrices in Python. As an example, it takes about 3000 seconds to compute eigenvalues and eigenvectors using scipy.linalg.eig(a) for a matrix 6000x6000. Is it an acceptable time? Any suggestions to improve? Does C++ perform better with matrices? Anot

Re: Creating barrel distortion of video

2016-03-09 Thread semeon . risom
On Tuesday, 8 March 2016 19:46:18 UTC-6, Ben Finney wrote: > semeon.ri...@gmail.com writes: > > > This may seem like an odd request for the main python google group > > (Note that this is not a Google group. Google may be presenting this > forum to you, but it's not exclusive to Google and many

Re: Creating barrel distortion of video

2016-03-09 Thread semeon . risom
On Tuesday, 8 March 2016 19:53:10 UTC-6, Chris Angelico wrote: > On Wed, Mar 9, 2016 at 12:32 PM, wrote: > > This may seem like an odd request for the main python google group, but I > > thought this question might have answers coming from different backgrounds > > that utilize python. > > > >

Re: it doesn't want to open

2016-03-09 Thread sohcahtoa82
On Wednesday, March 9, 2016 at 10:40:27 AM UTC-8, mashaer elmekki wrote: > Sent from Windows Mail Did you try to attach a screenshot or something? This mailing list is text only. Your attachment will be removed. -- https://mail.python.org/mailman/listinfo/python-list

Re: it doesn't want to open

2016-03-09 Thread Rick Johnson
On Wednesday, March 9, 2016 at 12:48:45 PM UTC-6, Grant Edwards wrote: > Um, twist it the other way? I don't think he's trying to open a can Grant, this sounds like a *REAL* emergency. My guess is that he is emailing us from the toilet because he needs advice on how to free a stuck zipper. Unfor

Re: exit from Tkinter mainloop Python 2.7

2016-03-09 Thread Rick Johnson
On Friday, March 4, 2016 at 3:50:43 PM UTC-6, kevin...@gmail.com wrote: > Thanks for your attention to this matter. > My code now look like this: [...] All of the help offered in this thread ignores the elephant in the room. What are you trying to achieve here Kevin? To me, this looks like some so

Re: even faster heaps

2016-03-09 Thread Sven R. Kunze
On 09.03.2016 19:19, Sven R. Kunze wrote: ps: there are two error's when i ran tests with test_xheap. Damn. I see this is Python 2 and Python 3 related. Thanks for bringing this to my attention. I am going to fix this soon. Fixed. -- https://mail.python.org/mailman/listinfo/python-list

Re: it doesn't want to open

2016-03-09 Thread Grant Edwards
Um, twist it the other way? -- Grant Edwards grant.b.edwardsYow! Excuse me, but didn't at I tell you there's NO HOPE gmail.comfor the survival of OFFSET

Re: even faster heaps

2016-03-09 Thread Sven R. Kunze
On 06.03.2016 14:59, Sven R. Kunze wrote: Using the original xheap benchmark , I could see huge speedups: from 50x/25x down to 3x/2x compared to heapq. That's a massive improvement. I will publish an update soon. An here it is: http

it doesn't want to open

2016-03-09 Thread mashaer elmekki
Sent from Windows Mail -- https://mail.python.org/mailman/listinfo/python-list

RE: Adding Icon To Tkinter Window - Followup

2016-03-09 Thread Joaquin Alzola
> root.wm_iconphoto(True, img) What are the images format allowed? This email is confidential and may be subject to privilege. If you are not the intended recipient, please do not copy or disclose its content but contact the sender immediately upon receipt. -- https://mail.python.org/mailm

pip install failure for cryptography, gnureadline

2016-03-09 Thread Pietro Paolini
Hi everybody, I am not really familiar with the Py subsystem, even though I have got some guidance from some colleague, I am getting stuck when installing a list of packages contained in a file, running such command : pip install -r /home/pietro/projects/cloud-provisioning/requirements.txt Brin

Re: even faster heaps

2016-03-09 Thread Sven R. Kunze
On 08.03.2016 08:12, srinivas devaki wrote: Hi, sorry i didn't get to your last mail as i'm having exams at that time. No problem. :) I hope they went all well for you. Everything is good so far. but if at all the purpose is to add features to the stdlib heap and keeping the speed offered by

Re: turtle ??

2016-03-09 Thread MRAB
On 2016-03-09 11:55, Steven D'Aprano wrote: On Wed, 9 Mar 2016 08:06 pm, Peter Otten wrote: Ömer sarı wrote: l would like to ask a question as l m a little bit confused . In computing details matter, and in communication odd personal habits distract from the actual message. Please reconside

Re: Public Service Announcement: planetpython.org

2016-03-09 Thread Mark Lawrence
On 09/03/2016 15:27, Tim Golden wrote: For those who didn't know, we have a feed aggregator at https://planetpython.org. We're trying to clean up out-of-date or incorrect feed URLs. This is available from news.gmane.org as gwene.org.python.planet I just wish that I'd found out about the one s

Re: Adding Icon To Tkinter Window - Followup

2016-03-09 Thread Serhiy Storchaka
On 06.03.16 18:30, Wildman via Python-list wrote: That does not work... $ ./makexface.py Traceback (most recent call last): File "./makexface.py", line 236, in root.wm_iconphoto(True, img) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1897, in __getattr__ return getattr(self

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Wed, 9 Mar 2016 11:53 pm, Marko Rauhamaa wrote: > It came off as standard schoolyard bullying. You must have lived a privileged life if you think a little sarcasm is what school bullies do. If we're going to exchange pop psychology tales, I don't know what it's like for young girls, but in my

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread BartC
On 09/03/2016 14:57, Steven D'Aprano wrote: On Thu, 10 Mar 2016 01:11 am, Chris Angelico wrote: The first three bytes are the "UTF-8 BOM", which suggests you may have created this in a broken editor like Notepad. Notepad may be horribly crippled, but I'm not entirely sure "broken" is the righ

Re: Adding Icon To Tkinter Window

2016-03-09 Thread Rick Johnson
On Saturday, March 5, 2016 at 3:39:00 PM UTC-6, Terry Reedy wrote: > No single simple statement work for all situations. You should have > specified OS, Python version, and tcl/tk version. (IDLE's Help -> About > IDLE displays full tk version). Yes, because Tkinter is not as cross-platform as

Re: Adding Icon To Tkinter Window

2016-03-09 Thread Rick Johnson
On Saturday, March 5, 2016 at 12:08:27 PM UTC-6, Grant Edwards wrote: > You'll have to be a lot more specific about what you mean by "add an > icon to a window". Do you just want to display an .ico file within a > window? I think he wants to use his *OWN* icon on a window's title bar, instead of

[ANN] First PyCon Israel (May 2,3)

2016-03-09 Thread Miki Tebeka
Greetings, The first PyCon Israel is happening! It's taking place on May 2-3, 2016, will be attended by hundreds of Pythonistas, and is sponsored by major international and local companies that use Python as part of their daily work. CFP is open, please head over to http://il.pycon.org/2016/ to

Re: A mistake which almost went me mad

2016-03-09 Thread Rick Johnson
On Thursday, March 3, 2016 at 4:22:07 AM UTC-6, ast wrote: > Hello > > This has to be told > > I created a file pickle.py in order to test some files > read/write with objects and put it in a directory > which is on my python path. > > Then the nightmare began > > - Idle no longer works, windo

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Wed, 9 Mar 2016 01:03 pm, Dennis Lee Bieber wrote: > On Wed, 09 Mar 2016 10:28:40 +1100, Steven D'Aprano > declaimed the following: > > >> >>Python will never expand \n to \r\n. But it may translate \r\n to \n. >> > Not on input, but it will on output (on Windows) That surprises me. Perhaps

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 2:33 AM, Steven D'Aprano wrote: > On Thu, 10 Mar 2016 01:54 am, Chris Angelico wrote: > >> I have a source of occasional text files that basically just dumps >> stuff on me without any metadata, and I have to figure out (a) what >> the encoding is, and (b) what language the

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Terry Reedy
On 3/9/2016 9:03 AM, BartC wrote: I've just tried a UTF-8 file and getting some odd results. With a file containing [three euro symbols]: €€€ (including a 3-byte utf-8 marker at the start), and opened in text mode, Python 3 gives me this series of bytes (ie. the ord() of each character): 239

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 02:06 am, Jon Ribbens wrote: > On 2016-03-09, Steven D'Aprano wrote: >> generate the output. Without seeing the code you used, I have *no idea* >> how you could get that result. If you read the file in binary, you should >> get this: >> >> b'\xef\xbb\xbf\xe2\x82\xac\xe2\x82\xa

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 01:54 am, Chris Angelico wrote: > I have a source of occasional text files that basically just dumps > stuff on me without any metadata, and I have to figure out (a) what > the encoding is, and (b) what language the text is in. https://pypi.python.org/pypi/chardet > then I ha

Re: turtle ??

2016-03-09 Thread Terry Reedy
On 3/9/2016 2:39 AM, Ömer sarı wrote: import turtle # Allows us to use turtles wn = turtle.Screen() # Creates a playground for turtles alex = turtle.Turtle()# Create a turtle, assign to alex alex.forward(50) # Tell alex to move forward by 50 units alex.left(

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 01:39 am, BartC wrote: > This is the code: > > f=open("input","r") > t=f.read(1000) > f.close() If you don't give read an argument, it will try to read the entire file: t = f.read() > print ("T",type(t),len(t)) > print (t) > for i in t: > print (ord(i)) > > This does

Public Service Announcement: planetpython.org

2016-03-09 Thread Tim Golden
For those who didn't know, we have a feed aggregator at https://planetpython.org. We're trying to clean up out-of-date or incorrect feed URLs. Planet Python config & (occasional) development happens on Github. So please check the Planet config files [1] to see if your blog is listed correctly, or

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Tim Golden
On 09/03/2016 15:06, Jon Ribbens wrote: > On 2016-03-09, Steven D'Aprano wrote: >> generate the output. Without seeing the code you used, I have *no idea* how >> you could get that result. If you read the file in binary, you should get >> this: >> >> b'\xef\xbb\xbf\xe2\x82\xac\xe2\x82\xac\xe2\x82\

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Jon Ribbens
On 2016-03-09, Steven D'Aprano wrote: > generate the output. Without seeing the code you used, I have *no idea* how > you could get that result. If you read the file in binary, you should get > this: > > b'\xef\xbb\xbf\xe2\x82\xac\xe2\x82\xac\xe2\x82\xac' > > Or in decimal: > > 239, 187, 191, 226,

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 1:57 AM, Steven D'Aprano wrote: > On Thu, 10 Mar 2016 01:11 am, Chris Angelico wrote: > >> The first three bytes are the "UTF-8 BOM", which suggests you may have >> created this in a broken editor like Notepad. > > Notepad may be horribly crippled, but I'm not entirely sure

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 01:03 am, BartC wrote: > On 09/03/2016 02:18, Steven D'Aprano wrote: >> On Wed, 9 Mar 2016 12:28 pm, BartC wrote: >> >>> (Which wasn't as painful as I'd expected. However the next project I >>> have in mind is 20K lines rather than 0.7K. For that I'm looking at some >>> mechani

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 1:39 AM, BartC wrote: > On 09/03/2016 14:11, Chris Angelico wrote: >> >> On Thu, Mar 10, 2016 at 1:03 AM, BartC wrote: >>> >>> I've just tried a UTF-8 file and getting some odd results. With a file >>> containing [three euro symbols]: >>> >>> €€€ >>> >>> (including a 3-byt

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Jon Ribbens
On 2016-03-09, BartC wrote: > (Isn't it better that it's automatic? Someone sends you a text file that > you want to open within a Python program. Are you supposed to analyze it > first, or expect the sender to tell you what it is (they probably won't > know) then need to hack the program to re

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Thu, 10 Mar 2016 01:11 am, Chris Angelico wrote: > The first three bytes are the "UTF-8 BOM", which suggests you may have > created this in a broken editor like Notepad. Notepad may be horribly crippled, but I'm not entirely sure "broken" is the right word for it. Does it do anything *wrong*?

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread BartC
On 09/03/2016 14:11, Chris Angelico wrote: On Thu, Mar 10, 2016 at 1:03 AM, BartC wrote: I've just tried a UTF-8 file and getting some odd results. With a file containing [three euro symbols]: €€€ (including a 3-byte utf-8 marker at the start), and opened in text mode, Python 3 gives me this

Re: turtle ??

2016-03-09 Thread Joel Goldstick
On Wed, Mar 9, 2016 at 6:55 AM, Steven D'Aprano wrote: > On Wed, 9 Mar 2016 08:06 pm, Peter Otten wrote: > > > Ömer sarı wrote: > > > >> l would like to ask a question as l m a little bit confused . > > > > In computing details matter, and in communication odd personal habits > > distract from th

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Chris Angelico
On Thu, Mar 10, 2016 at 1:03 AM, BartC wrote: > I've just tried a UTF-8 file and getting some odd results. With a file > containing [three euro symbols]: > > €€€ > > (including a 3-byte utf-8 marker at the start), and opened in text mode, > Python 3 gives me this series of bytes (ie. the ord() of

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread BartC
On 09/03/2016 02:18, Steven D'Aprano wrote: On Wed, 9 Mar 2016 12:28 pm, BartC wrote: (Which wasn't as painful as I'd expected. However the next project I have in mind is 20K lines rather than 0.7K. For that I'm looking at some mechanical translation I think. And probably some library to wrap a

Re: Reason for not allowing import twice but allowing reload()

2016-03-09 Thread Steven D'Aprano
Sorry for the delay in answering! On Sat, 5 Mar 2016 11:51 pm, alien2u...@gmail.com wrote: > Steven, > >> There are better ways to manage your Python path than to manually insert >> paths into sys.path like that. What version of Python are you using? > > I would love to know, apart from PYTHONP

Re: Python path

2016-03-09 Thread Steven D'Aprano
On Wed, 9 Mar 2016 06:29 pm, ast wrote: > Hello > > Python path may be read with: > import sys sys.path > > There is an environnement variable $PYTHONPATH (windows) > to set if you want to add some additionnal directories to the > path. > > But the default path seems not to be stored

Re: Question

2016-03-09 Thread Jon Ribbens
On 2016-03-08, Steven D'Aprano wrote: > On Wed, 9 Mar 2016 04:19 am, Ian Kelly wrote: >> On Mon, Mar 7, 2016 at 6:41 PM, Jon Ribbens >> wrote: >>> 'virtualenv' works even less well, it just says: >>> >>> $ virtualenv test >>> Using base prefix 'd:\\program files (x86)\\python35-32' >>> New python

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Marko Rauhamaa
Steven D'Aprano : > On Wed, 9 Mar 2016 05:08 pm, Marko Rauhamaa wrote: > >> Steven D'Aprano : >> >>> Possibly a really amateurish, lazy job, but still done. >>> >>> [...] Brilliant! I love helpful tools like that! >>> >>> How many years did you say you have been programming? >> >> Let's keep it

Re: Question

2016-03-09 Thread Jon Ribbens
On 2016-03-09, Ian Kelly wrote: > It looks like the shell environment that comes with Git for Windows is > actually Windows Powershell [1], so presumably the activate.ps1 script > that's already provided by venv is what's needed, not a bash script. This is not true. I installed Git for Windows an

Re: Review Request of Python Code

2016-03-09 Thread Matt Wheeler
On 9 March 2016 at 12:06, Matt Wheeler wrote: > But we can still do better. A list is a poor choice for this kind of > lookup, as Python has no way to find elements other than by checking > them one after another. (given (one of the) name(s) you've given it > sounds a bit like "dictionary" I assum

Re: Review Request of Python Code

2016-03-09 Thread Matt Wheeler
I'm just going to focus on a couple of lines as others are already looking at the whole thing: On 9 March 2016 at 04:18, wrote: > [snip]. > if word in a4: > [stuff] > elif word not in a4: > [other stuff] >

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread BartC
On 09/03/2016 08:40, Mark Lawrence wrote: On 08/03/2016 23:59, Steven D'Aprano wrote: On Wed, 9 Mar 2016 06:15 am, BartC wrote: [...] But this was hardly necessary as it was so obvious: it takes 150ms to process a 300-pixel image, 20 seconds for a 2Mpixel one, and (I have to switch to PyPy her

Re: turtle ??

2016-03-09 Thread Steven D'Aprano
On Wed, 9 Mar 2016 08:06 pm, Peter Otten wrote: > Ömer sarı wrote: > >> l would like to ask a question as l m a little bit confused . > > In computing details matter, and in communication odd personal habits > distract from the actual message. Please reconsider your use of an "l" as > a replacem

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Steven D'Aprano
On Wed, 9 Mar 2016 05:08 pm, Marko Rauhamaa wrote: > Steven D'Aprano : > >> Possibly a really amateurish, lazy job, but still done. >> >> [...] Brilliant! I love helpful tools like that! >> >> How many years did you say you have been programming? > > Let's keep it civil, please. Oh, you're no

Re: Pickle __getstate__ __setstate__ and restoring n/w - beazley pg 172

2016-03-09 Thread Veek. M
dieter wrote: > "Veek. M" writes: > >> import socket >> class Client(object): >> def __init__(self,addr): >> self.server_addr = addr >> self.sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) >> self.sock.connect(addr) >> >> def __getstate__(self): >> return self.server_addr >>

Re: Review Request of Python Code

2016-03-09 Thread Friedrich Rentsch
On 03/09/2016 05:18 AM, subhabangal...@gmail.com wrote: Dear Group, I am trying to write a code for pulling data from MySQL at the backend and annotating words and trying to put the results as separated sentences with each line. The code is generally running fine but I am feeling it may be b

Re: turtle ??

2016-03-09 Thread Peter Otten
Ömer sarı wrote: > l would like to ask a question as l m a little bit confused . In computing details matter, and in communication odd personal habits distract from the actual message. Please reconsider your use of an "l" as a replacement for "I". > l do practice > in "how to think like a comp

Re: Pyhon 2.x or 3.x, which is faster?

2016-03-09 Thread Mark Lawrence
On 08/03/2016 23:59, Steven D'Aprano wrote: On Wed, 9 Mar 2016 06:15 am, BartC wrote: [...] But this was hardly necessary as it was so obvious: it takes 150ms to process a 300-pixel image, 20 seconds for a 2Mpixel one, and (I have to switch to PyPy here as I've never had time to hang about for

Re: Pickle __getstate__ __setstate__ and restoring n/w - beazley pg 172

2016-03-09 Thread dieter
"Veek. M" writes: > import socket > class Client(object): > def __init__(self,addr): > self.server_addr = addr > self.sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) > self.sock.connect(addr) > > def __getstate__(self): > return self.server_addr > > def __setstate__(self,valu