I am newbie, pls don't be to harsh with me.
I am trying to setup Sublime Text with Python (for next Semester). Before that I used Haskell in SublimeText, where I could run my skript with "ctrl+b" in Sublime.
When I try doing the same with a file named "test.py".
def add(a,b):
return a+b
main = print(add(2,3))
I get the error-message:
/home/nayooti/Desktop/test.py:1:1:
**Parse error: naked expression at top level**
[Finished in 0.2s with exit code 1]
[shell_cmd: runhaskell "/home/nayooti/Desktop/test.py"]
[dir: /home/nayooti/Desktop]
[path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games]
The "naked expression at top level"-part looks familiar, since it is very Haskell specific. Indeed, when I search the Web for exactly this message, it brings me to Haskell related stuff only. So apparently Sublime or the compiler thinks, I am trying to run a Haskell-script, even though I named the file ~.py .
For these, who are not familiar with Haskell and Python: you can usually run a script by: Python: main = print(method(x,y)) Haskell: main = print(function x y)
I am using Ubuntu 12.04. What am I doing wrong here? Help is very appreciated. Tx.