Re: Writing code to be optimizable

2011-11-22 Thread Stefan Behnel
snorble, 23.11.2011 06:19: Sometimes I want to prototype a program in Python, with the idea of optimizing it later by rewriting parts of it in C or Cython. But I usually find that in order to rewrite the slow parts, I end up writing those parts very much like C or C++ anyway, and I end up wonderi

RE: What I do and do not know about installing Python on Win 7 withregard to IDLE.

2011-11-22 Thread Alemu Tadesse
I just subscribed for python and I am VERY NEW. I would like to have a an IDLE. My texts are just the same whether it is comment or def or statement or .. how am I going to make it highlighted ..my scientific package is not working and complaining about not able to find/load DLL ... frustrating

Re: Writing code to be optimizable

2011-11-22 Thread Chris Angelico
On Wed, Nov 23, 2011 at 4:19 PM, snorble wrote: > Sometimes I want to prototype a program in Python, with the idea of > optimizing it later by rewriting parts of it in C or Cython. But I > usually find that in order to rewrite the slow parts, I end up writing > those parts very much like C or C++

Writing code to be optimizable

2011-11-22 Thread snorble
Sometimes I want to prototype a program in Python, with the idea of optimizing it later by rewriting parts of it in C or Cython. But I usually find that in order to rewrite the slow parts, I end up writing those parts very much like C or C++ anyway, and I end up wondering what is the point of using

Thread problem

2011-11-22 Thread Nikunj.Badjatya
Howdy All, Please see http://pastebin.com/GuwH8B5C . Its a sample program implementing progressbar in multithreaded program. Here I am creating a thread and passing update2() function to it. Now wheneever I press CTRL-C, the program isnt returning to prompt. ! Can someone help me out with this p

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread W. eWatson
On 11/22/2011 7:29 PM, W. eWatson wrote: On 11/22/2011 11:29 AM, Alan Meyer wrote: On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's C:\Python26\Lib\site-packages\pythonwin\Pythonwin.exe Alan OK, I'm going

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/22/2011 3:05 PM, Dennis Lee Bieber wrote: On Tue, 22 Nov 2011 14:29:18 -0500, Alan Meyer declaimed the following in gmane.comp.python.general: On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's C:\P

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread W. eWatson
On 11/22/2011 11:29 AM, Alan Meyer wrote: On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's C:\Python26\Lib\site-packages\pythonwin\Pythonwin.exe Alan OK, I'm going to try it soon. Keeping my fingers crossed

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Terry Reedy
On 11/22/2011 1:01 PM, Dennis Lee Bieber wrote: c:\Python32 Start in, and for Target: Python 3.2.2 (64-bit) Which tells me that the TARGET field is garbaged, The above is exactly what my IDLE shortcut target field says, and it works fine. since THAT is what specifies the program

Re: What replaces log4py under Python 3.2?

2011-11-22 Thread Irmen de Jong
On 22-11-11 19:32, Rob Richardson wrote: Greetings! My company has been using the log4py library for a long time. A co-worker recently installed Python 3.2, and log4py will no longer compile. (OK, I know that's the wrong word, but you know what I mean.) What logging package should be used

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/22/2011 1:55 PM, Alan Meyer wrote: ... 6. Select, or navigate to and select, the python IDLE interpreter. ... On my system that's C:\Python26\Lib\site-packages\pythonwin\Pythonwin.exe Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Andrea Crotti
On 11/22/2011 04:14 PM, W. eWatson wrote: > Your joking, right, or do you just prefer 500 line threads wandering > all over the place? I would personally prefer to just not see useless discussions about Windows set up in a python mailing list, but I guess it's a price to pay for the popularity of

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread Alan Meyer
On 11/21/2011 11:39 AM, W. eWatson wrote: My criterion for success is that it puts IDLE as a choice for editor on the menu produced with a right-click on a py file. So far no response on this has solved the problem. ... I don't know what responses you're referring to since this is the first

Re: Using the Python Interpreter as a Reference

2011-11-22 Thread Alan Meyer
On 11/20/2011 7:46 PM, Travis Parks wrote: Hello: I am currently working on designing a new programming language. ... I have great respect for people who take on projects like this. Your chances of popularizing the language are small. There must be thousands of projects like this for every

What replaces log4py under Python 3.2?

2011-11-22 Thread Rob Richardson
Greetings! My company has been using the log4py library for a long time. A co-worker recently installed Python 3.2, and log4py will no longer compile. (OK, I know that's the wrong word, but you know what I mean.) What logging package should be used now? Thank you. RobR -- http://mail.pyth

Re: decorators and closures

2011-11-22 Thread 88888 Dihedral
On Monday, November 21, 2011 10:44:34 PM UTC+8, Andrea Crotti wrote: > With one colleague I discovered that the decorator code is always > executed, every time I call > a nested function: > > def dec(fn): > print("In decorator") > def _dec(): > fn() > > return _dec > > d

Re: Strange logging.Formatter behaviour

2011-11-22 Thread Vinay Sajip
On Nov 22, 3:19 pm, Tiaburn Stedd wrote: > I don't believe this behavior is normal. I expect error raised in a > Formatter.format function, should be passed all the way up, but not > consumed. > > I found a workaround: > > class CustomFileHandler(logging.FileHandler, object): >     def handleError

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread W. eWatson
On 11/21/2011 7:00 PM, alex23 wrote: "W. eWatson" wrote: Comments? Please don't start multiple threads on the same issue. Your joking, right, or do you just prefer 500 line threads wandering all over the place? -- http://mail.python.org/mailman/listinfo/python-list

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread W. eWatson
On 11/21/2011 3:07 PM, Terry Reedy wrote: On 11/21/2011 11:39 AM, W. eWatson wrote: My criterion for success is that it puts IDLE as a choice for editor on the menu produced with a right-click on a py file. Your first criterion for success should be that IDLE runs at all, which is apparently

Re: What I do and do not know about installing Python on Win 7 with regard to IDLE.

2011-11-22 Thread W. eWatson
On 11/21/2011 11:21 AM, Dennis Lee Bieber wrote: On Mon, 21 Nov 2011 08:39:37 -0800, "W. eWatson" declaimed the following in gmane.comp.python.general: My criterion for success is that it puts IDLE as a choice for editor on the menu produced with a right-click on a py file. So far no respons

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-22 Thread becky_lewis
On Nov 15, 8:37 pm, Passiday wrote: > Hello, > > I am looking for a way how to bring Python interpreter to JavaScript, in > order to provide a web-based application with python scripting capabilities. > The app would have basic IDE for writing and debugging the python code, but > the interpreta

Strange logging.Formatter behaviour

2011-11-22 Thread Tiaburn Stedd
Hello, all! I'm working on specific project and have a curious task where I need to use specific formatter and custom handlers, which are switchable to default handlers. Problem is that default handlers behaviour is to consume errors, so errors raised from code have printed tracebacks, but not pas

Re: Peculiarity of '@' in logging.Formatter

2011-11-22 Thread Tiaburn Stedd
Upvote this. Looks like a bug for me. begin results -- Nov 22 16:47:45 lvaltp0521 [minitest: 021]:My log message:isn't it special? Nov 22 16:47:45 lvaltp0521 [minitest@021]: My log message:isn't it special? end results

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-22 Thread Lorenzo
>         Very interesting.  Is there a simple way to add third-party > libraries to these?  I assume that for pure-Python modules you could > just put a python file in the appropriate place and import it, but what > about if you wanted a web app that used numpy or something?  Is that > feasible? >

Re: a qustion about import that really confuses me

2011-11-22 Thread Dave Angel
On 11/22/2011 05:18 AM, David Lu wrote: Hi, there. I have two files: a.py: # -*- coding: utf-8 -*- print('in a') import b print('var') VAR = 1 def p(): print('{}, {}'.format(VAR, id(VAR))) if __name__ == '__main__': VAR = -1 p() b.p() # Where does this VAR come from?

a qustion about import that really confuses me

2011-11-22 Thread David Lu
Hi, there. I have two files: a.py: > # -*- coding: utf-8 -*- > print('in a') > import b > > print('var') > VAR = 1 > > def p(): > print('{}, {}'.format(VAR, id(VAR))) > > if __name__ == '__main__': > VAR = -1 > p() > b.p() # Where does this VAR come from? > b.py: > # -*- coding