ich hab folgendes Problem. Ich habe mir eben eine Klasse geschrieben und das ganze in einer Datei auto.py abgespeichert.
Code: Alles auswählen
class auto:
def __init__(self):
self.velocity = []
self.acc = []
self.pos = []
def changeacc(self, x):
self.acc = x
def changepos(self, x):
self.pos = x
def changevelocity(self, x):
self.velocity = x
def test(self)
print "test"
Code: Alles auswählen
from auto import *
tollesauto = auto()
tollesauto.changeacc(20)
print tollesauto.acc
tollesauto.changevelocity(55)
print tollesauto.velocity
tollesauto.changepos(40)
print tollesauto.pos
P.S.: auto.py und main.py liegen auch im selben ordner