1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Rep Power

    Subprocess Print file

    From the interactive window: PyWin 2.7.3

    I sucessfully print the file All3Rpts.txt to the line printer using the following syntax:

    >>> from subprocess import *
    >>> file = "C:\\Users\\Jake Sadlak\\Documents\\StockBee\\dailyStocks\\FileIO\\All3Rpts.txt"
    >>> check_output("start /min notepad /P" + file, shell=True)

    Continuing on....

    I then copy/paste this to a python program and run. The print does not occur.

    I then go back to the interactive woindow and run the above code and now the print doesn't occur. There's no error printed.

    I look at the All3Rpts.txt file in wordPad and the file has 0 bytes, the file is empty.

    I'm looking for advice on how to resolve this issue.
  2. #2
  3. Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Aug 2011
    Rep Power
    Put a space between the P and the "
    When you cut and paste did you include the prompt?
    You shouldn't.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo