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
109
votes
15 answers

What is the purpose of the return statement? How is it different from printing?

What does the return statement do? How should it be used in Python? How does return differ from print? See also Often, people try to use print in a loop inside a function in order to see multiple values, and want to be able to use the results from…
Hitesh Kumar
  • 1,223
  • 2
  • 9
  • 4
107
votes
9 answers

How to read a CSV file from a URL with Python?

when I do curl to a API call link http://example.com/passkey=wedsmdjsjmdd curl 'http://example.com/passkey=wedsmdjsjmdd' I get the employee output data on a csv file format,…
mongotop
  • 7,114
  • 14
  • 51
  • 76
90
votes
4 answers

Redirecting command output in docker

I want to do some simple logging for my server which is a small Flask app running in a Docker container. Here is the Dockerfile # Dockerfile FROM dreen/flask MAINTAINER dreen WORKDIR /srv # Get source RUN mkdir -p /srv COPY perfektimprezy.tar.gz…
Dreen
  • 6,976
  • 11
  • 47
  • 69
89
votes
3 answers

Suppress console output in PowerShell

I have a call to GPG in the following way in a PowerShell script: $key = & 'gpg' --decrypt "secret.gpg" --quiet --no-verbose > $null I don't want any output from GPG to be seen on the main console when I'm running the script. Due to my noobness…
Dominik Antal
  • 3,281
  • 4
  • 34
  • 50
84
votes
3 answers

How to use python numpy.savetxt to write strings and float number to an ASCII file?

I have a set of lists that contain both strings and float numbers, such as: import numpy as num NAMES = num.array(['NAME_1', 'NAME_2', 'NAME_3']) FLOATS = num.array([ 0.5 , 0.2 , 0.3 ]) DAT = num.column_stack((NAMES, FLOATS)) I want…
Victor
  • 1,014
  • 1
  • 9
  • 11
83
votes
8 answers

How to display progress of scipy.optimize function?

I use scipy.optimize to minimize a function of 12 arguments. I started the optimization a while ago and still waiting for results. Is there a way to force scipy.optimize to display its progress (like how much is already done, what are the current…
Roman
  • 124,451
  • 167
  • 349
  • 456
81
votes
3 answers

Static (Lexical) Scoping vs Dynamic Scoping (Pseudocode)

Program A() { x, y, z: integer; procedure B() { y: integer; y=0; x=z+1; z=y+2; } procedure C() { z: integer; procedure D() { x: integer; x = z…
petrov
  • 1,085
  • 3
  • 12
  • 13
77
votes
4 answers

Where does the slf4j log file get saved?

I have the followed imports: import org.slf4j.Logger; import org.slf4j.LoggerFactory; and the following instantiation: private static Logger logger = LoggerFactory.getLogger(Test.class); and the following in my Main method: logger.info("SOME…
user2763361
  • 3,789
  • 11
  • 45
  • 81
73
votes
2 answers

Angular 2 - How to trigger a method on a child from the parent

It's possible to send data from the parent to a child through @Input, or to call a method on the parent from the child with @Output, but I'd like to do exactly the other way around, which is calling a method on the child from the parent. Basically…
Christophe Vidal
  • 1,894
  • 1
  • 19
  • 13
69
votes
10 answers

Write to multiple outputs by key Spark - one Spark job

How can you write to multiple outputs dependent on the key using Spark in a single Job. Related: Write to multiple outputs by key Scalding Hadoop, one MapReduce Job E.g. sc.makeRDD(Seq((1, "a"), (1, "b"), (2, "c"))) .writeAsMultiple(prefix,…
samthebest
  • 30,803
  • 25
  • 102
  • 142
61
votes
5 answers

How to clear previously echoed items in PHP

In php, is there any way to clear/remove all previously echoed or printed items? For example:
edt
  • 22,010
  • 30
  • 83
  • 118
58
votes
1 answer

How to set Golang's log output back to console?

Google Go's log package has SetOutput - a function for setting the log output to any io.Writer. After I set it for testing, I would like to revert the output back to the standard console output - how do I do that? I don't see any obvious way of…
ThePiachu
  • 8,695
  • 17
  • 65
  • 94
56
votes
1 answer

Winston Logger - NodeJs Debug console logs not showing in VSCode

I'm using VSCode debugger and winston logger for NodeJS, but can't see output from application unless I specify external terminal like this: "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", …
Josip
  • 1,061
  • 1
  • 9
  • 10
56
votes
3 answers

list output truncated - How to expand listed variables with str() in R

I have a data.frame df with 600+ variables. I'm writing a function that automates the creation of columns and need to visually check them once. The str function provides a good summary: str(df) 'data.frame': 29 obs. of 602 variables: $…
jpinelo
  • 1,414
  • 5
  • 16
  • 28
55
votes
3 answers

h:outputText does not break \r\n characters into new lines

I have a String variable which contains carriage returns and new lines \r\n. text = "Text1\r\nText2\r\nText3"; I'm presenting it using . But it doesn't recognize the new line characters and shows…
Pellizon
  • 1,365
  • 2
  • 12
  • 26