Write python in Xcode,but always get /usr/bin/python: can't find 'main' module in "xxx"

I just wrote simple codes,like print 'hhh' but always get: /usr/bin/python: can't find 'main' module in "xxx"

I know if I'm using sublime,the problem may be that I didn't save it. But I'm using Xcode...I don't know how to save it or did Xcode save it automatically?In fact,I have no idea about my problem.

Someone said I can fix it by adding two files:
my_module
__init__.py
myhello.py # print "Hello"
__main__.py # import myhello

but I still don't know how to do
andychao
Asked Apr 24, 2016

TIP: If it's not your answer to this question, please click "Leave a Comment" button under the question to communicate with the question owner.

Categories