Find the answer to your Linux question:
Results 1 to 3 of 3
Using Ubantu Linux(10) with a python program that prints data coming in from bluetooth. The program works. Now I want to redirect so that the python print statement outputs to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4

    Problem with redirects


    Using Ubantu Linux(10) with a python program that prints data coming in from bluetooth. The program works. Now I want to redirect so that the python print statement outputs to a file. I used the line:
    python test.py > log.txt
    Where test.py is my program.
    The print statement no longer outputs to the console, but when I ctrl/Z to return to Linux the log file is still empty. What am I doing wrong?

  2. #2
    Just Joined!
    Join Date
    Feb 2011
    Posts
    5
    Quote Originally Posted by carltown View Post
    Using Ubantu Linux(10) with a python program that prints data coming in from bluetooth. The program works. Now I want to redirect so that the python print statement outputs to a file. I used the line:
    python test.py > log.txt
    Where test.py is my program.
    The print statement no longer outputs to the console, but when I ctrl/Z to return to Linux the log file is still empty. What am I doing wrong?

    What is the result you get as python test.py | log.txt

  3. #3
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4
    Quote Originally Posted by koopatrooper View Post
    What is the result you get as python test.py | log.txt
    With this redirect, the system no longer outputs to the console - acts like it is dumping it somewhere. When I ctrl/Z to stop the execution, however, the output file has zero bytes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •