osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python3 - How do I import a class from another file


R.Wieser wrote:
> Chris,
...
> 
> But, as you mentioned, I do not know (all) the facts.  Please do present
> them.   Maybe there is a logic in there I do not yet see.

We may, but then you wrote:

>> Check out the 'with' statement.
> 
> I'm sorry, but nope.
> 
> Rule one: When debugging do *not* throw more stuff at a problem than what is
> neccessary to make it show its ugly head.
> Rule two: When in doubt, see rule One. :-)

which contradicts your previous statement.

"with" is "more stuff" it is the right way to deal with disposable
ressource in the first place. In the documentation it is used from
the very first example of, say, open().