Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error evaluating cells with empty lines #2440

Closed
j-chacon opened this issue May 18, 2015 · 7 comments
Closed

Error evaluating cells with empty lines #2440

j-chacon opened this issue May 18, 2015 · 7 comments

Comments

@j-chacon
Copy link

Hey im having some issues while evaluating cells if there is an empty line just before the else statement. When this occurs, I get an unexpected indentation error.

#%%
a = False

if a:
    print('a is true')

else:
    print ('a is false')

Now if the blank line before the else is removed, then it works fine.

Can anyone fix this? :)

Greetings!
Juan

@ccordoba12
Copy link
Member

This only happens in our Python Console, not in our IPython one. That's because our Python Console can't handle multiline statements but the IPython ones can.

So for now you can use our IPython consoles to keep working :-)


@SylvainCorlay, could you take a look at this one? It shouldn't be that hard to solve because this only requires removing blank lines present in a cell before sending it to the console.

@SylvainCorlay
Copy link
Member

Ok I will fix this sometimes this week.
Cheers
S.
On May 18, 2015 12:02 PM, "Carlos Cordoba" [email protected] wrote:

This only happens in our Python Console, not in our IPython one. That's
because our Python Console can't handle multiline statements but the
IPython ones can.

So for now you can use our IPython consoles to keep working :-)

@SylvainCorlay https://github.com/SylvainCorlay, could you take a look
at this one? It shouldn't be that hard to solve because this only requires
removing blank lines present in a cell before sending it to the console.


Reply to this email directly or view it on GitHub
#2440 (comment).

@j-chacon
Copy link
Author

Awesome guys!

Thanks a lot

@ccordoba12 ccordoba12 added this to the v2.3.5 milestone Jun 1, 2015
@ccordoba12 ccordoba12 changed the title Error evaluating cells with empty line before else statement Error evaluating cells with empty lines Jun 2, 2015
@ccordoba12 ccordoba12 modified the milestones: v3.0, v2.3.5 Jun 8, 2015
@ccordoba12
Copy link
Member

To solve this correctly we need to create new run functions (or extend runfile) to run only portions of a file. They will only be necessary for the Python console.

IEP has something like this functionality already.

@ccordoba12
Copy link
Member

I mean, these functions will avoid the need to evaluate a cell line by line, which is the current approach.

This is brittle and prone to fail, as this bug shows.

@ccordoba12 ccordoba12 modified the milestones: v3.1, v3.0 Jul 25, 2015
@goanpeca
Copy link
Member

goanpeca commented Dec 6, 2015

@ccordoba12 can you put some pointers here on what to do? file urls etc...?

@ccordoba12
Copy link
Member

Closing because the Python console is going to be removed in Spyder 3.2.

Please see issue #4524 for our reasons to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants