TypeError: 'NoneType' object is not callable

2014-07-28 Thread Satish ML
Hi, TypeError: 'NoneType' object is not callable? Why this error and what is the solution? Code: class SuperMeta: def __call__(self, classname, supers, classdict): print('In SuperMeta.call: ', classname, supers, classdict, sep='\n...') Class = self.__New__(classname, supers, c

Re: rpath alike feature for python scripts

2014-07-28 Thread dieter
Olaf Hering writes: > On Sat, Jul 26, dieter wrote: > >> The "binary" corresponds to a script. The script could have >> a function "setup_path" which enhances "sys.path" as appropriate >> and ensure that this function is called near its beginning. > > Yes, but how does it obtain the required valu

Re: Prob. Code Downloaded for Programming the Semantic Web (python code)

2014-07-28 Thread Bruce Whealton
On Monday, July 28, 2014 11:28:40 AM UTC-4, Steven D'Aprano wrote: > On Mon, 28 Jul 2014 03:39:48 -0700, Bruce Whealton wrote: Stephen, I went to my Ubuntu box inside vmware and added a #!/usr/bin/env python2.7 to the top. Then I made the file executable and it ran the code perfectly. > >

Re: one to many (passing variables)

2014-07-28 Thread CHIN Dihedral
On Tuesday, July 29, 2014 3:29:04 AM UTC+8, Terry Reedy wrote: > On 7/25/2014 9:47 PM, C.D. Reimer wrote: > > > > > > On 7/24/2014 2:58 AM, Ben Finney wrote: > > >> Here is an article on good API design; the principles apply to Python > > >> http://blog.isnotworking.com/2007/05/api-design-guide

Re: Exploring Python for next desktop GUI Project

2014-07-28 Thread Roy Smith
In article <87mwbtjg9r@pascolo.net>, pec...@pascolo.net wrote: > >> 2. Python 2 or 3? Which will serve me better in the future? > > > > Long term (7 years), [Python] 3. > > I have STRONG suicidal intent and no access to treatment, > should I better learn Python 2? In that case, go with PHP.

Re: Exploring Python for next desktop GUI Project

2014-07-28 Thread pecore
>> 2. Python 2 or 3? Which will serve me better in the future? > > Long term (7 years), [Python] 3. I have STRONG suicidal intent and no access to treatment, should I better learn Python 2? -- https://mail.python.org/mailman/listinfo/python-list

Re: gethostbyaddr()

2014-07-28 Thread Edward Manning
Chris Thank you for the info. I figure it out. But thank you again. Ed > On Jul 28, 2014, at 5:42 PM, Chris Kaynor wrote: > > On Mon, Jul 28, 2014 at 2:33 PM, Edward Manning wrote: > I wrote this code, but it seem to work fine if I only have one ip in the > file. When I have more than one

Re: gethostbyaddr()

2014-07-28 Thread Chris Kaynor
On Mon, Jul 28, 2014 at 2:33 PM, Edward Manning wrote: > I wrote this code, but it seem to work fine if I only have one ip in the > file. When I have more than one IP in the file > > I get a error. Does anyone have an idea why. > It would be helpful to know what the error you are getting is. It

gethostbyaddr()

2014-07-28 Thread Edward Manning
I wrote this code, but it seem to work fine if I only have one ip in the file. When I have more than one IP in the file I get a error. Does anyone have an idea why. import socket def main(): # get file names infileName = input ("What file our the IP adderss in? ") outfile

[ANN] Pylint 1.3 / Astroid 1.2 released.

2014-07-28 Thread Claudiu Popa
Hello! I'm happy to announce that Pylint 1.3 and Astroid 1.2 were released at the end of the last week. There has been a lot of enhancements and bug fixes since the latest release, so you're strongly encouraged to upgrade. More information about the changes in this release can be found here: http:

Re: Windows Studio 2008 Download

2014-07-28 Thread Sturla Molden
Irmen de Jong wrote: > I haven't tried this, but installing the SDK should allow you to build > extensions as > well for that particular Python build. Be sure to get the SDK that belongs to > vs2008, > which is this one if I'm not mistaken: > > http://www.microsoft.com/en-us/download/details.a

Re: Windows Studio 2008 Download

2014-07-28 Thread Sturla Molden
You can download the Windows SDK for .NET 3.5, but it is very old. A better option is to use GCC. The "static mingw toolchain" (gcc 4.8.2 based) created for building the official NumPy and SciPy binary installers should be rather safe: https://github.com/numpy/numpy/wiki/Mingw-static-toolchain S

Re: Windows Studio 2008 Download

2014-07-28 Thread TP
Hmmm. Now that I think about it the full Microsoft Visual Studio 2008 Service Pack 1 download I mentioned in my last email probably needs to have Visual Studio 2008 already installed (it's been a number of years since I had to install VS2008)? You could try it and see if it works. If not download

Re: rpath alike feature for python scripts

2014-07-28 Thread Albert-Jan Roskam
- Original Message - > From: Olaf Hering > To: dieter > Cc: python-list@python.org > Sent: Monday, July 28, 2014 9:57 AM > Subject: Re: rpath alike feature for python scripts > > On Sat, Jul 26, dieter wrote: > >> The "binary" corresponds to a script. The script could have >> a fun

Re: one to many (passing variables)

2014-07-28 Thread Terry Reedy
On 7/25/2014 9:47 PM, C.D. Reimer wrote: On 7/24/2014 2:58 AM, Ben Finney wrote: Here is an article on good API design; the principles apply to Python http://blog.isnotworking.com/2007/05/api-design-guidelines.html>. You know your API and its requirements better than we; see whether that sheds

Re: Parse bug text file

2014-07-28 Thread CM
Thank you, Chris, Terry, and jmf, for these pointers. Very helpful. -CM -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows Studio 2008 Download

2014-07-28 Thread Irmen de Jong
On 28-7-2014 16:40, Colin J. Williams wrote: > I gather that Python is compiled with Windows Studio 2008. > > Unfortunately, the MS Download link points to a Studio 2010 advertising .ppx > > Could someone point to an alternative please? > > Colin W. > > PS I need it for Numpy-1.8.1, which does

Re: Windows Studio 2008 Download

2014-07-28 Thread Chris Angelico
On Tue, Jul 29, 2014 at 12:40 AM, Colin J. Williams wrote: > I gather that Python is compiled with Windows Studio 2008. > > Unfortunately, the MS Download link points to a Studio 2010 advertising .ppx > > Could someone point to an alternative please? That would be specific to one particular versi

Re: Windows Studio 2008 Download

2014-07-28 Thread Ned Batchelder
On 7/28/14 10:40 AM, Colin J. Williams wrote: I gather that Python is compiled with Windows Studio 2008. Unfortunately, the MS Download link points to a Studio 2010 advertising .ppx Could someone point to an alternative please? Colin W. PS I need it for Numpy-1.8.1, which does not seem to be

Re: Prob. Code Downloaded for Programming the Semantic Web (python code)

2014-07-28 Thread Steven D'Aprano
On Mon, 28 Jul 2014 03:39:48 -0700, Bruce Whealton wrote: > I setup Eclipse to use python 2.7.x and tried to run this and it just > gave an error on line 9 where the def add function is declared. First step is to confirm that Eclipse actually is using Python 2.7. Can you get it to run this code

Re: Windows Studio 2008 Download

2014-07-28 Thread Joel Goldstick
I haven't tried it (linux guy), but people talk about using ActiveState's binaries On Mon, Jul 28, 2014 at 10:40 AM, Colin J. Williams wrote: > I gather that Python is compiled with Windows Studio 2008. > > Unfortunately, the MS Download link points to a Studio 2010 advertising > .ppx > > Could

Windows Studio 2008 Download

2014-07-28 Thread Colin J. Williams
I gather that Python is compiled with Windows Studio 2008. Unfortunately, the MS Download link points to a Studio 2010 advertising .ppx Could someone point to an alternative please? Colin W. PS I need it for Numpy-1.8.1, which does not seem to be available with a binary version. -- https://ma

Re: Beginner - GUI devlopment in Tkinter - Any IDE with drag and drop feature like Visual Studio?

2014-07-28 Thread chsqyuan
https://github.com/cdhigh/Visual-Tkinter-for-Python This is a plugin for VB6, generate a full feature gui by using VB IDE. -- https://mail.python.org/mailman/listinfo/python-list

Re: one to many (passing variables)

2014-07-28 Thread Neil D. Cerutti
On 7/25/2014 9:47 PM, C.D. Reimer wrote: Thank you for the link. I'm curious about one item mentioned in the article: "Avoid return values that Demand Exceptional Processing: return zero-length array or empty collection, not null" Isn't a zero-length array, empty collection and null all the same

Re: Prob. Code Downloaded for Programming the Semantic Web (python code)

2014-07-28 Thread Bruce Whealton
On Friday, July 25, 2014 11:25:15 PM UTC-4, Chris Angelico wrote: > On Sat, Jul 26, 2014 at 10:06 AM, Bruce Whealton > Chris, In response to your comments below, I'm comfortable changing this to use python 3. > As others have said, this is something that changed in Python 3. So > you have two

Re: Prob. Code Downloaded for Programming the Semantic Web (python code)

2014-07-28 Thread Bruce Whealton
On Friday, July 25, 2014 9:28:32 PM UTC-4, Steven D'Aprano wrote: > On Fri, 25 Jul 2014 17:06:17 -0700, Bruce Whealton wrote: Steven, See below please. The explanation did help. > > > OK, Eclipse with PyDev doesn't like this first line, with the function: > > > def add(self, (sub, pred, obj))

Re: .Net Like Gui Builder for Python?

2014-07-28 Thread Sturla Molden
Michael Torrie wrote: > Pages '09 was the last good version. The latest version is rubbish. > Lots of removed features, crappy ui. I think they took the stripped > down ipad version and tried to make the new desktop version. I think Apple has realized the mistake, because Pages is gradually im

Re: .Net Like Gui Builder for Python?

2014-07-28 Thread Sturla Molden
Kevin Walzer wrote: > I'm not sure which GUI framework you use, but Tkinter is so simple to > code in directly that you don't really need a UI builder. Give that a try. This is always true for GUI toolkits which use layout managers. A sketchpad is much more useful. If you can quickly sketch ut

Re: rpath alike feature for python scripts

2014-07-28 Thread Olaf Hering
On Sat, Jul 26, dieter wrote: > The "binary" corresponds to a script. The script could have > a function "setup_path" which enhances "sys.path" as appropriate > and ensure that this function is called near its beginning. Yes, but how does it obtain the required values? In other words, at buildtim

Re: What meaning of this ""hello %s you are %s years old" % x"

2014-07-28 Thread Chris Angelico
On Mon, Jul 28, 2014 at 5:41 PM, Albert-Jan Roskam wrote: >> That's not tuple%tuple, but rather string%tuple. And string%tuple is >> the older method of formatting an output string from a template and a >> tuple of values. See >> https://docs.python.org/2/library/stdtypes.html#string-formatting

Re: complete brain fart, it doesn't loop

2014-07-28 Thread Martin S
That's neat. I was only aware of the return version. Anyway, got it working now, simplifying the code in the process. So all was not lost. /Martin S 2014-07-28 9:09 GMT+02:00 Peter Otten <__pete...@web.de>: > Chris Angelico wrote: > >> On Mon, Jul 28, 2014 at 4:07 AM, Peter Otten <__pete...@web.

Re: What meaning of this ""hello %s you are %s years old" % x"

2014-07-28 Thread Albert-Jan Roskam
  > That's not tuple%tuple, but rather string%tuple.  And string%tuple is > the older method of formatting an output string from a template and a > tuple of values.  See > https://docs.python.org/2/library/stdtypes.html#string-formatting for > details. > > However, if you are just learning

Re: reading text files with indentation

2014-07-28 Thread Gary Herron
On 07/27/2014 11:25 PM, Noah wrote: Hi there, The following code I am using to read in lines from a text file. The indentation of the text is getting lost. How can I correct that? for file in files: with open (file, "r") as file: lines = file.readlines() for line

Re: reading text files with indentation

2014-07-28 Thread Peter Otten
Noah wrote: > Hi there, > > The following code I am using to read in lines from a text file. The > indentation of the text is getting lost. How can I correct that? > > > for file in files: >with open (file, "r") as file: > lines = file.readlines() > > for line in lines: >

reading text files with indentation

2014-07-28 Thread Noah
Hi there, The following code I am using to read in lines from a text file. The indentation of the text is getting lost. How can I correct that? for file in files: with open (file, "r") as file: lines = file.readlines() for line in lines: line = r

Re: complete brain fart, it doesn't loop

2014-07-28 Thread Chris Angelico
On Mon, Jul 28, 2014 at 5:09 PM, Peter Otten <__pete...@web.de> wrote: > > It was just a guess, but as the OP uses bottle, here's a modified > "hello world" from the bottle site > : > (snip example of yielding text to the web browse

Re: complete brain fart, it doesn't loop

2014-07-28 Thread Peter Otten
Chris Angelico wrote: > On Mon, Jul 28, 2014 at 4:07 AM, Peter Otten <__pete...@web.de> wrote: >> By the way, Python has something similar to a function that temporarily >> interrupts execution but preserves state. It's called generator. > > Yeah, but I have a suspicion his web framework (which h