how do I clear a printed line and replace it with updated variable IDLE [duplicate]
This question already has an answer here:
Print to the same line and not a new line in python
9 answers
I need to clear a printed line, but so far I have found no good answers for using python 3.7, IDLE on windows 10. I am trying to make a simple code that prints a changing variable. But I don't want tons of new lines being printed. I want to try and get it all on one line.
Is it possible to print a variable that has been updated later on in the code?
Do remember I am doing this in IDLE, not kali or something like that.
Thanks for all your help in advance.
python-3.x python-idle
marked as duplicate by DYZ, usr2564301, Jean-François Fabre♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Print to the same line and not a new line in python
9 answers
I need to clear a printed line, but so far I have found no good answers for using python 3.7, IDLE on windows 10. I am trying to make a simple code that prints a changing variable. But I don't want tons of new lines being printed. I want to try and get it all on one line.
Is it possible to print a variable that has been updated later on in the code?
Do remember I am doing this in IDLE, not kali or something like that.
Thanks for all your help in advance.
python-3.x python-idle
marked as duplicate by DYZ, usr2564301, Jean-François Fabre♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Print to the same line and not a new line in python
9 answers
I need to clear a printed line, but so far I have found no good answers for using python 3.7, IDLE on windows 10. I am trying to make a simple code that prints a changing variable. But I don't want tons of new lines being printed. I want to try and get it all on one line.
Is it possible to print a variable that has been updated later on in the code?
Do remember I am doing this in IDLE, not kali or something like that.
Thanks for all your help in advance.
python-3.x python-idle
This question already has an answer here:
Print to the same line and not a new line in python
9 answers
I need to clear a printed line, but so far I have found no good answers for using python 3.7, IDLE on windows 10. I am trying to make a simple code that prints a changing variable. But I don't want tons of new lines being printed. I want to try and get it all on one line.
Is it possible to print a variable that has been updated later on in the code?
Do remember I am doing this in IDLE, not kali or something like that.
Thanks for all your help in advance.
This question already has an answer here:
Print to the same line and not a new line in python
9 answers
python-3.x python-idle
python-3.x python-idle
asked Nov 26 '18 at 6:17
hemopocohemopoco
111
111
marked as duplicate by DYZ, usr2564301, Jean-François Fabre♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by DYZ, usr2564301, Jean-François Fabre♦
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 27 '18 at 20:12
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The Python language definition defines when bytes will be sent to a file, such as sys.stdout, the default file for print
. It does not define what the connected device does with the bytes.
When running code from IDLE, sys.stdout is initially connected to IDLE's Shell window. Shell is not a terminal and does not interpret terminal control codes other than 'n'. The reasons are a) IDLE is aimed at program development, by programmers, rather than program running by users, and developers sometimes need to see all the output from a program; and b) IDLE is cross-platform, while terminal behaviors are various, depending on the system, settings, and current modes (such as insert versus overwrite).
However, I am planning to add an option to run code in an IDLE editor with sys.stdout directed to the local system terminal/console.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The Python language definition defines when bytes will be sent to a file, such as sys.stdout, the default file for print
. It does not define what the connected device does with the bytes.
When running code from IDLE, sys.stdout is initially connected to IDLE's Shell window. Shell is not a terminal and does not interpret terminal control codes other than 'n'. The reasons are a) IDLE is aimed at program development, by programmers, rather than program running by users, and developers sometimes need to see all the output from a program; and b) IDLE is cross-platform, while terminal behaviors are various, depending on the system, settings, and current modes (such as insert versus overwrite).
However, I am planning to add an option to run code in an IDLE editor with sys.stdout directed to the local system terminal/console.
add a comment |
The Python language definition defines when bytes will be sent to a file, such as sys.stdout, the default file for print
. It does not define what the connected device does with the bytes.
When running code from IDLE, sys.stdout is initially connected to IDLE's Shell window. Shell is not a terminal and does not interpret terminal control codes other than 'n'. The reasons are a) IDLE is aimed at program development, by programmers, rather than program running by users, and developers sometimes need to see all the output from a program; and b) IDLE is cross-platform, while terminal behaviors are various, depending on the system, settings, and current modes (such as insert versus overwrite).
However, I am planning to add an option to run code in an IDLE editor with sys.stdout directed to the local system terminal/console.
add a comment |
The Python language definition defines when bytes will be sent to a file, such as sys.stdout, the default file for print
. It does not define what the connected device does with the bytes.
When running code from IDLE, sys.stdout is initially connected to IDLE's Shell window. Shell is not a terminal and does not interpret terminal control codes other than 'n'. The reasons are a) IDLE is aimed at program development, by programmers, rather than program running by users, and developers sometimes need to see all the output from a program; and b) IDLE is cross-platform, while terminal behaviors are various, depending on the system, settings, and current modes (such as insert versus overwrite).
However, I am planning to add an option to run code in an IDLE editor with sys.stdout directed to the local system terminal/console.
The Python language definition defines when bytes will be sent to a file, such as sys.stdout, the default file for print
. It does not define what the connected device does with the bytes.
When running code from IDLE, sys.stdout is initially connected to IDLE's Shell window. Shell is not a terminal and does not interpret terminal control codes other than 'n'. The reasons are a) IDLE is aimed at program development, by programmers, rather than program running by users, and developers sometimes need to see all the output from a program; and b) IDLE is cross-platform, while terminal behaviors are various, depending on the system, settings, and current modes (such as insert versus overwrite).
However, I am planning to add an option to run code in an IDLE editor with sys.stdout directed to the local system terminal/console.
answered Nov 26 '18 at 16:56
Terry Jan ReedyTerry Jan Reedy
12.3k12140
12.3k12140
add a comment |
add a comment |