No code output when writing statements in Visual Studio

Multi tool use
I'm new to Python. I have visual studio and the Python 2.7 shell.
I can run 5 + 5 in the Python shell which outputs 10.
However if I do 5 + 5 in visual studio, I don't get an output. Why is this the case?
python
add a comment |
I'm new to Python. I have visual studio and the Python 2.7 shell.
I can run 5 + 5 in the Python shell which outputs 10.
However if I do 5 + 5 in visual studio, I don't get an output. Why is this the case?
python
You are not going to get a answer because the question is to vague. Be more specific, show your code, and talk about how you are using visual studios in tandem with Python.
– Rob
Dec 28 '18 at 21:56
a python shell is a line in- line out type of setup (or an interpreter). A script or program on the other hand will not try to display an output for every single line, but they will run still the same. in visual studio, tryprint 5 + 5
instead which explicitly displays a line
– Paritosh Singh
Dec 28 '18 at 22:01
add a comment |
I'm new to Python. I have visual studio and the Python 2.7 shell.
I can run 5 + 5 in the Python shell which outputs 10.
However if I do 5 + 5 in visual studio, I don't get an output. Why is this the case?
python
I'm new to Python. I have visual studio and the Python 2.7 shell.
I can run 5 + 5 in the Python shell which outputs 10.
However if I do 5 + 5 in visual studio, I don't get an output. Why is this the case?
python
python
edited Dec 28 '18 at 22:35
cricket_007
80.4k1142110
80.4k1142110
asked Dec 28 '18 at 21:46
appleoaktreeappleoaktree
6
6
You are not going to get a answer because the question is to vague. Be more specific, show your code, and talk about how you are using visual studios in tandem with Python.
– Rob
Dec 28 '18 at 21:56
a python shell is a line in- line out type of setup (or an interpreter). A script or program on the other hand will not try to display an output for every single line, but they will run still the same. in visual studio, tryprint 5 + 5
instead which explicitly displays a line
– Paritosh Singh
Dec 28 '18 at 22:01
add a comment |
You are not going to get a answer because the question is to vague. Be more specific, show your code, and talk about how you are using visual studios in tandem with Python.
– Rob
Dec 28 '18 at 21:56
a python shell is a line in- line out type of setup (or an interpreter). A script or program on the other hand will not try to display an output for every single line, but they will run still the same. in visual studio, tryprint 5 + 5
instead which explicitly displays a line
– Paritosh Singh
Dec 28 '18 at 22:01
You are not going to get a answer because the question is to vague. Be more specific, show your code, and talk about how you are using visual studios in tandem with Python.
– Rob
Dec 28 '18 at 21:56
You are not going to get a answer because the question is to vague. Be more specific, show your code, and talk about how you are using visual studios in tandem with Python.
– Rob
Dec 28 '18 at 21:56
a python shell is a line in- line out type of setup (or an interpreter). A script or program on the other hand will not try to display an output for every single line, but they will run still the same. in visual studio, try
print 5 + 5
instead which explicitly displays a line– Paritosh Singh
Dec 28 '18 at 22:01
a python shell is a line in- line out type of setup (or an interpreter). A script or program on the other hand will not try to display an output for every single line, but they will run still the same. in visual studio, try
print 5 + 5
instead which explicitly displays a line– Paritosh Singh
Dec 28 '18 at 22:01
add a comment |
2 Answers
2
active
oldest
votes
That is because, when you use the python shell. Shell is executing 5 + 5 when you press enter. Meaning shell executes you commands line by line, as you type them.
On the other hand Visual Studio is not a shell environment, it is an IDE (editor). Which allows you to write the whole python program and then execute it all at once.
add a comment |
In the shell the "addition" is evaluated immediately.
In the editor you have to write:
print(5 + 5)
You have to tell the program, that it should "print" something in the shell.
More Examples:
print("this will be printed")
print("this is a" + "test")
In the last example the second string is appended to the first one.
For reference or learning Python
Well, whatever is typed is "evaluated", not "solved"
– cricket_007
Dec 28 '18 at 22:36
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%2f53964599%2fno-code-output-when-writing-statements-in-visual-studio%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
That is because, when you use the python shell. Shell is executing 5 + 5 when you press enter. Meaning shell executes you commands line by line, as you type them.
On the other hand Visual Studio is not a shell environment, it is an IDE (editor). Which allows you to write the whole python program and then execute it all at once.
add a comment |
That is because, when you use the python shell. Shell is executing 5 + 5 when you press enter. Meaning shell executes you commands line by line, as you type them.
On the other hand Visual Studio is not a shell environment, it is an IDE (editor). Which allows you to write the whole python program and then execute it all at once.
add a comment |
That is because, when you use the python shell. Shell is executing 5 + 5 when you press enter. Meaning shell executes you commands line by line, as you type them.
On the other hand Visual Studio is not a shell environment, it is an IDE (editor). Which allows you to write the whole python program and then execute it all at once.
That is because, when you use the python shell. Shell is executing 5 + 5 when you press enter. Meaning shell executes you commands line by line, as you type them.
On the other hand Visual Studio is not a shell environment, it is an IDE (editor). Which allows you to write the whole python program and then execute it all at once.
answered Dec 28 '18 at 22:26
ravish.hackerravish.hacker
618917
618917
add a comment |
add a comment |
In the shell the "addition" is evaluated immediately.
In the editor you have to write:
print(5 + 5)
You have to tell the program, that it should "print" something in the shell.
More Examples:
print("this will be printed")
print("this is a" + "test")
In the last example the second string is appended to the first one.
For reference or learning Python
Well, whatever is typed is "evaluated", not "solved"
– cricket_007
Dec 28 '18 at 22:36
add a comment |
In the shell the "addition" is evaluated immediately.
In the editor you have to write:
print(5 + 5)
You have to tell the program, that it should "print" something in the shell.
More Examples:
print("this will be printed")
print("this is a" + "test")
In the last example the second string is appended to the first one.
For reference or learning Python
Well, whatever is typed is "evaluated", not "solved"
– cricket_007
Dec 28 '18 at 22:36
add a comment |
In the shell the "addition" is evaluated immediately.
In the editor you have to write:
print(5 + 5)
You have to tell the program, that it should "print" something in the shell.
More Examples:
print("this will be printed")
print("this is a" + "test")
In the last example the second string is appended to the first one.
For reference or learning Python
In the shell the "addition" is evaluated immediately.
In the editor you have to write:
print(5 + 5)
You have to tell the program, that it should "print" something in the shell.
More Examples:
print("this will be printed")
print("this is a" + "test")
In the last example the second string is appended to the first one.
For reference or learning Python
edited Dec 28 '18 at 22:36
answered Dec 28 '18 at 22:31
robson90robson90
112
112
Well, whatever is typed is "evaluated", not "solved"
– cricket_007
Dec 28 '18 at 22:36
add a comment |
Well, whatever is typed is "evaluated", not "solved"
– cricket_007
Dec 28 '18 at 22:36
Well, whatever is typed is "evaluated", not "solved"
– cricket_007
Dec 28 '18 at 22:36
Well, whatever is typed is "evaluated", not "solved"
– cricket_007
Dec 28 '18 at 22:36
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.
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%2f53964599%2fno-code-output-when-writing-statements-in-visual-studio%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
vYc H 8kDFKI2oml5ckftresA,B,fu9P0cEf2E5O3X7O5p0Pccd ZOTJFIv6,SC Ey n k7BXC p
You are not going to get a answer because the question is to vague. Be more specific, show your code, and talk about how you are using visual studios in tandem with Python.
– Rob
Dec 28 '18 at 21:56
a python shell is a line in- line out type of setup (or an interpreter). A script or program on the other hand will not try to display an output for every single line, but they will run still the same. in visual studio, try
print 5 + 5
instead which explicitly displays a line– Paritosh Singh
Dec 28 '18 at 22:01