|
#1
|
|||
|
|||
Python help needed! Stars screwed me..
A year ago I wrote a python script to merge/update my Pokerstars notes on my two computers. This script takes 2 (or more) notes.txt files as input and outputs a single file that contains both sets of notes with no duplicates. Anyway...
Recently Stars changed the format of the Notes.txt files. I am in the process of updating my script, but it seems that Stars is using some kind of different encoding for the text. I was thinking unicode obv, but I can't get it to print out right. When I open the notes.txt in notepad, it looks fine. But when the file is read and echoed to the terminal, there is a non alphanumeric character between each legit character. Here is a screenshot: What am I doing wrong when reading this file? edit: here is how i'm reading: inp = open(inputfile, "r") noteList = inp.read().split("\n") inp.close() |
#2
|
|||
|
|||
Re: Python help needed! Stars screwed me..
bump
|
#3
|
|||
|
|||
Re: Python help needed! Stars screwed me..
Use codecs.open (import codecs) - codecs.open('Notes.txt', 'r', 'utf_16'). You'll have to change some of your code to use unicode where it currently doesn't though (e.g. that split, although list(inp) would work fine there)
|
|
|