Function object in spyder not working properly
When I am building a function in python, using spyder, the function object is not working properly.
e.g.,
def first_order(y,t):
tau=5
After introducing the 2nd line it automatically closes the function. How can I change this behavior?
It used to be like this
def first_order(y,t):
> tau=5
...: (first Enter, creates a new line)
(second Enter, to close the function)
python spyder
add a comment |
When I am building a function in python, using spyder, the function object is not working properly.
e.g.,
def first_order(y,t):
tau=5
After introducing the 2nd line it automatically closes the function. How can I change this behavior?
It used to be like this
def first_order(y,t):
> tau=5
...: (first Enter, creates a new line)
(second Enter, to close the function)
python spyder
please write an example of your problem and state the expected outcome
– Glostas
Nov 9 '18 at 9:50
It doesn't seem like you did what it said. Function definition works fine in spyder
– user8408080
Nov 9 '18 at 9:59
your indentation is wrong
– Glostas
Nov 9 '18 at 10:01
Manuel, could you please tell me, does the answer I've posted solve your problem? I ask because I'd prefer to remove it if it is not correct or, worse, misleading. Thank you.
– gboffi
Nov 9 '18 at 11:16
@user8408080 Manuel report is mostly correct, they just had a wrong reason for the buggy behaviour. It's not Spyder in itself, nor the the Python interpreter, but it's an issue with the interactive console used by Spyder, i.e., IPython. See my answer below for details
– gboffi
Nov 9 '18 at 11:43
add a comment |
When I am building a function in python, using spyder, the function object is not working properly.
e.g.,
def first_order(y,t):
tau=5
After introducing the 2nd line it automatically closes the function. How can I change this behavior?
It used to be like this
def first_order(y,t):
> tau=5
...: (first Enter, creates a new line)
(second Enter, to close the function)
python spyder
When I am building a function in python, using spyder, the function object is not working properly.
e.g.,
def first_order(y,t):
tau=5
After introducing the 2nd line it automatically closes the function. How can I change this behavior?
It used to be like this
def first_order(y,t):
> tau=5
...: (first Enter, creates a new line)
(second Enter, to close the function)
python spyder
python spyder
edited Nov 9 '18 at 9:55
Manuel Oliveira
asked Nov 9 '18 at 9:46
Manuel OliveiraManuel Oliveira
197
197
please write an example of your problem and state the expected outcome
– Glostas
Nov 9 '18 at 9:50
It doesn't seem like you did what it said. Function definition works fine in spyder
– user8408080
Nov 9 '18 at 9:59
your indentation is wrong
– Glostas
Nov 9 '18 at 10:01
Manuel, could you please tell me, does the answer I've posted solve your problem? I ask because I'd prefer to remove it if it is not correct or, worse, misleading. Thank you.
– gboffi
Nov 9 '18 at 11:16
@user8408080 Manuel report is mostly correct, they just had a wrong reason for the buggy behaviour. It's not Spyder in itself, nor the the Python interpreter, but it's an issue with the interactive console used by Spyder, i.e., IPython. See my answer below for details
– gboffi
Nov 9 '18 at 11:43
add a comment |
please write an example of your problem and state the expected outcome
– Glostas
Nov 9 '18 at 9:50
It doesn't seem like you did what it said. Function definition works fine in spyder
– user8408080
Nov 9 '18 at 9:59
your indentation is wrong
– Glostas
Nov 9 '18 at 10:01
Manuel, could you please tell me, does the answer I've posted solve your problem? I ask because I'd prefer to remove it if it is not correct or, worse, misleading. Thank you.
– gboffi
Nov 9 '18 at 11:16
@user8408080 Manuel report is mostly correct, they just had a wrong reason for the buggy behaviour. It's not Spyder in itself, nor the the Python interpreter, but it's an issue with the interactive console used by Spyder, i.e., IPython. See my answer below for details
– gboffi
Nov 9 '18 at 11:43
please write an example of your problem and state the expected outcome
– Glostas
Nov 9 '18 at 9:50
please write an example of your problem and state the expected outcome
– Glostas
Nov 9 '18 at 9:50
It doesn't seem like you did what it said. Function definition works fine in spyder
– user8408080
Nov 9 '18 at 9:59
It doesn't seem like you did what it said. Function definition works fine in spyder
– user8408080
Nov 9 '18 at 9:59
your indentation is wrong
– Glostas
Nov 9 '18 at 10:01
your indentation is wrong
– Glostas
Nov 9 '18 at 10:01
Manuel, could you please tell me, does the answer I've posted solve your problem? I ask because I'd prefer to remove it if it is not correct or, worse, misleading. Thank you.
– gboffi
Nov 9 '18 at 11:16
Manuel, could you please tell me, does the answer I've posted solve your problem? I ask because I'd prefer to remove it if it is not correct or, worse, misleading. Thank you.
– gboffi
Nov 9 '18 at 11:16
@user8408080 Manuel report is mostly correct, they just had a wrong reason for the buggy behaviour. It's not Spyder in itself, nor the the Python interpreter, but it's an issue with the interactive console used by Spyder, i.e., IPython. See my answer below for details
– gboffi
Nov 9 '18 at 11:43
@user8408080 Manuel report is mostly correct, they just had a wrong reason for the buggy behaviour. It's not Spyder in itself, nor the the Python interpreter, but it's an issue with the interactive console used by Spyder, i.e., IPython. See my answer below for details
– gboffi
Nov 9 '18 at 11:43
add a comment |
2 Answers
2
active
oldest
votes
Spyder uses IPython in its interactive console.
What you report is a bug in IPython 7.0, so the cleanest solution is to upgrade to IPython 7.1.
As a stop gap measure, if your platform doesn't provide 7.1 yet, you can use the key-chord Ctrl-o
(instead of Return
) to open a new line below the second line of the function definition and move there using the cursor key — after this maneuver the situation will be normal for the rest of the function definition.
Update
I knew that Spyder uses IPython, I didn't knew that it uses it via the qtconsole
and the bug I described was still not fixed in 7.1 qtconsole
(thank you Carlos Cordoba for pointing out).
The reason why OP has a problem still stands as valid, I fear that we have to wait 7.2 to have a fix for the qtconsole
because the ad interim solution that I've described doesn't work in qtconsole
(Spyder maintainer here) This is still an issue in IPython 7.1, so I think we need to change something in qtconsole to fix this.
– Carlos Cordoba
Nov 9 '18 at 15:53
@CarlosCordoba AH! Spyder uses qtconsole... The issue was solved in IPython 7.1 "plain" console. I'll edit my answer because I feel it is still relevant re the diagnosis of the problem, if not for its resolution. Thank you for pointing out my mistake.
– gboffi
Nov 9 '18 at 20:29
add a comment |
(Spyder maintainer here) This is a bug in the Qtconsole package and it'll be fixed in its 4.4.3 version, to be released today.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53223311%2ffunction-object-in-spyder-not-working-properly%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Spyder uses IPython in its interactive console.
What you report is a bug in IPython 7.0, so the cleanest solution is to upgrade to IPython 7.1.
As a stop gap measure, if your platform doesn't provide 7.1 yet, you can use the key-chord Ctrl-o
(instead of Return
) to open a new line below the second line of the function definition and move there using the cursor key — after this maneuver the situation will be normal for the rest of the function definition.
Update
I knew that Spyder uses IPython, I didn't knew that it uses it via the qtconsole
and the bug I described was still not fixed in 7.1 qtconsole
(thank you Carlos Cordoba for pointing out).
The reason why OP has a problem still stands as valid, I fear that we have to wait 7.2 to have a fix for the qtconsole
because the ad interim solution that I've described doesn't work in qtconsole
(Spyder maintainer here) This is still an issue in IPython 7.1, so I think we need to change something in qtconsole to fix this.
– Carlos Cordoba
Nov 9 '18 at 15:53
@CarlosCordoba AH! Spyder uses qtconsole... The issue was solved in IPython 7.1 "plain" console. I'll edit my answer because I feel it is still relevant re the diagnosis of the problem, if not for its resolution. Thank you for pointing out my mistake.
– gboffi
Nov 9 '18 at 20:29
add a comment |
Spyder uses IPython in its interactive console.
What you report is a bug in IPython 7.0, so the cleanest solution is to upgrade to IPython 7.1.
As a stop gap measure, if your platform doesn't provide 7.1 yet, you can use the key-chord Ctrl-o
(instead of Return
) to open a new line below the second line of the function definition and move there using the cursor key — after this maneuver the situation will be normal for the rest of the function definition.
Update
I knew that Spyder uses IPython, I didn't knew that it uses it via the qtconsole
and the bug I described was still not fixed in 7.1 qtconsole
(thank you Carlos Cordoba for pointing out).
The reason why OP has a problem still stands as valid, I fear that we have to wait 7.2 to have a fix for the qtconsole
because the ad interim solution that I've described doesn't work in qtconsole
(Spyder maintainer here) This is still an issue in IPython 7.1, so I think we need to change something in qtconsole to fix this.
– Carlos Cordoba
Nov 9 '18 at 15:53
@CarlosCordoba AH! Spyder uses qtconsole... The issue was solved in IPython 7.1 "plain" console. I'll edit my answer because I feel it is still relevant re the diagnosis of the problem, if not for its resolution. Thank you for pointing out my mistake.
– gboffi
Nov 9 '18 at 20:29
add a comment |
Spyder uses IPython in its interactive console.
What you report is a bug in IPython 7.0, so the cleanest solution is to upgrade to IPython 7.1.
As a stop gap measure, if your platform doesn't provide 7.1 yet, you can use the key-chord Ctrl-o
(instead of Return
) to open a new line below the second line of the function definition and move there using the cursor key — after this maneuver the situation will be normal for the rest of the function definition.
Update
I knew that Spyder uses IPython, I didn't knew that it uses it via the qtconsole
and the bug I described was still not fixed in 7.1 qtconsole
(thank you Carlos Cordoba for pointing out).
The reason why OP has a problem still stands as valid, I fear that we have to wait 7.2 to have a fix for the qtconsole
because the ad interim solution that I've described doesn't work in qtconsole
Spyder uses IPython in its interactive console.
What you report is a bug in IPython 7.0, so the cleanest solution is to upgrade to IPython 7.1.
As a stop gap measure, if your platform doesn't provide 7.1 yet, you can use the key-chord Ctrl-o
(instead of Return
) to open a new line below the second line of the function definition and move there using the cursor key — after this maneuver the situation will be normal for the rest of the function definition.
Update
I knew that Spyder uses IPython, I didn't knew that it uses it via the qtconsole
and the bug I described was still not fixed in 7.1 qtconsole
(thank you Carlos Cordoba for pointing out).
The reason why OP has a problem still stands as valid, I fear that we have to wait 7.2 to have a fix for the qtconsole
because the ad interim solution that I've described doesn't work in qtconsole
edited Nov 9 '18 at 20:39
answered Nov 9 '18 at 10:13
gboffigboffi
8,85822455
8,85822455
(Spyder maintainer here) This is still an issue in IPython 7.1, so I think we need to change something in qtconsole to fix this.
– Carlos Cordoba
Nov 9 '18 at 15:53
@CarlosCordoba AH! Spyder uses qtconsole... The issue was solved in IPython 7.1 "plain" console. I'll edit my answer because I feel it is still relevant re the diagnosis of the problem, if not for its resolution. Thank you for pointing out my mistake.
– gboffi
Nov 9 '18 at 20:29
add a comment |
(Spyder maintainer here) This is still an issue in IPython 7.1, so I think we need to change something in qtconsole to fix this.
– Carlos Cordoba
Nov 9 '18 at 15:53
@CarlosCordoba AH! Spyder uses qtconsole... The issue was solved in IPython 7.1 "plain" console. I'll edit my answer because I feel it is still relevant re the diagnosis of the problem, if not for its resolution. Thank you for pointing out my mistake.
– gboffi
Nov 9 '18 at 20:29
(Spyder maintainer here) This is still an issue in IPython 7.1, so I think we need to change something in qtconsole to fix this.
– Carlos Cordoba
Nov 9 '18 at 15:53
(Spyder maintainer here) This is still an issue in IPython 7.1, so I think we need to change something in qtconsole to fix this.
– Carlos Cordoba
Nov 9 '18 at 15:53
@CarlosCordoba AH! Spyder uses qtconsole... The issue was solved in IPython 7.1 "plain" console. I'll edit my answer because I feel it is still relevant re the diagnosis of the problem, if not for its resolution. Thank you for pointing out my mistake.
– gboffi
Nov 9 '18 at 20:29
@CarlosCordoba AH! Spyder uses qtconsole... The issue was solved in IPython 7.1 "plain" console. I'll edit my answer because I feel it is still relevant re the diagnosis of the problem, if not for its resolution. Thank you for pointing out my mistake.
– gboffi
Nov 9 '18 at 20:29
add a comment |
(Spyder maintainer here) This is a bug in the Qtconsole package and it'll be fixed in its 4.4.3 version, to be released today.
add a comment |
(Spyder maintainer here) This is a bug in the Qtconsole package and it'll be fixed in its 4.4.3 version, to be released today.
add a comment |
(Spyder maintainer here) This is a bug in the Qtconsole package and it'll be fixed in its 4.4.3 version, to be released today.
(Spyder maintainer here) This is a bug in the Qtconsole package and it'll be fixed in its 4.4.3 version, to be released today.
answered Nov 10 '18 at 16:37
Carlos CordobaCarlos Cordoba
13.5k23866
13.5k23866
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53223311%2ffunction-object-in-spyder-not-working-properly%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
please write an example of your problem and state the expected outcome
– Glostas
Nov 9 '18 at 9:50
It doesn't seem like you did what it said. Function definition works fine in spyder
– user8408080
Nov 9 '18 at 9:59
your indentation is wrong
– Glostas
Nov 9 '18 at 10:01
Manuel, could you please tell me, does the answer I've posted solve your problem? I ask because I'd prefer to remove it if it is not correct or, worse, misleading. Thank you.
– gboffi
Nov 9 '18 at 11:16
@user8408080 Manuel report is mostly correct, they just had a wrong reason for the buggy behaviour. It's not Spyder in itself, nor the the Python interpreter, but it's an issue with the interactive console used by Spyder, i.e., IPython. See my answer below for details
– gboffi
Nov 9 '18 at 11:43