Re: [Tutor] bogus characters in a windows file

2012-02-09 Thread Garry Willgoose
> >> I'm reading a file output by the system utility WMIC in windows (so I can >> track CPU usage by process ID) and the text file WMIC outputs seems to have >> extra characters in I've not seen before. >> >> I use os.system('WMIC /OUTPUT:c:\cpu.txt PROCESS GET ProcessId') to output >> the fil

Re: [Tutor] bogus characters in a windows file

2012-02-09 Thread Peter Otten
Garry Willgoose wrote: > I input the data with the lines > > infile = open('c:\cpu.txt','r') > infile.readline() > infile.readline() > infile.readline() > > the readline()s yield the following output > > '\xff\xfeP\x00r\x00o\x00c\x00e\x00s\x00s\x00I\x00d\x00 \x00 \x00\r\x00\n' > '\x000\x00 \x00

Re: [Tutor] bogus characters in a windows file

2012-02-08 Thread Marc Tompkins
On Wed, Feb 8, 2012 at 6:09 PM, Marc Tompkins wrote: > On Wed, Feb 8, 2012 at 5:46 PM, Garry Willgoose < > garry.willgo...@newcastle.edu.au> wrote: > >> I'm reading a file output by the system utility WMIC in windows (so I can >> track CPU usage by process ID) and the text file WMIC outputs seems

Re: [Tutor] bogus characters in a windows file

2012-02-08 Thread Dave Angel
On 02/08/2012 08:46 PM, Garry Willgoose wrote: I'm reading a file output by the system utility WMIC in windows (so I can track CPU usage by process ID) and the text file WMIC outputs seems to have extra characters in I've not seen before. I use os.system('WMIC /OUTPUT:c:\cpu.txt PROCESS GET Pr

Re: [Tutor] bogus characters in a windows file

2012-02-08 Thread Marc Tompkins
On Wed, Feb 8, 2012 at 5:46 PM, Garry Willgoose < garry.willgo...@newcastle.edu.au> wrote: > I'm reading a file output by the system utility WMIC in windows (so I can > track CPU usage by process ID) and the text file WMIC outputs seems to have > extra characters in I've not seen before. > > I use

[Tutor] bogus characters in a windows file

2012-02-08 Thread Garry Willgoose
I'm reading a file output by the system utility WMIC in windows (so I can track CPU usage by process ID) and the text file WMIC outputs seems to have extra characters in I've not seen before. I use os.system('WMIC /OUTPUT:c:\cpu.txt PROCESS GET ProcessId') to output the file and parse file c:\c