Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class File
#1
Hi,

I have saved my 'class xyz' as abc.py at some location.

now I have another editor window in which I want to write a code to create an object of 'xyz'.

Please help.

Many thanks in advance.
Reply
#2
import abc
x = abc.xyz()
abc.py either needs to be in the same folder as this code, or it needs to be in your pythonpath.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020