Importing Classes from child folders.

2013-01-16 Thread monosij . forums
Trying to do some OO Python with files in different directories. I have a blank __init__.py in each directory. It is my assumption that having an __init__.py marks the directory as a module. I am trying to run Controller.py from the command line. I would assume this has already been solved but cou

Re: Thought of the day

2013-01-16 Thread John Ladasky
On Sunday, January 13, 2013 8:16:29 PM UTC-8, Steven D'Aprano wrote: > A programmer had a problem, and thought Now he has "I know, I'll solve > two it with threads!" problems. Very nice! :^) This problem isn't exclusive to Python, however. Other multi-threaded applications can produce jumbled

Re: To make a method or attribute private

2013-01-16 Thread Steven D'Aprano
On Thu, 17 Jan 2013 08:34:22 +0800, iMath wrote: > To make a method or attribute private (inaccessible from the > outside), simply start its name with two > underscores《Beginning Python From Novice > to Professional》but there is another saying > goes:Beginning a variable name with a single und

Re: To make a method or attribute private

2013-01-16 Thread alex23
On Jan 17, 10:34 am, "iMath" <2281570...@qq.com> wrote: > To make a method or attribute private (inaccessible from the outside), simply > start its > name with two underscores > > but there is another saying goes: > Beginning a variable name with a single underscore indicates that the > variable

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Terry Reedy
On 1/16/2013 11:43 AM, Rick Johnson wrote: On Wednesday, January 16, 2013 3:53:55 AM UTC-6, Terry Reedy wrote: I agree with the complaint and you may have the germ of a good idea. The problem is that for some tracebacks, paths jump all over the place rather than having a common prefix. Dealing

Re: SimpleAI, Artificial Intelligence with Python - [released]

2013-01-16 Thread alex23
On Jan 17, 8:01 am, Elias Andrawos wrote: > SimpleAI is an easy to use lib implementing in python many of the > artificial intelligence algorithms described on the book "Artificial > Intelligence, a Modern Approach" Thanks for this, it looks great. One question: I couldn't find any mention of wha

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread alex23
On Jan 17, 3:32 am, Rick Johnson wrote: > On 1-16-2013 8:45 AM Steven D'Aprano wrote: > > > What personal library folder? > > The single MONOLITHIC folder you SHOULD be using to contain all your > personal modules and scripts! But of course you are not doing this, > only professionals are consiste

Re: Loading a PKCS#1 public key using M2Crypto

2013-01-16 Thread Piet van Oostrum
Marc Aymerich writes: > Hi, > I've been trying very, very hard to load an RSA key using M2Crypto but > without any success. > > basically this is what I'm trying to do: from M2Crypto import BIO, RSA pubkey = """-BEGIN RSA PUBLIC KEY- > ... MIIBCgKCAQEApwotnfHT9RAmxnuaGEM

Re: cymbalic reference?

2013-01-16 Thread Terry Reedy
On 1/16/2013 4:06 PM, rh wrote: My final product uses your suggestions along with one from the other post. I like the idea of storing the class name as the key. Then no call to globals() is needed. But I still have to test how that object behaves when it's a key. i.e. Is it deeply bound? Shall

SimpleAI, Artificial Intelligence with Python - [released]

2013-01-16 Thread Elias Andrawos
SimpleAI is an easy to use lib implementing in python many of the artificial intelligence algorithms described on the book "Artificial Intelligence, a Modern Approach", from Stuart Russel and Peter Norvig. This implementation takes some of the ideas from the Norvig's implementation (the aima-p

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Chris Angelico
On Thu, Jan 17, 2013 at 4:32 AM, Rick Johnson wrote: > On 1-16-2013 8:45 AM Steven D'Aprano wrote: >> What personal library folder? > > The single MONOLITHIC folder you SHOULD be using to contain all your personal > modules and scripts! But of course you are not doing this, only professionals >

ANN: Wing IDE 4.1.10 released

2013-01-16 Thread Wingware
Hi, Wingware has released version 4.1.10 of Wing IDE, our integrated development environment designed specifically for the Python programming language. Wing IDE provides a professional quality code editor with vi, emacs, and other key bindings, auto-completion, call tips, refactoring, context

Modern Control Engineering 5 Ed. - K. OGATA

2013-01-16 Thread reganrexman
I have solutions manuals to all problems and exercises in these textbooks. To get one in an electronic format contact me at: reganrexman(at)gmail(dot)com and let me know its title, author and edition. Please this service is NOT free. SOLUTION - MANUAL - Machine Design : An Integrated Approach (3

Modern Control Engineering 5 Ed. - K. OGATA

2013-01-16 Thread reganrexman
I have solutions manuals to all problems and exercises in these textbooks. To get one in an electronic format contact me at: reganrexman(at)gmail(dot)com and let me know its title, author and edition. Please this service is NOT free. SOLUTION - MANUAL - Machine Design : An Integrated Approach (3

PyTut: (Teminology) To clone, copy, or spawn -- that is the question!

2013-01-16 Thread Rick Johnson
PyTut: (Teminology) To clone, copy, or spawn -- that is the question! I've many time seen these three words applied improperly as symbols and believe i should explicitly define these terms in a programming context so that we all might use them correctly. Also notice that i did not mention "de

Loading a PKCS#1 public key using M2Crypto

2013-01-16 Thread Marc Aymerich
Hi, I've been trying very, very hard to load an RSA key using M2Crypto but without any success. basically this is what I'm trying to do: >>> from M2Crypto import BIO, RSA >>> >>> pubkey = """-BEGIN RSA PUBLIC KEY- ... MIIBCgKCAQEApwotnfHT9RAmxnuaGEMdI3lYPYE4aaqSD9v4KbTh1E7Le3GNJQb7 ...

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Rick Johnson
On 1-16-2013 8:45 AM Steven D'Aprano wrote: > What personal library folder? The single MONOLITHIC folder you SHOULD be using to contain all your personal modules and scripts! But of course you are not doing this, only professionals are consistent. > I have Python scripts in my home directory: >

Re: Using inner dict as class interface

2013-01-16 Thread Peter Otten
Steven D'Aprano wrote: > On Wed, 16 Jan 2013 15:42:42 +0100, Florian Lindner wrote: > >> Hello, >> >> I have a: >> >> class C: >>def __init__(self): >> d = dict_like_object_created_somewhere_else() >> >> def some_other_methods(self): >> pass >> >> >> class C should behave lik

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Rick Johnson
On Wednesday, January 16, 2013 3:53:55 AM UTC-6, Terry Reedy wrote: > I agree with the complaint and you may have the germ of a good idea. The > problem is that for some tracebacks, paths jump all over the place > rather than having a common prefix. Dealing with this might require > preprocessi

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Rick Johnson
On Wednesday, January 16, 2013 8:20:12 AM UTC-6, Michael Torrie wrote: > On 01/15/2013 10:59 PM, Rick Johnson wrote: > > Why do i need to see "C:\users\user\documents\python\lib" EVERY time? > > You're thinking about things from a very windows-centric point of view. How are file paths or director

Re: Using inner dict as class interface

2013-01-16 Thread Dave Angel
On 01/16/2013 09:42 AM, Florian Lindner wrote: Hello, I have a: class C: def __init__(self): d = dict_like_object_created_somewhere_else() def some_other_methods(self): pass class C should behave like a it was the dict d. So I could do: Is it a specific requirement that

Re: Using inner dict as class interface

2013-01-16 Thread Matt Jones
Or do what Steven said if its exactly a dict and doesn't require special management of the underlying dict. *Matt Jones* On Wed, Jan 16, 2013 at 8:58 AM, Matt Jones wrote: > Explicit is better than implicit. Define the dunder methods so you know > exactly what your class is doing when being in

Re: Using inner dict as class interface

2013-01-16 Thread Matt Jones
Explicit is better than implicit. Define the dunder methods so you know exactly what your class is doing when being indexed. You only need __getitem__ and __setitem__ really, but if you want to treat it just like a dict you'll need __delitem__, __len__, __iter__, __contains__ as well. *Matt Jone

Re: Using inner dict as class interface

2013-01-16 Thread Steven D'Aprano
On Wed, 16 Jan 2013 15:42:42 +0100, Florian Lindner wrote: > Hello, > > I have a: > > class C: >def __init__(self): > d = dict_like_object_created_somewhere_else() > > def some_other_methods(self): > pass > > > class C should behave like a it was the dict d. Then make it a d

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Steven D'Aprano
On Tue, 15 Jan 2013 21:59:42 -0800, Rick Johnson wrote: > Python needs to trim the path to the source file from which the > exception was caught and only display the relative path starting from > your personal library folder. What personal library folder? > For example. Say your personal librar

Using inner dict as class interface

2013-01-16 Thread Florian Lindner
Hello, I have a: class C: def __init__(self): d = dict_like_object_created_somewhere_else() def some_other_methods(self): pass class C should behave like a it was the dict d. So I could do: c = C() print c["key"] print len(c) but also c.some_other_method() How can I achieve

Re: Forcing Python to detect DocumentRoot

2013-01-16 Thread Joel Goldstick
On Wed, Jan 16, 2013 at 9:32 AM, Ferrous Cranus wrote: > Τη Τετάρτη, 16 Ιανουαρίου 2013 4:01:07 μ.μ. UTC+2, ο χρήστης Joel > Goldstick έγραψε: > > On Wed, Jan 16, 2013 at 8:51 AM, Ferrous Cranus > wrote: > > > > When trying to open an html template within Python script i use a > relative path to

Re: Forcing Python to detect DocumentRoot

2013-01-16 Thread Ferrous Cranus
Τη Τετάρτη, 16 Ιανουαρίου 2013 4:01:07 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > On Wed, Jan 16, 2013 at 8:51 AM, Ferrous Cranus wrote: > > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > > > > f = open

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Michael Torrie
On 01/15/2013 10:59 PM, Rick Johnson wrote: > Why do i need to see "C:\users\user\documents\python\lib" EVERY time? You're thinking about things from a very windows-centric point of view. There are many cases where as a developer I need to see the full paths. My modules are not always going to b

Re: Forcing Python to detect DocumentRoot

2013-01-16 Thread Joel Goldstick
On Wed, Jan 16, 2013 at 8:51 AM, Ferrous Cranus wrote: > When trying to open an html template within Python script i use a relative > path to say go one folder back and open index.html > > f = open( '../' + page ) > > How to say the same thing in an absolute way by forcing Python to detect > Docum

Forcing Python to detect DocumentRoot

2013-01-16 Thread Ferrous Cranus
When trying to open an html template within Python script i use a relative path to say go one folder back and open index.html f = open( '../' + page ) How to say the same thing in an absolute way by forcing Python to detect DocumentRoot by itself? -- http://mail.python.org/mailman/listinfo/pyt

DLLs folder on Windows

2013-01-16 Thread Piotr Dobrogost
Hi! I'm curious how dlls from the DLLs folder on Windows are being loaded? As they are not placed in the same folder where python.exe resides I guess they must be loaded by giving the path explicitly but I'm not sure. I'm asking because there's no DLLs folder being created when creating virtualenv

Re: Python-list Digest, Vol 112, Issue 114

2013-01-16 Thread Levi Nie
TKS, Ulrich. I finally write some back (self.transport.write()), and shutdown the connections. > > -- 已转发邮件 -- > From: Ulrich Eckhardt > To: python-list@python.org > Cc: > Date: Tue, 15 Jan 2013 13:46:52 +0100 > Subject: Re: interrupt the file sending if the file size over the

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Terry Reedy
On 1/16/2013 12:59 AM, Rick Johnson wrote: Python needs to trim the path to the source file from which the exception was caught and only display the relative path starting from your personal library folder. For example. Say your personal library exists in: C:\users\user\documents\python\lib .

Re: PyWart: Exception error paths far too verbose

2013-01-16 Thread Chris Angelico
On Wed, Jan 16, 2013 at 7:31 PM, donarb wrote: > Done > > https://github.com/erikrose/tracefront > > This module displays traces with shortened paths, and will even prepend your > editor of choice and line number to the path, making a shortcut to jumping to > the source in error via copy/paste.

PyWart: Exception error paths far too verbose

2013-01-16 Thread donarb
Done https://github.com/erikrose/tracefront This module displays traces with shortened paths, and will even prepend your editor of choice and line number to the path, making a shortcut to jumping to the source in error via copy/paste. -- http://mail.python.org/mailman/listinfo/python-list