Em 06-06-2010 04:05, John Machin escreveu:
> On Jun 6, 12:14 pm, MRAB wrote:
>> Paulo da Silva wrote:
...
>>> OK! This fixes my current problem. I used encoding="iso-8859-15". This
>>> is how my text files are encoded.
>>> But what about a more general case where the encoding of the text file
>>>
On Jun 6, 12:14 pm, MRAB wrote:
> Paulo da Silva wrote:
> > Em 06-06-2010 00:41, Chris Rebert escreveu:
> >> On Sat, Jun 5, 2010 at 4:03 PM, Paulo da Silva
> >> wrote:
> > ...
>
> >> Specify the encoding of the text when opening the file using the
> >> `encoding` parameter. For Windows-1252 for e
Paulo da Silva wrote:
Em 06-06-2010 00:41, Chris Rebert escreveu:
On Sat, Jun 5, 2010 at 4:03 PM, Paulo da Silva
wrote:
...
Specify the encoding of the text when opening the file using the
`encoding` parameter. For Windows-1252 for example:
your_file = open("path/to/file.ext", 'r', encoding
Em 06-06-2010 00:41, Chris Rebert escreveu:
> On Sat, Jun 5, 2010 at 4:03 PM, Paulo da Silva
> wrote:
...
>
> Specify the encoding of the text when opening the file using the
> `encoding` parameter. For Windows-1252 for example:
>
> your_file = open("path/to/file.ext", 'r', encoding='cp1252')
>
Chris,
> Specify the encoding of the text when opening the file using the `encoding`
> parameter. For Windows-1252 for example:
>
> your_file = open("path/to/file.ext", 'r', encoding='cp1252')
This looks similar to the codecs module's functionality. Do you know if
the codecs module is still req
On Sat, Jun 5, 2010 at 4:03 PM, Paulo da Silva
wrote:
> I need to read text files and process each line using string
> comparisions and regexp.
>
> I have a python2 program that uses .readline to read each
> line as a string. Then, processing it was a trivial job.
>
> With python3 I got error mess
I need to read text files and process each line using string
comparisions and regexp.
I have a python2 program that uses .readline to read each
line as a string. Then, processing it was a trivial job.
With python3 I got error messagew like:
File "./pp1.py", line 93, in RL
line=inf.readline()