I am trying this for loop that prints some output. I am using python 2.7.5  And after every output, there is an extra space printing when I use the , after print() method. How can I stop this?  def printHeader(self, header1, header2):         # for header1         first = "|   |      "+constants.ICON_BOX         header1_count = len(header1)          available_space_for_first_part = 53 - (len(first) + header1_count)         print(available_space_for_first_part)          for i in range(available_space_for_first_part):              print("."),    The output for this will look like:  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   There are additional spaces, how can I get rid of them?  Output I want:  ..............................
3114
I'd like to do it in Python. What I'd like to do in this example in C: #include &lt;stdio.h&gt;  int main() {     int i;     for (i=0; i&lt;10; i++) printf(&quot;.&quot;);     return 0; }  Output: ..........  In Python: &gt;&gt;&gt; for i in range(10): print('.') . . . . . . . . . . &gt;&gt;&gt; print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to &quot;append&quot; strings to stdout.
45020
The following code works, although I have a feeling my \settowidth method of discarding the output is not how it should be done:  \documentclass{article} \newlength{\trashlength} \long\def\ignoreoutput#1{%  \settowidth{\trashlength}{#1}% } \long\def\command#1{  This \gdef\stuff{Stored: #1} shouldn't be here. } %% Should not raise Missing \begin{document} error here: %\ignoreoutput{\command} \begin{document}  % Should produce "nothing":  no\ignoreoutput{\command{Side %\par %%%%% this breaks everything.    effect!}}thing.   % Should output the text previously stored:  \ifx\stuff\undefined No side effect.  \else \stuff \fi \end{document}  When uncommenting the \par though, it breaks: with Paragraph ended before \@settodim was complete.  So how do I ignore commands that allow long input?
55291
Q: What command would you give to print (display on the screen) the corrected text of userNotes.txt with all sentence endings having required two blanks before the start of the next sentence?  here is my code  sed 's/.\s/.\s\s/'    but this also changed the line where it ended with dot and 2 spaces to dot and 3 spaces.
26696
In Program 1 Hello world gets printed just once, but when I remove  \n and run it (Program 2), the output gets printed 8 times. Can someone please explain me the significance of \n here and how it affects the fork()?  Program 1   #include &lt;sys/types.h&gt; #include &lt;unistd.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt;  int main() {     printf("hello world...\n");     fork();     fork();     fork(); }   Output 1:  hello world...    Program  2  #include &lt;sys/types.h&gt; #include &lt;unistd.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt;  int main() {     printf("hello world...");     fork();     fork();     fork(); }   Output 2:  hello world... hello world...hello world...hello world...hello world...hello world...hello world...hello world...
94793
I have a text file like so  foo bar baz 1   a   alpha 2   b   beta 3   c   gamma   I can use awk to print certain columns, like 1 and 3, with {print $1, $3}, but I want to specify the columns to print by specifying the header of the column instead, something like {print $foo, $baz}. This is useful so I don't have to open the file and count the columns manually to see which column is which, and I don't have to update the script if the column number or order changes. Can I do this with awk (or another shell tool)?
15709
I want to print two files in two columns -- first file on the left side and second on the right side. paste doesn't do the job, because it can only insert a character as delimiter, so if first file lines have different length output will be twisted: $ cat file1 looooooooong line line $ cat file2 hello world $ paste file1 file2 looooooooong line   hello line    world  If it was a command to add trailing spaces like fmt --add-spaces --width 50 the problem would be solved: $ paste &lt;(fmt --add-spaces --width 50 file1) file2 looooooooong line                                 hello line                                              world  But I don't know a simple way to do this. So how to merge and print several files horizontally without twisting? Actually, I just want to look at them simultaneously.  UPD: command to add trailing spaces does exist (for example, xargs -d '\n' printf '%-50s\n') But solution like $ paste &lt;(add-trailing-spaces file1) file2  does not work as expected when file1 has fewer lines than file2.
43017
when I try to write 90% I do 90 $%$ , but none works and anything after the % doesn't print in the output, any solution ?
8711
I got an HTML with the &lt;body onload="window.print()"&gt;.   The question I'm trying to ask is:   Is there any way to remove the strings that the web browsers add to the printed page? Such as:   Web site from where the page was printed Page count Title of the web page Date of printing
94875
I want to print list of numbers from 1 to 100 and I use a for loop like the following:  number=100 for num in {1..$number} do   echo $num done   When I execute the command it only prints {1..100} and not the list of number from 1 to 100.
21860
I'm trying to debug a Python script by placing a print("foo=" + foo) statement in my code.  But where does the output appear?     It doesn't appear on the Python Console, and it doesn't appear on the area that appears when you drag the lower edge of the infobar downwards (what is the name for this area? My script errors show up in red here.)
7780
I have a script which calls two commands:  long_running_command | print_progress   The long_running_command prints progress but I'm unhappy with it. I'm using print_progress to make it nicer (namely, I print the progress in a single line).  The problem: Connection a pipe to stdout also activates a 4K buffer, so the nice print program gets nothing ... nothing ... nothing ... a whole lot ... :)  How can I disable the 4K buffer for the long_running_command (no, I do not have the source)?
45354
For some reason space is added after my equation when I colour it. This does not happen if the colour is added to text.  Is there a simple way to prevent this from happening, like a global setting (I am not interested in manually adjusting the space with \vspace{-1cm})? Perhaps there is a better way to colour my equation (another package, another command, etc), or in other words, am I doing something wrong?    \documentclass[12pt]{standalone}  \usepackage{amsmath} \usepackage{color}  \begin{document}  \begin{minipage}{4cm} \begin{equation*}     a = b + c \end{equation*} \begin{align*}     a - b &amp;= c\\     a-c &amp; b \end{align*} \end{minipage}  \vline  \begin{minipage}{4cm} \begin{equation*} \color{blue}    a = b + c \end{equation*} \begin{align*}     a - b &amp;= c\\     a-c &amp; b \end{align*} \end{minipage}  \end{document}   For reference,  doesn't seem to solve my problem, ie, adding \fboxsep0pt to my preamble did not change the output.   EDIT The comment With {\color{blue}a = b + c} there is no additional space ... solves part of the problem, but it doesn't work when using for example align (it gives an error):  \begin{align*} {\color{blue}    a - b &amp;= c}\\     a-c &amp;= b \end{align*}   If I try to fix this using the command twice leaving the &amp; outside, the spacing around = is wrong:  \begin{align*} {\color{blue}    a - b} &amp;{\color{blue}= c}\\     a-c &amp;= b \end{align*}
96075
Here is a quick question, how to use tex to print this ' symbol? An example is shown below:  data 'a list = Nil | Cons (e, 'a list)   I tried to use ' or `, but they all looks bad.. I am sorry but I am not a native English speaker, so I don't even know the name of '..   Could anyone help me on this simple problem? thank you
41808
Under TeX, when I write a line too long, it prints a fat black box at the end of the line.  That is probably a feature, but I dislike it.  How to turn that OFF? Is there a command-line option or something else?   I usually use LaTeX, but I have a complicated file which happens to be plain TeX.
92361
I am trying to insert the symbol in the title of the question, which I copied from a PDF article, but it appears as space in the output file. What is the corresponding LaTeX command?
73177
I need a way to determine the space remaining on a disk volume using python on linux, Windows and OS X. I'm currently parsing the output of the various system calls (df, dir) to accomplish this - is there a better way?
10087
I'd like to output hello world over 20 characters.  printf "%-20s :\n\n" 'hello world!!'  # Actual output hello world!!        :  # Wanted output hello world!!========:   However, I don't want to complete with spaces but with "=" instead. How do I do that?