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
54
votes
4 answers

How to remove square brackets from list in Python?

LIST = ['Python','problem','whatever'] print(LIST) When I run this program I get [Python, problem, whatever] Is it possible to remove that square brackets from output?
Gregor Gajič
  • 643
  • 1
  • 5
  • 6
52
votes
5 answers

Add each array element to the lines of a file in ruby

If I have an array of strings e.g. a = ['a', 'b', 'c', 'd'] and I want to output the elements, to a file (e.g. .txt) one per line. So far I have: File.new("test.txt", "w+") File.open("test.txt", "w+") do |i| i.write(a) end This gives me the…
edc505
  • 871
  • 3
  • 8
  • 14
50
votes
10 answers

Printing debug output to console in Codeception

Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for debugging the tests themselves (e.g. like you would var_dump() a variable…
Ayame__
  • 980
  • 2
  • 9
  • 21
49
votes
5 answers

Create Java console inside a GUI panel

How can I create an instance of the Java console inside of a GUI panel?
raman
44
votes
2 answers

CMake: setting an environmental variable for ctest (or otherwise getting failed test output from ctest/make test automatically)

I want ctest to show me the failed tests output by default. That is, I want to run: $ make all test and see any output of failed tests without having to cat Testing/Temporary/LastTest.log. It appears that there are two ways of doing this: (1)…
Jeet
  • 38,594
  • 7
  • 49
  • 56
41
votes
9 answers

How is returning the output of a function different from printing it?

In my previous question, Andrew Jaffe writes: In addition to all of the other hints and tips, I think you're missing something crucial: your functions actually need to return something. When you create autoparts() or splittext(), the idea is that…
Thanx
  • 7,403
  • 5
  • 21
  • 12
41
votes
3 answers

How do I print colored text to the terminal in Rust?

How do I output colored text to the terminal using Rust? I've tried using the special escape characters that I found in this python answer, but they just print literally. Here is my code: fn main() { println!("\033[93mError\033[0m"); }
Sylvester Kruin
  • 3,294
  • 5
  • 16
  • 39
39
votes
3 answers

How to save the output of this awk command to file?

I wanna save this command to another text: awk '{print $2}' it extract's from text. now i wanna save output too another text. thanks
user2034825
  • 393
  • 1
  • 3
  • 4
38
votes
2 answers

C/C++ printf() before scanf() issue

I'm using Eclipse to code in C/C++ and I'm struggling with what might be something pretty easy. In my code below I use printf() and after scanf(). Althougth printf is written before scanf() the output differs. I was able to find out something about…
quapka
  • 2,799
  • 4
  • 21
  • 35
38
votes
18 answers

How to recover closed output window in netbeans?

It often happens to me that I want to clear the current output window by using the context menu, but instead of hitting the Clear entry, I accidently hit the Close entry (which is directly below Clear). How can I get that output window back!? Via…
radlan
  • 2,393
  • 4
  • 33
  • 53
37
votes
5 answers

What is the fastest way to output large DataFrame into a CSV file?

For python / pandas I find that df.to_csv(fname) works at a speed of ~1 mln rows per min. I can sometimes improve performance by a factor of 7 like this: def df2csv(df,fname,myformats=[],sep=','): """ # function is faster than to_csv # 7…
Lev Selector
  • 3,681
  • 3
  • 17
  • 8
34
votes
3 answers

How do I echo directly on standard output inside a shell function?

I, in my script, shell a function that prints a message on the console. It can be called from any other function. function print_message { echo "message content" } The problem is, in shell, functions like echo or printf that usually print data…
Aracthor
  • 5,757
  • 6
  • 31
  • 59
33
votes
3 answers

Suppress output from non-PowerShell commands?

I am running a command hg st and then checking it's $LASTEXITCODE to check for availability of mercurial in the current directory. I do not care about its output and do not want to show it to my users. How do I suppress ALL output, success or…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
32
votes
6 answers

How can I hide skipped tasks output in Ansible

I have Ansible role, for example --- - name: Deploy app1 include: deploy-app1.yml when: 'deploy_project == "{{app1}}"' - name: Deploy app2 include: deploy-app2.yml when: 'deploy_project == "{{app2}}"' But I deploy only one app in one role…
32cupo
  • 850
  • 5
  • 18
  • 36
32
votes
4 answers

Random forest output interpretation

I have run a random forest for my data and got the output in the form of a matrix. What are the rules it applied to classify? P.S. I want a profile of the customer as output, e.g. Person from New York, works in the technology industry, etc. How can…
user2061730
  • 329
  • 1
  • 3
  • 3