Wesley Brooks wrote:
> Thanks for your help I tested what you two said as follows and it
> worked great. Thank you.
>
> (Bellow in file TEST_ClassID.py)
> class AssemblyItem:
> itemID = 0
> def __init__(self):
> self.ID = "assemblyItem" + str(AssemblyItem.itemID)
> Assembly
Thanks for your help I tested what you two said as follows and it
worked great. Thank you.
(Bellow in file TEST_ClassID.py)
class AssemblyItem:
itemID = 0
def __init__(self):
self.ID = "assemblyItem" + str(AssemblyItem.itemID)
AssemblyItem.itemID += 1
def ReturnID(self
Wesley Brooks wrote:
> Dear Users,
>
> I'm using global values to create a unique ID, or name for each
> instance of a class. If I import the following in one file and test it
> it works fine. If the following class was imported in two different
> files run by the same program would each instance
Luke Paireepinart wrote:
> I believe that, if your program is importing 2 other packages, each of
> which import some other package,
> that other doubly-imported package will only be executed once, by
> whichever one you import first.
Yes, that's right.
>> itemID = 0
>> class AssemblyItem:
>>
Wesley Brooks wrote:
> Dear Users,
>
> I'm using global values to create a unique ID, or name for each
> instance of a class. If I import the following in one file and test it
> it works fine. If the following class was imported in two different
> files run by the same program would each instance o
Dear Users,
I'm using global values to create a unique ID, or name for each
instance of a class. If I import the following in one file and test it
it works fine. If the following class was imported in two different
files run by the same program would each instance of the class have a
unique name,