Re: Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 5:30 PM, Dave Angel wrote: > On Thu, 19 Dec 2013 16:32:37 +0100, Wolfgang Keller > wrote: >> >> With Windows it *is* "normal". An experienced software developer >> once even explained the reason to me. When a single process on > > Windows >> >> does I/O, then the system es

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Dave Angel
On Thu, 19 Dec 2013 16:32:37 +0100, Wolfgang Keller wrote: With Windows it *is* "normal". An experienced software developer once even explained the reason to me. When a single process on Windows does I/O, then the system essentially falls back to "single tasking". Or (non-)"cooperative mult

How to use the method loadtxt() of numpy neatly?

2013-12-19 Thread chao dong
HI, everybody. When I try to use numpy to deal with my dataset in the style of csv, I face a little problem. In my dataset of the csv file, some columns are string that can not convert to float easily. Some of them can ignore, but other columns I need to change the data to a enum st

RE: Regular Expression : Bad Character Range

2013-12-19 Thread Frank Cui
should have escaped hyphen as it could be used for ranging. sorry for the bother... From: y...@outlook.com To: python-list@python.org Subject: Regular Expression : Bad Character Range Date: Thu, 19 Dec 2013 23:50:52 -0300 Hey guys, I'm trying to compile a regular Expression while encounteri

Regular Expression : Bad Character Range

2013-12-19 Thread Frank Cui
Hey guys, I'm trying to compile a regular Expression while encountering the following issue, any hints ? is hyphen "-" or underscore "_" considered any meta character which is not allowed when putting into the range ? Thanks Frank In [2]: re.compile("[\w-_]+>") ---

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Steven D'Aprano
On Thu, 19 Dec 2013 19:38:51 -0500, Roy Smith wrote: > In article <52b328f7$0$6512$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Correct. The *great deal of trouble* part is important. Things which >> are the responsibility of the language and compiler in (say) Java, D, >>

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Rhodri James
On Fri, 20 Dec 2013 00:38:51 -, Roy Smith wrote: I disagree entirely (but respectfully). If you want to get down to the hardware where you can fiddle bits, you want as little getting between you and the silicon as possible. Every time you add a safety feature, you put another layer of *st

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Roy Smith
In article <52b328f7$0$6512$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Correct. The *great deal of trouble* part is important. Things which are > the responsibility of the language and compiler in (say) Java, D, Rust, > Go, etc. are the responsibility of the programmer with

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Roy Smith
In article <52b365b6$0$6512$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: [some stuff] > where Unix went, so did C; [some more stuff] What he said. -- https://mail.python.org/mailman/listinfo/python-list

Re: Determining whether a glyph is available in Tkinter

2013-12-19 Thread wmcbrine
On Monday, December 16, 2013 10:58:06 PM UTC-5, Terry Reedy wrote: > I would not assume that the default covers more than ascii. In this case, I already know that the glyphs I chose work with the default fonts for OS X 10.4+ and Windows 7+, but not for (for example) Win XP. > But to answer your

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Steven D'Aprano
On Thu, 19 Dec 2013 04:50:54 +, Mark Lawrence wrote: > If C is such a crap language, what does it says for the thousands of > languages that never got anywhere? Or did C simply have a far larger > sales and marketing budget? :) The sociology of computer languages is a fascinating topic. Like

Re: PDFMiner install question

2013-12-19 Thread MRAB
On 19/12/2013 19:36, Jason Mellone wrote: MRAB: Thank you your exact solution worked perfectly. Now I am trying to run some code from (http://www.unixuser.org/~euske/python/pdfminer/programming.html) under basic usage. If I try to run from pdfminer.pdfparser import PDFParser from pdfminer.pd

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 7:42 AM, Gregory Ewing wrote: > A piece of code such as > >for (i = 0; i < numThings; i++) > total[i] += things[i]; > > is NOT improved by rewriting it as > >for (theLoopIndex = 0; theLoopIndex < numThings; theLoopIndex++) > total[theLoopIndex] += things

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Gregory Ewing
Wolfgang Keller wrote: In fact, thinking of it, a really good language should imho *require* verbosity (how about a *minimum* length - or maybe even a dictionary-based sanity check - for identifiers?), since that already keeps all those lazy morons away who think that "shortcuts are cool". No,

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 5:40 AM, Neil Cerutti wrote: > And another thing: How many other languages have their very own > calling convention? Pascal does (sometimes called the Win32 convention). ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: PDFMiner install question

2013-12-19 Thread Jason Mellone
MRAB: Thank you your exact solution worked perfectly. Now I am trying to run some code from (http://www.unixuser.org/~euske/python/pdfminer/programming.html) under basic usage. If I try to run from pdfminer.pdfparser import PDFParser from pdfminer.pdfdocument import PDFDocument from pdfminer.

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Neil Cerutti
On 2013-12-19, Chris Angelico wrote: > On Fri, Dec 20, 2013 at 4:12 AM, Steven D'Aprano > wrote: >> But why is so much non-performance critical code written in C? >> Why so many user-space applications? > > Very good question! I don't have an answer. There are a few > "maybe-answers", but they mos

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 4:12 AM, Steven D'Aprano wrote: > But why is so much non-performance critical code written in C? Why so > many user-space applications? Very good question! I don't have an answer. There are a few "maybe-answers", but they mostly come down to "programmer didn't know of a vi

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread rusi
> On Thursday, December 19, 2013 9:46:26 AM UTC+5:30, Roy Smith wrote: > > rusi wrote: > > > Soon the foo has to split into foo1.c and foo2.c. And suddenly you need > > > to > > > understand: > > > 1. Separate compilation > > > 2. Make (which is separate from 'separate compilation') > > > 3. H

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 4:06 AM, Steven D'Aprano wrote: > Should some implementation decide to compile that away as dead > code, it would be perfectly allowed to. (Well, assuming that it > determined first that locals() actually was the built-in and not some > substitute, either by static analysis

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Steven D'Aprano
On Wed, 18 Dec 2013 17:15:30 +, Mark Lawrence wrote: > On 18/12/2013 08:18, Steven D'Aprano wrote: >> >> The C99 standard lists 191 different kinds of undefined behavior, >> including what happens when there is an unmatched ' or " on a line of >> source code. >> >> No compile-time error, no ru

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Steven D'Aprano
On Wed, 18 Dec 2013 17:33:49 -0500, Terry Reedy wrote: > On 12/18/2013 3:18 AM, Steven D'Aprano wrote: > >> We don't know what locals()['spam'] = 42 will do inside a function, > > I am mystified that you would write this. Context is everything. locals() doesn't just return any old dictionary.

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 3:20 AM, Steven D'Aprano wrote: > On Wed, 18 Dec 2013 19:51:26 +1100, Chris Angelico wrote: > >> On Wed, Dec 18, 2013 at 7:18 PM, Steven D'Aprano >> wrote: >>> You want to know why programs written in C are so often full of >>> security holes? One reason is "undefined beha

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Steven D'Aprano
On Wed, 18 Dec 2013 19:51:26 +1100, Chris Angelico wrote: > On Wed, Dec 18, 2013 at 7:18 PM, Steven D'Aprano > wrote: >> You want to know why programs written in C are so often full of >> security holes? One reason is "undefined behaviour". The C language >> doesn't give a damn about writing *cor

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Steven D'Aprano
On Wed, 18 Dec 2013 07:23:54 -0800, Ethan Furman wrote: > On 12/18/2013 12:18 AM, Steven D'Aprano wrote: >> And yes, I'm being pedantic. > > No, you're being an ass. My my, it doesn't take much of a challenge to the Holy Church Of C to bring out the personal attacks. -- Steven -- https://m

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Chris Angelico
On Fri, Dec 20, 2013 at 2:32 AM, Wolfgang Keller wrote: > With Windows it *is* "normal". An experienced software developer > once even explained the reason to me. When a single process on Windows > does I/O, then the system essentially falls back to "single tasking". > Or (non-)"cooperative multit

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Wolfgang Keller
> > With Windows systems, I waste something like 90% of my work time > > waiting for that system to stop "Not Responding". > > > > And no, it's not a matter of hardware. > > Something is wrong then. You bet. > Windows has its issues, and it does slow down over time as cruft in > the system accu

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Ned Batchelder
On 12/19/13 10:10 AM, Wolfgang Keller wrote: All Java GUI frameworks I know of are ridiculous garbage. Not only that Java per se is obscenely fat (and unresponsive), but the GUI frameworks leak like bottomless barrels and the look and feel is so hideous that I would say from personal experience

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Wolfgang Keller
> > I've never heard C syntax reviled quite so intensely. What syntax > > do you like, out of curiosity? > > Pascal, Python, if written by someone who uses semantic identifiers > and avoids to use C(++)/Java-isms. I've seen Eiffel as well (without > understanding it) and it didn't look ridiculous

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Wolfgang Keller
> > All Java GUI frameworks I know of are ridiculous garbage. > > > > Not only that Java per se is obscenely fat (and unresponsive), but > > the GUI frameworks leak like bottomless barrels and the look and > > feel is so hideous that I would say from personal experience with > > numerous Java appl

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Wolfgang Keller
> I find it frustrating that Pythonistas shy away from regex as much as > they do. I find regular expression syntax frustrating. >;-> As long as I have the choice, I still prefer syntax like e.g. VerbalExpressions. That's made for actual humans like me. Sincerely, Wolfgang -- https://mail.pyt

Re: request for guidance

2013-12-19 Thread Wolfgang Keller
> I am a novice who is really interested in contributing to Python > projects. How and where do I begin? You're looking for work? Try: https://wiki.python.org/moin/PythonProjects http://www.python.org/about/apps/ https://wiki.python.org/moin/Applications http://en.wikipedia.org/wiki/List_of_Pyth

Use of Python for teaching geometry.

2013-12-19 Thread Roy Smith
https://www.facebook.com/photo.php?fbid=688904791141196&set=a.46529938016 8406.10.465298390168505&type=1&theater Shortened version: http://tinyurl.com/kvtcye9 -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-19 Thread Dave Angel
On Thu, 19 Dec 2013 19:41:00 +1300, Gregory Ewing wrote: But it's not above inferring a dereferencing operation when you call a function via a pointer. If f is a pointer to a function, then f(a) is equivalent to (*f)(a) If the compiler can do that for function calls, ther

Re: win32api.SetCursorPos() question

2013-12-19 Thread 桌面事业部
You should write like that: win32api.SetCursorPos((100,100)) (100,100) is a point value -- https://mail.python.org/mailman/listinfo/python-list

Re: Reading csv file

2013-12-19 Thread Scott Jewloszewicz-Clarke
You didn't pass in self as the first arg to open. This is necessary. S On 19 December 2013 09:22, Igor Korot wrote: > Hi, Peter, > Thank you for the great suggestion. > > I tried to implement you code but failed. > > Here's what I have: > > class FileReader: > def __init__(self, filena

Re: Reading csv file

2013-12-19 Thread Peter Otten
Igor Korot wrote: > Hi, Peter, > Thank you for the great suggestion. > > I tried to implement you code but failed. > > Here's what I have: > > class FileReader: > def __init__(self, filename, isSkip): > self.path = filename > self.isSkip = isSkip > >

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Mark Lawrence
On 19/12/2013 09:10, wxjmfa...@gmail.com wrote: Le jeudi 19 décembre 2013 09:25:14 UTC+1, Mark Lawrence a écrit : On 19/12/2013 08:10, wxjmfa...@gmail.com wrote: Same experience with PyQt4. Py 3.2 : PyQt4.QtCore.PYQT_VERSION_STR -> 4.8.6 Py 3.3 : PyQt4.QtCore.PYQT_VERSION_STR -

Re: Reading csv file

2013-12-19 Thread Igor Korot
Hi, Peter, Thank you for the great suggestion. I tried to implement you code but failed. Here's what I have: class FileReader: def __init__(self, filename, isSkip): self.path = filename self.isSkip = isSkip @contextmanager def open(*args):

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread wxjmfauth
Le jeudi 19 décembre 2013 09:25:14 UTC+1, Mark Lawrence a écrit : > On 19/12/2013 08:10, wxjmfa...@gmail.com wrote: > > > > > > > > Same experience with PyQt4. > > > > > > Py 3.2 : PyQt4.QtCore.PYQT_VERSION_STR -> 4.8.6 > > > Py 3.3 : PyQt4.QtCore.PYQT_VERSION_STR -> 4.10 > > > > > > jmf >

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread Mark Lawrence
On 19/12/2013 08:10, wxjmfa...@gmail.com wrote: Same experience with PyQt4. Py 3.2 : PyQt4.QtCore.PYQT_VERSION_STR -> 4.8.6 Py 3.3 : PyQt4.QtCore.PYQT_VERSION_STR -> 4.10 jmf Your point being? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our

Re: python - jquery datatables with mongodb(mongoengine)

2013-12-19 Thread Peter Otten
renier de bruyn wrote: > UPDATE: > > So now I got this code: > > import pymongo > from pyramid_mongo import get_db > > # translation for sorting between datatables api and mongodb > order_dict = {'asc': 1, 'desc': -1} > > > class DataTables_Handler(object): > def __init__(self, request, c

Re: Is it more CPU-efficient to read/write config file or read/write sqlite database?

2013-12-19 Thread Chris Angelico
On Thu, Dec 19, 2013 at 6:56 PM, Cameron Simpson wrote: > On 18Dec2013 21:50, Chris Angelico wrote: >> It's fundamentally about crash recovery, [...] >> Databases protect against that. If you want that protection, use a >> database. If you don't, use a file. There's nothing wrong with either >> o

Re: Is it more CPU-efficient to read/write config file or read/write sqlite database?

2013-12-19 Thread Cameron Simpson
On 18Dec2013 21:50, Chris Angelico wrote: > It's fundamentally about crash recovery, [...] > Databases protect against that. If you want that protection, use a > database. If you don't, use a file. There's nothing wrong with either > option. Look, broadly I agree. But this thread was about sharin

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-19 Thread wxjmfauth
Le mardi 17 décembre 2013 20:00:14 UTC+1, wxjm...@gmail.com a écrit : > Le mardi 17 décembre 2013 19:06:35 UTC+1, Michael Torrie a écrit : > > > On 12/17/2013 08:00 AM, Wolfgang Keller wrote: > > > > > > >> Python is sooo slow when it waits for the human. > > > > > > > > > > > > > >