Home Download Buy Blog Forum Support

First timer with Sublime - Python

First timer with Sublime - Python

Postby VigneshS on Sat Sep 22, 2012 12:07 pm

I've recently switched from using textmate to Sublime text, and I am absolutely loving it. I still have much to learn when it comes to hardcore coding and text editors :)

I'm having a problem when it comes to compiling python code within sublime itself; when I build the code it comes up with this error:

Code: Select all
/usr/bin/python: can't find '__main__' module in ''
[Finished in 0.2s with exit code 1]


I'm afraid I don't have a clue as to what this exactly means. I've tried installing a new python and running the Update Shell Profile script, but this error still shows up.

I am expecting "Hello World" to print in the dialogue box below when I run print "Hello World", is building of the code supposed to act as the output, or is that a job for the interpreter?
VigneshS
 
Posts: 2
Joined: Fri Sep 21, 2012 6:43 am

Re: First timer with Sublime - Python

Postby Jefferson on Mon Sep 24, 2012 11:44 pm

Having the same issue. I've never been able to get a simple Python script to run with Sublime Text 2... and I really want to use it for Python :(

Running OS X Mountain Lion.
Jefferson
 
Posts: 2
Joined: Mon Sep 24, 2012 11:42 pm

Re: First timer with Sublime - Python

Postby erilian on Mon Oct 01, 2012 9:01 pm

Guys, seems like you need to save ur file anywhere before build it. If it doesn't help try to add this location to python path. This solution working for me on linux.
erilian
 
Posts: 1
Joined: Mon Oct 01, 2012 8:58 pm

Re: First timer with Sublime - Python

Postby Jefferson on Wed Oct 03, 2012 4:59 pm

erilian wrote:Guys, seems like you need to save ur file anywhere before build it. If it doesn't help try to add this location to python path. This solution working for me on linux.


That worked for me, thanks. Would be nice if it could run without saving though, like BBEdit. Sometimes I just want to bring up a text editor and try out a sample of code.
Jefferson
 
Posts: 2
Joined: Mon Sep 24, 2012 11:42 pm

Re: First timer with Sublime - Python

Postby Qwerty on Thu Feb 14, 2013 11:18 am

What do you mean by
erilian wrote:..try to add this location to python path..
?
Qwerty
 
Posts: 6
Joined: Tue Feb 12, 2013 12:19 pm


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 17 guests