Sublime Forum

First Time User

#1

Python - I am struggling to get a simple print function to work can anyone help me with this?

0 Likes

#2

You forgot to save the file before you tried to run it.

The tab should show the name of the file; if it’s showing you file content, that means it’s guessing what you want the file to be named when you save it for the first time.

Also, the error messages being generated show that they can’t find the module main in the filename '', or if you will, there is no file name there. The same is seen in the shell_cmd line, where it’s invoking python -u ''.

3 Likes

New comer to paths in OSX
#3

Considering how often this comes up, I suppose builds would do better if they failed as soon as a $file expansion doesn’t work due to unsaved files?

3 Likes

#4

I could be wrong, but it seems that the file hasn’t been set as Python (plain text).
Click “plain text” in the right side of the status bar and choose Python.
Then save before building.

1 Like

#5

Yes that was the error thank you all for the help! Saving it with a filename.py solve the issue. Im use to using repl.it on the internet so that was something new.

0 Likes