JulianEberius / SublimeRope

ST2 only, use SublimePythonIDE with ST3: Adds Python completions and some IDE-like functions to Sublime Text 2, through the use of the Rope library
GNU General Public License v2.0
250 stars 26 forks source link

'Invalid Syntax' error with end="" keyword within print() function #82

Closed appqi closed 9 years ago

appqi commented 11 years ago

Hello, I'd like to print some numbers without newline. Python2: print x, # The comma suppresses newline Python3: print(x, end=" ") # Adds a space instead of a newline

If I try the following:

for number in range(5): print(number, end=" ")

It works perfectly in Python3 (I get the result without errors) but SublimeRope shows an error 'invalid syntax' image

Is there any workaround?

EDIT: I use SublimeText 2.0.2 Build 2221, Python3.3.2 32bit, Windows 7 x64 EDIT2: Same problem with SublimeLinter (https://github.com/SublimeLinter/SublimeLinter/issues/561)

JulianEberius commented 9 years ago

Hi,

Sorry for the late reply. No there is no easy way to fix this in SublimeRope, as it runs inside ST2, which uses Python 2 internally. This is probably the reason you get the same error in SublimeLinter.

The best solution would be to upgrade to the ST3 Beta and use my rewritten Python Plugin SublimePythonIDE which works on ST3 and uses a different architecture (external Python process using the same version as your project).

Regards, Julian