randy3k / SendCode

Send code and text to macOS and Linux Terminals, iTerm, ConEmu, Cmder, Tmux, Terminus; R (RStudio), Julia, IPython.
MIT License
204 stars 28 forks source link

SyntaxError: multiple statements found while compiling a single statement #102

Closed maniacalwhistle closed 6 years ago

maniacalwhistle commented 6 years ago

I am not super fluent in Python or the ins-and-outs of Sublime Text packages and I am having a hard time trying to use a combination of SendCode and Terminus to run some Python code.

The first thing to note is that the code runs fine with a simple cmd+b build (aka results show up fine in Sublime native console with Python build).

When I run with SendCode however I keep getting an error that reads, "SyntaxError: multiple statements found while com piling a single statement". I've tried a couple of things to rule out issues and see what is going on:

  1. I used a linter (Anaconda) to make sure the indentation and formatting was good.
  2. I ran simple code through SendCode to make sure it worked (aka one line saying 'a = 5')
  3. I sourced the file in a regular terminal window (python filename) and it produces the results.
  4. I read through some of the older issues here about bracketed_passte_mode and tried adjusting the settings (from 'true' to 'false') but still can't get it to work.

I even tried to make a really simple multiline script to see if I could get it to work but still sometimes got the multiple statements issue if I highlighted the code block I intended to send (instead of hitting cmd enter one by one).

Anyway, I've tried a lot of things but can't seem to get it to work on my own. So I am looking for some help. Both packages seem really cool and I'd really like to use them.

syntax_error_multiple_statements toy_example_with_same_error

think_complexity.txt

randy3k commented 6 years ago

You should use IPython instead of python.

maniacalwhistle commented 6 years ago

Wow. That was easy. Thanks.