I've asked several people, and can't find any questions that work. My code seems identical, but I'm trying to import a title for a game. While the function works in the source file, after importing to another, it isn't found. Here are the files and the resulting error in cmd:
Game.py:
from Events import * from Character import * Opening() Character.py:
from Events import * from Game import * Events.py:
from Game import * from Character import * def Opening(): print " _____ _ _____ _____ _ _ " print "/ ___| | | / ___| / __ \ | | (_) " print "\ `--. _ _| |__ ______\ `--. _ __ __ _ ___ ___ | / \/ __ _ ___ ___ _ __ | |__ ___ _ __ _ __ _ " print " `--. \ | | | '_ \______|`--. \ '_ \ / _` |/ __/ _ \ | | / _` |/ __/ _ \| '_ \| '_ \ / _ \| '__| |/ _` |" print "/\__/ / |_| | |_) | /\__/ / |_) | (_| | (_| __/ | \__/\ (_| | (_| (_) | |_) | | | | (_) | | | | (_| |" print "\____/ \__,_|_.__/ \____/| .__/ \__,_|\___\___| \____/\__,_|\___\___/| .__/|_| |_|\___/|_| |_|\__,_|" print " | | | | " print " |_| |_| " but after running the Game.py file in the cmd, it brings the error:
Traceback (most recent call last): File "Game.py", line 2, in <module> from Events import * File "/tmp/so/Events.py", line 2, in <module> from Game import * File "/tmp/so/Game.py", line 8, in <module> Opening() NameError: name 'Opening' is not defined
EventsimportGame? Also I'd suggest reading PEP-8.import EventsEvents.Opening()