Hi,
Kevin Holleran wrote:
Traceback (most recent call last):
File "testing.py", line 1, in
from Sub_Dir.My_Class import *
ImportError: No module named Sub_Dir.My_Class
Make sure, the script you execute by passing it to the python
interpreter is in the parent directory of Sub_Dir.
A
Thanks, you got me straightened out.
--
Kevin Holleran
Master of Science, Computer Information Systems
Grand Valley State University
Master of Business Administration
Western Michigan University
SANS GCFA, SANS GCFE, CCNA, ISA, MCSA, MCDST, MCP
"Do today what others won't, do tomorrow what other
In Kevin Holleran
writes:
> I have a class called My_Class in a subdir called Sub_Dir.
> in My_Class.py is the following
> class My_Class_Connector:
> def __init__(self,un,pw,qs_srv="domain.com"):
> self.username = un
> self.password = pw
> Then I am trying to call from a
Catherine Moroney wrote:
I am having some problems reading the
object back out, as I get complaints about "unable to import module X".
The only way I have found around it is to run the read-file code out of
the same directory that contains the X.py file
Even when I put statements into the c
On 2011-05-03 20:18:33 -0400, Catherine Moroney said:
Hello,
I have an object of class X that I am writing to a pickled file. The
pickling part goes fine, but I am having some problems reading the
object back out, as I get complaints about "unable to import module X".
The only way I have f
On Wed, May 4, 2011 at 10:18 AM, Catherine Moroney
wrote:
> Am I explaining myself properly? Why doesn't the code that loads the
> object from the pickled file work unless I am sitting in the same directory?
> The code that writes the pickled file has the statement
> "from Y.X import X" stateme
Hello,
I have an object of class X that I am writing to a pickled file. The
pickling part goes fine, but I am having some problems reading the
object back out, as I get complaints about "unable to import module X".
The only way I have found around it is to run the read-file code out of
the
[EMAIL PROTECTED] wrote:
> Thanks for your help. Actually my idea was that command1 and command2
> would be defined within the program, not the module, as I would have
> different choices in different programs. Should I pass them in as a
> parameter too?
>
It would seem to be the only way to tell
Thanks for your help. Actually my idea was that command1 and command2
would be defined within the program, not the module, as I would have
different choices in different programs. Should I pass them in as a
parameter too?
Greg
Steve Holden wrote:
> [EMAIL PROTECTED] wrote:
> > Thanks, I got that
[EMAIL PROTECTED] wrote:
> Thanks, I got that part. The problem I'm still having is that it's not
> seeing things like text_1, which are defined in the program. How can I
> make it see that?
>
Your module is intended to work with many different main programs, so it
shouldn't make any assumptions
Thanks, I got that part. The problem I'm still having is that it's not
seeing things like text_1, which are defined in the program. How can I
make it see that?
Another question I should ask is whether I should even bother doing
this. That is, it seems that the elegant and approved way of doing thi
Yep, that fixed it. Many thanks.
Greg
Dennis Lee Bieber wrote:
> On 27 Oct 2006 09:22:00 -0700, [EMAIL PROTECTED] declaimed the
> following in comp.lang.python:
>
> > It's supposed to just make a Tkinter window with two choices. The
> > problem is that when I import it from a module, I get the fo
In <[EMAIL PROTECTED]>, gmarkowsky
wrote:
> Hi all,
>
> I'm trying to import a class from a module. The class looks like this:
> class App:
>
> def __init__(self, master):
>
> frame = Frame(master)
> frame.pack()
>
> self.button = Button(frame, text=text_1, command=
Hi all,
I'm trying to import a class from a module. The class looks like this:
class App:
def __init__(self, master):
frame = Frame(master)
frame.pack()
self.button = Button(frame, text=text_1, command= self.comm_1)
self.button.pack(side=LEFT)
self.h
from second import class
--
==
best regards
==
"Florian Lindner" <[EMAIL PROTECTED]>
news:[EMAIL PROTECTED]
> Hello,
> I've two files in my package.
> In the first file I want to inport a class which is declared in the
> second file. How can do that
Florian Lindner wrote:
I've two files in my package.
In the first file I want to inport a class which is declared in the
second file. How can do that without stating the absolute path to the
file, just the relative one?
Assuming you mean by "package" that you have a folder named, say,
"mypkg" and
Hello,
I've two files in my package.
In the first file I want to inport a class which is declared in the
second file. How can do that without stating the absolute path to the
file, just the relative one?
Thanks,
Florian
--
http://mail.python.org/mailman/listinfo/python-list
17 matches
Mail list logo