creo due file: test.py e test1234.pyCreazione di un modulo python
test.py contiene:
import test1234
t = test1234.test()
test1234.py contiene:
class test():
def __init__(self):
Quando messo nello stesso dire ctory, python test.py
funziona senza errori.
Tuttavia, se creo una directory test1234 e messo test1234.py e un vuoto init .py in questa directory, python test.py
dà l'errore:
AttributeError: 'module' object has no attribute 'test'
cosa ho è necessario fare per test.py per poter visualizzare la classe test
in test1234.py?
I downpoters si preoccupano di pesare? La mia domanda non è abbastanza chiara? È inaccettabile che non capissi come funzionano le importazioni python? :) – Olhovsky