Questions tagged [output]

The externally observable consequences of calling a program on some input

The output of a program is the set of externally observable consequences of running a program on the given input.

A program's output can be manifested in several forms:

  1. What is printed to and/or
  2. What is written to an external file
  3. What changes are made to the inputs, which are then used in other functions or programs
9797 questions
4
votes
2 answers

Python print - how to clear output before print end="\r"

Normally print ("{}".foo, end="\r") works well. But the exception is when foo is long, and next time foo becomes short. The output becomes incorrect. Below is an example: import time print ("{}".format(1111), end="\r") time.sleep(2) print…
lesca
  • 429
  • 2
  • 11
4
votes
3 answers

weird delay of the output of an object when followed by start-sleep (or until script end)

For some reason, the object won't output until the sleep command is done. [pscustomobject]@{message = 'hi'}; sleep 5 Here's another example. You won't see the output until the loop finishes. foreach ($i in 1..60) { if ($i -eq 1) {…
js2010
  • 23,033
  • 6
  • 64
  • 66
4
votes
3 answers

GNU awk on win-7 cmd, won't redirect output to file

If relevant I have GNU awk V 3.1.6 downloaded directly from GNU pointed source in sourceforge. I am getting a page of URLs using wget for windows. After prcoessing the incoming file, I reduce it to single line, from which I have to extract a key…
MelBurslan
  • 2,383
  • 4
  • 18
  • 26
4
votes
2 answers

Python output: how to remove indent of a new line?

There's an annoying little problem with Python print() output: the first line after \n is indented. Like this: num = 888 print("The lucky number is:\n", num) The lucky number is: 888 I'd really like to have '888' aligned left. How can I do it?
Fabio Capezzuoli
  • 599
  • 7
  • 23
4
votes
1 answer

How to enter a password into the terminal password prompt in Python

I am trying to make a simple Python script that enters a given password in the command line after using the 'su' command (or any other command which requires administrator privileges or simply requires a password in order to be executed). I tried…
FedeCuci
  • 117
  • 1
  • 1
  • 8
4
votes
2 answers

How to get match.call() from a united function?

I have three functions and one function is made out of the other two by using useMethod(). logReg <- function(x, ...) UseMethod("logReg") logRec.numeric <- function(x, y) { print(x) } logReg.formula <- function(formula, data) { …
4
votes
2 answers

Redirect output from running process (Visual C#)

I have a console that is running and I need to get the output. I cannot use startprocess to start the console as it is spawned separately. I do not have access to the source code, I am simply trying to redirect the output from the console while it…
Matt Lynch
  • 155
  • 1
  • 7
4
votes
2 answers

How to get the optimal number of clusters from the clusGap function as an output?

I have a data frame with 2 variables and I want to use the clusGap function to find the number of clusters that would be optimal to use. This code has a similar result: library(cluster) x <- as.vector(runif(100, 0, 1)) y <- as.vector(runif(100,…
Marco Pastor Mayo
  • 803
  • 11
  • 25
4
votes
2 answers

error: expected ‘;’ before ‘generationString’

I'm currently trying to work out some issues I am experiencing with this code, can't really figure out why I am getting these 2 errors. I tried to see if something was not closed, but this not does seem to be the case, can be be cause of the…
MSL
  • 65
  • 6
4
votes
1 answer

How to print curly brackets with new formatting

I am trying to have python output something that I can then copy and past into a latex document. I need the output to look like this: q_{00} q_{01} etc, I am using this code here, but, is there a way to get the curly bracket to print, the formatted…
Joseph
  • 301
  • 3
  • 13
4
votes
1 answer

Angular 5 ngSubmit @Output fires twice

CUSTOM COMPONENT // ... @Output() submit: EventEmitter < any > = new EventEmitter(); // ... onFilterSubmit($event): void { this.submit.emit($event); this.formData = { minDate: new Date().toISOString(), maxDate: new…
Sampgun
  • 2,822
  • 1
  • 21
  • 38
4
votes
4 answers

How to prevent the Output window in VS from disappearing?

when I press Start to run my application in VS 2017 Community my Output window disappears. (I use it for i.e. Debug.WriteLine().) How to prevent this? P.S. The output window I`m refering to (not the command line window!): The output…
user7470355
4
votes
1 answer

powershell output to file AND console

I have a Powershell script running some hours. The execution shall be observed in a normal console window. Additionally (no redirect!) I would like to stream the output to a log file. Is there an easy way to do this during starting the *.ps1 script?…
Rainer
  • 1,067
  • 2
  • 14
  • 29
4
votes
3 answers

Sort in alphabetical order with lowercase before uppercase?

I started with Project Gutenberg's "The Complete Works of William Shakespeare by William Shakespeare", a UTF-8 text file available from http://www.gutenberg.org/ebooks/100. In PowerShell, I ran Get-Content -Tail 50 $filename | Sort-Object…
Tom Lever
  • 321
  • 3
  • 16
4
votes
0 answers

How to write to the alternate screen buffer on Windows using only the standard libary?

I am working on an alternate screen feature for my cross-platform terminal manipulating crate. Situation When I want to write something to console I can use the following code to write to the current standard output. This works on both UNIX and…
Timon Post
  • 2,779
  • 1
  • 17
  • 32