Re: Is Python installer/un-installer buggy on Windows?

2014-12-03 Thread Terry Reedy
On 12/3/2014 10:16 PM, Aseem Bansal wrote: I am using 32-bit Python on a 64-bit Windows. Edit with IDLE is missing from the context menu. I am working on Windows 7. I have searched on google a lot and have tried everything said in superuser, stackoverflow etc. I have even tried re-installing Pyt

Re: Python handles globals badly.

2014-12-03 Thread Michael Torrie
On 12/03/2014 08:57 PM, Dennis Lee Bieber wrote: > On Wed, 3 Dec 2014 10:16:18 -0800 (PST), sohcahto...@gmail.com declaimed > the following: > > >> >> I'm surprised other people haven't picked up on how obvious of a troll this >> "Skybuck Flying" guy is. He claims 20 years programming experienc

Is Python installer/un-installer buggy on Windows?

2014-12-03 Thread Aseem Bansal
I am using 32-bit Python on a 64-bit Windows. Edit with IDLE is missing from the context menu. I am working on Windows 7. I have searched on google a lot and have tried everything said in superuser, stackoverflow etc. I have even tried re-installing Python. I am now only left with re-installin

Re: Python handles globals badly.

2014-12-03 Thread Mark Lawrence
On 03/12/2014 23:02, Skybuck Flying wrote: "Mark Lawrence" wrote in message news:mailman.16534.1417610132.18130.python-l...@python.org... On 03/12/2014 02:27, Skybuck Flying wrote: Excuse is: "bad programming style". I don't need snot telling me how to program after 20 years of programming

Re: Python handles globals badly.

2014-12-03 Thread Joel Goldstick
On Wed, Dec 3, 2014 at 8:10 PM, Chris Angelico wrote: > On Thu, Dec 4, 2014 at 11:57 AM, Steven D'Aprano > wrote: >>> Someone with 20 years of programming shouldn't have any problems >>> understanding objects in Python. >> >> Oh if that were only the case. It is amazing how long some people can w

Re: Python, C++ interaction

2014-12-03 Thread Dan Stromberg
On Wed, Dec 3, 2014 at 12:29 AM, Michael Kreim wrote: > Hi, > I did some googleing on extending Python by C++ code but I did not find > something that satisfies me. I gave SWIG a try, but several webpages > disadvised me of using it. Also my small experiments did not work. Now, I > read about cty

Re: Python handles globals badly.

2014-12-03 Thread Chris Angelico
On Thu, Dec 4, 2014 at 11:57 AM, Steven D'Aprano wrote: >> Someone with 20 years of programming shouldn't have any problems >> understanding objects in Python. > > Oh if that were only the case. It is amazing how long some people can work > in a profession and still avoid learning anything new. I

Re: Python handles globals badly.

2014-12-03 Thread Steven D'Aprano
sohcahto...@gmail.com wrote: > On Wednesday, December 3, 2014 10:05:06 AM UTC-8, mm0fmf wrote: >> On 03/12/2014 04:32, Skybuck Flying wrote: >> > Some issues I'd like to address to you: >> > >> > 1. Structured programming requires more programming time. >> > 2. Structured programming implies struc

Re: Python handles globals badly.

2014-12-03 Thread Skybuck Flying
"Mark Lawrence" wrote in message news:mailman.16534.1417610132.18130.python-l...@python.org... On 03/12/2014 02:27, Skybuck Flying wrote: Excuse is: "bad programming style". I don't need snot telling me how to program after 20 years of programming experience. This is so far the only thing

Re: Python handles globals badly.

2014-12-03 Thread Peter Pearson
On Wed, 3 Dec 2014 03:27:45 +0100, Skybuck Flying wrote: > > I don't need snot telling me how to program after 20 years of programming > experience. [snip] After 20 years of programming, I had a lot to learn about programming. That was 29 years ago, and I *still* have a lot to learn about program

Re: Style question: Importing modules from packages - 'from' vs 'as'

2014-12-03 Thread Terry Reedy
On 12/3/2014 6:02 AM, Chris Angelico wrote: When importing a module from a subpackage, it's sometimes convenient to refer to it throughout the code with a one-part name rather than two. I'm going to use 'os.path' for the examples, but my actual use-case is a custom package where the package name

Re: Style question: Importing modules from packages - 'from' vs 'as'

2014-12-03 Thread Ian Kelly
On Dec 3, 2014 4:34 AM, "Chris Angelico" wrote: > > On Wed, Dec 3, 2014 at 10:27 PM, Peter Otten <__pete...@web.de> wrote: > > Don't repeat yourself, so > > > > from os import path > > > > always. On the other hand I have never thought about actual renames, e. g. > > > > from os import path as std

Re: Cherrypy - prevent browser "prefetch"?

2014-12-03 Thread Israel Brewster
Ah, I see. That makes sense. Thanks. --- Israel Brewster Systems Analyst II Ravn Alaska 5245 Airport Industrial Rd Fairbanks, AK 99709 (907) 450-7293 --- BEGIN:VCARD VERSION:3.0 N:Brewster;Israel;;; FN:Israel

Re: Python handles globals badly.

2014-12-03 Thread sohcahtoa82
On Wednesday, December 3, 2014 10:05:06 AM UTC-8, mm0fmf wrote: > On 03/12/2014 04:32, Skybuck Flying wrote: > > Some issues I'd like to address to you: > > > > 1. Structured programming requires more programming time. > > 2. Structured programming implies structure which might be less flexible. >

Re: Python handles globals badly.

2014-12-03 Thread mm0fmf
On 03/12/2014 04:32, Skybuck Flying wrote: Some issues I'd like to address to you: 1. Structured programming requires more programming time. 2. Structured programming implies structure which might be less flexible. 3. Python objects require "self" keyword to be used everywhere, and other akwardn

Re: Cherrypy - prevent browser "prefetch"?

2014-12-03 Thread Nobody
On Tue, 02 Dec 2014 21:41:33 +, John Gordon wrote: > GET shouldn't cause any business data modifications, but I thought it was > allowed for things like logging out of your session. GET isn't supposed to have observable side-effects. "Observable" excludes things like logs and statistics, but

Re: Looking for download link for ArcPY

2014-12-03 Thread Dave Angel
On 12/02/2014 05:48 PM, sravan kumar wrote: Can I find where Arcpy.exe to download in order to use for my course work I don't know the package. But it shouldn't be hard to find. Go to duckduckgo.com (or google, if that's your preference) type arcpy in the search box One of the result lin

Re: Python, C++ interaction

2014-12-03 Thread Joshua Landau
On 3 December 2014 at 08:29, Michael Kreim wrote: > > What are you using to wrap C++ classes for Python? > Can you recommend swig? Should I give it another try? > Did I misunderstood ctypes? The PyPy guys would love it if you used CFFI. Cython is also a wonderful approach. There's a lot of suppor

Re: Python handles globals badly.

2014-12-03 Thread Joshua Landau
On 3 December 2014 at 04:32, Skybuck Flying wrote: > > I am still new at python and definetly don't feel comfortable with the > object feature, though I did use it for these variables which are actually > objects. If you are being serious, please take into consideration that there is no way you a

Re: Python handles globals badly.

2014-12-03 Thread Mark Lawrence
On 03/12/2014 02:27, Skybuck Flying wrote: Excuse is: "bad programming style". I don't need snot telling me how to program after 20 years of programming experience. This is so far the only thing pissing me off in python. Now I have to declare "global" in front of these variables every where I

Re: PyEval_GetLocals and unreferenced variables

2014-12-03 Thread Gregory Ewing
Kasper Peeters wrote: That may have been the design plan, but in Python 2.7.6, I definitely am able to inject locals via PyEval_GetLocals() and have them be visible both from the C and Python side; What seems to be happening is that the dict created by PyEval_GetLocals() is kept around, so you

Re: Proposed new conditional operator: "or else"

2014-12-03 Thread Chris Angelico
On Wed, Dec 3, 2014 at 10:59 PM, Tim Chase wrote: > On 2014-12-02 23:05, Dennis Lee Bieber wrote: >> > foo == 42 or else >> >> Has a PERL stink to it... like: foo == 42 or die > > This statement actually works in Python and I occasionally use it > when debugging (in the same fashion as one

Re: Proposed new conditional operator: "or else"

2014-12-03 Thread Tim Chase
On 2014-12-02 23:05, Dennis Lee Bieber wrote: > > foo == 42 or else > > Has a PERL stink to it... like: foo == 42 or die This statement actually works in Python and I occasionally use it when debugging (in the same fashion as one might do printf() debugging in C). It raises a NameError a

Re: Proposed new conditional operator: "or else"

2014-12-03 Thread Chris Angelico
On Wed, Dec 3, 2014 at 10:56 PM, Tim Chase wrote: > This actually works in Python and I occasionally use in debugging > (much like finish_sentence() or die ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposed new conditional operator: "or else"

2014-12-03 Thread Tim Chase
On 2014-12-02 23:05, Dennis Lee Bieber wrote: > > foo == 42 or else > > Has a PERL stink to it... like: foo == 42 or die This actually works in Python and I occasionally use in debugging (much like -- https://mail.python.org/mailman/listinfo/python-list

Re: Style question: Importing modules from packages - 'from' vs 'as'

2014-12-03 Thread Chris Angelico
On Wed, Dec 3, 2014 at 10:27 PM, Peter Otten <__pete...@web.de> wrote: > Don't repeat yourself, so > > from os import path > > always. On the other hand I have never thought about actual renames, e. g. > > from os import path as stdpath > > versus > > import os.path as stdpath > > I think I'd use t

Re: Style question: Importing modules from packages - 'from' vs 'as'

2014-12-03 Thread Peter Otten
Chris Angelico wrote: > When importing a module from a subpackage, it's sometimes convenient > to refer to it throughout the code with a one-part name rather than > two. I'm going to use 'os.path' for the examples, but my actual > use-case is a custom package where the package name is, in the > ap

Re: PyEval_GetLocals and unreferenced variables

2014-12-03 Thread Kasper Peeters
> I'm not sure how you think you're adding a local from C > code. If you're using PyEval_GetLocals(), that only gives > you a dict containing a *copy* of the locals; modifying > that dict doesn't change the locals in the function's frame. That may have been the design plan, but in Python 2.7.6, I

Re: Style question: Importing modules from packages - 'from' vs 'as'

2014-12-03 Thread Tim Delaney
On 3 December 2014 at 22:02, Chris Angelico wrote: > > import os.path as path > from os import path > Bah - deleted the list and sent directly to Chris ... time to go to bed. The advantage of the former is that if you want to use a different name, it's a smaller change. But the disadvantage of

Style question: Importing modules from packages - 'from' vs 'as'

2014-12-03 Thread Chris Angelico
When importing a module from a subpackage, it's sometimes convenient to refer to it throughout the code with a one-part name rather than two. I'm going to use 'os.path' for the examples, but my actual use-case is a custom package where the package name is, in the application, quite superfluous. Th

Re: Python, C++ interaction

2014-12-03 Thread Sturla Molden
Cython is nearly always the answer to scientific computing in Python, including wrapping C++. Sturla Michael Kreim wrote: > Hi, > > we are working on a small scientific program that helps us in developing > and testing of new numerical methods for a certain type of biochemical > problems. I

Re: python3: 'module' object is not callable - type is

2014-12-03 Thread Chris Angelico
On Tue, Dec 2, 2014 at 6:45 AM, Chris Cioffi wrote: > File "/Users/chris/dev/LendingClub/lendingclub.py", line 40, in > _make_api_call > pprint(lcresponse.read()) > TypeError: 'module' object is not callable > > The relevant code is as follows: > lcrequest = urllib.request.Request(url, data

Python, C++ interaction

2014-12-03 Thread Michael Kreim
Hi, we are working on a small scientific program that helps us in developing and testing of new numerical methods for a certain type of biochemical problems. I spare you the math ;-) We code our new methods in Python and compare them with the existing methods. Unfortunately, these existing m

Re: Looking for download link for ArcPY

2014-12-03 Thread sravan kumar
Can I find where Arcpy.exe to download in order to use for my course work Thank you. -- https://mail.python.org/mailman/listinfo/python-list

python3: 'module' object is not callable - type is

2014-12-03 Thread Chris Cioffi
I'm writing a little script that uses a REST API and I'm having a problem using urllib in Python 3. I had the basics working in Python 2.7, but for reasons I'm not clear on I decided to update to Python 3. (I'm in the early phases, so this isn't production by any stretch.) Python version inf