Re: Importing class from another file

2013-01-23 Thread Tobias M.
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

Re: Importing class from another file

2013-01-22 Thread Kevin Holleran
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

Re: Importing class from another file

2013-01-22 Thread John Gordon
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

Re: importing class objects from a pickled file

2011-05-04 Thread Gregory Ewing
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

Re: importing class objects from a pickled file

2011-05-03 Thread Owen Jacobson
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

Re: importing class objects from a pickled file

2011-05-03 Thread James Mills
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

importing class objects from a pickled file

2011-05-03 Thread Catherine Moroney
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

Re: importing class

2006-10-30 Thread Steve Holden
[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

Re: importing class

2006-10-30 Thread gmarkowsky
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

Re: importing class

2006-10-29 Thread Steve Holden
[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

Re: importing class

2006-10-29 Thread gmarkowsky
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

Re: importing class

2006-10-29 Thread gmarkowsky
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

Re: importing class

2006-10-27 Thread Marc 'BlackJack' Rintsch
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=

importing class

2006-10-27 Thread gmarkowsky
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

Re: Importing class from file in package

2004-12-05 Thread Joe Raul
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

Re: Importing class from file in package

2004-12-04 Thread Peter Hansen
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

Importing class from file in package

2004-12-04 Thread Florian Lindner
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