On Mon, 14 Dec 2009 21:37:33 -0300, Gabriel Genellina wrote:
>> There are no file objects in 3.x. The file() function no longer
>> exists. The return value from open(), will be an instance of
>> _io. depending upon the mode, e.g. _io.TextIOWrapper for 'r',
>> _io.BufferedReader for 'rb', _io.Buffe
On Dec 14, 11:44 pm, Terry Reedy wrote:
> On 12/14/2009 7:37 PM, Gabriel Genellina wrote:
>
>
>
> > En Mon, 14 Dec 2009 18:09:52 -0300, Nobody escribió:
> >> On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote:
>
> >>> The 3.1 documentation specifies that file.read returns bytes:
>
> >>
On 13 דצמבר, 22:39, Dennis Lee Bieber wrote:
> On Sat, 12 Dec 2009 22:15:50 -0800 (PST), daved170
> declaimed the following in gmane.comp.python.general:
>
> > Thank you all.
> > Dennis I really liked you solution for the issue but I have two
> > question about it:
> > 1) My origin file is Text f
On 12/14/2009 7:37 PM, Gabriel Genellina wrote:
En Mon, 14 Dec 2009 18:09:52 -0300, Nobody escribió:
On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote:
The 3.1 documentation specifies that file.read returns bytes:
Does it need fixing?
There are no file objects in 3.x. The fil
On Dec 14, 4:09 pm, Nobody wrote:
> On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote:
> > The 3.1 documentation specifies that file.read returns bytes:
> > Does it need fixing?
>
> There are no file objects in 3.x.
Then the documentation definitely needs fixing; the excerpt I posted
En Mon, 14 Dec 2009 18:09:52 -0300, Nobody escribió:
On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote:
The 3.1 documentation specifies that file.read returns bytes:
Does it need fixing?
There are no file objects in 3.x. The file() function no longer
exists. The return value f
On Mon, 14 Dec 2009 03:14:11 +, MRAB wrote:
>>> You originally stated that you want to "scramble" the bytes -- if
>>> you mean to implement some sort of encryption algorithm you should know
>>> that most of them work in blocks as the "key" is longer than one byte.
>>
>> Block ciphers work
On Sun, 13 Dec 2009 22:56:55 -0800, sjdevn...@yahoo.com wrote:
> The 3.1 documentation specifies that file.read returns bytes:
> Does it need fixing?
There are no file objects in 3.x. The file() function no longer
exists. The return value from open(), will be an instance of
_io. depending upon t
On Dec 14, 1:57 pm, Dennis Lee Bieber wrote:
> On Sun, 13 Dec 2009 22:56:55 -0800 (PST), "sjdevn...@yahoo.com"
> declaimed the following in
> gmane.comp.python.general:
>
>
>
>
>
>
>
> > The 3.1 documentation specifies that file.read returns bytes:
>
> > file.read([size])
> > Read at most siz
On Dec 13, 5:56 pm, "Rhodri James"
wrote:
> On Sun, 13 Dec 2009 06:44:54 -, Steven D'Aprano
>
> wrote:
> > On Sat, 12 Dec 2009 22:15:50 -0800, daved170 wrote:
>
> >> Thank you all.
> >> Dennis I really liked you solution for the issue but I have two question
> >> about it:
> >> 1) My origin
Nobody wrote:
On Sun, 13 Dec 2009 12:39:26 -0800, Dennis Lee Bieber wrote:
You originally stated that you want to "scramble" the bytes -- if
you mean to implement some sort of encryption algorithm you should know
that most of them work in blocks as the "key" is longer than one byte.
B
On Sun, 13 Dec 2009 12:39:26 -0800, Dennis Lee Bieber wrote:
> You originally stated that you want to "scramble" the bytes -- if
> you mean to implement some sort of encryption algorithm you should know
> that most of them work in blocks as the "key" is longer than one byte.
Block ciphers w
On Sun, 13 Dec 2009 06:44:54 -, Steven D'Aprano
wrote:
On Sat, 12 Dec 2009 22:15:50 -0800, daved170 wrote:
Thank you all.
Dennis I really liked you solution for the issue but I have two question
about it:
1) My origin file is Text file and not binary
That's a statement, not a question
Grant Edwards wrote:
If it's a binary file...
OK, but... what is a "binary" file?
One containing data encoded in base-2.
Or one of a system of two files that orbits around a common
center of mass? So if you see two files orbiting around a
cathedral, they're binary files.
f.open('binaryf
On 2009-12-13, Michel Claveau - MVP
wrote:
> Hi!
>
>> If it's a binary file...
>
> OK, but... what is a "binary" file?
One containing data encoded in base-2.
--
Grant
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Dec 13, 2009 at 12:20 AM, Michel Claveau - MVP
wrote:
> Hi!
>
>> If it's a binary file...
>
> OK, but... what is a "binary" file?
http://en.wikipedia.org/wiki/Binary_file
Cheers,
Chris
--
http://blog.rebertia.com
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
> If it's a binary file...
OK, but... what is a "binary" file?
@+
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
daved170 wrote:
On Dec 13, 2:34 am, Dennis Lee Bieber wrote:
On Sat, 12 Dec 2009 10:46:01 +0100, census
declaimed the following in gmane.comp.python.general:
def scramble (a): return (a + 13) % 256
I'll see your modulo rot 13 and raise with a exclusive or...
-=-=-=
On 12/13/2009 5:15 PM, daved170 wrote:
Thank you all.
Dennis I really liked you solution for the issue but I have two
question about it:
1) My origin file is Text file and not binary
2) I need to read each time 1 byte. I didn't see that on your example
code.
That's where you're confusing things
On Sat, 12 Dec 2009 22:15:50 -0800, daved170 wrote:
> Thank you all.
> Dennis I really liked you solution for the issue but I have two question
> about it:
> 1) My origin file is Text file and not binary
That's a statement, not a question.
> 2) I need to read each time 1 byte.
f = open(filena
On Dec 13, 2:34 am, Dennis Lee Bieber wrote:
> On Sat, 12 Dec 2009 10:46:01 +0100, census
> declaimed the following in gmane.comp.python.general:
>
>
>
> > def scramble (a): return (a + 13) % 256
>
> I'll see your modulo rot 13 and raise with a exclusive or...
>
> -=-=-=-=-
>
> import sys
Steven D'Aprano wrote:
2) Should I use streams?
What do you mean by "streams"?
they're what come out of proton packs...just don't cross them.
It would be bad.
-tkc
(I suspect the OP is a Java/C++ programmer where "streams" are
somewhat akin to generators, but less powerful; so the answer
On Sat, 12 Dec 2009 11:14:13 -, census wrote:
Steven D'Aprano wrote:
On Sat, 12 Dec 2009 10:35:55 +0100, census wrote:
I've got some questions -
1) How do I read the file byte by byte 2) Should I use streams? If so
and I get my entire scrambled text in stream can I just write it to
th
Steven D'Aprano wrote:
> On Sat, 12 Dec 2009 10:35:55 +0100, census wrote:
>
>>> I've got some questions -
>>> 1) How do I read the file byte by byte 2) Should I use streams? If so
>>> and I get my entire scrambled text in stream can I just write it to the
>>> binary file?
>>>
>>> Thanks
>>> Dave
On Fri, 11 Dec 2009 23:16:42 -0800, daved170 wrote:
> Hello everybody,
> I need to read a text file byte after byte. Eache byte is sent to a
> function that scramble it and I need to write the result to binary file.
>
> I've got some questions -
> 1) How do I read the file byte by byte
f = open
On Sat, 12 Dec 2009 10:35:55 +0100, census wrote:
>> I've got some questions -
>> 1) How do I read the file byte by byte 2) Should I use streams? If so
>> and I get my entire scrambled text in stream can I just write it to the
>> binary file?
>>
>> Thanks
>> Dave
>
> f = open ("binaryfile", "r")
daved170 wrote:
> Hello everybody,
> I need to read a text file byte after byte.
> Eache byte is sent to a function that scramble it
> and I need to write the result to binary file.
>
> I've got some questions -
> 1) How do I read the file byte by byte
> 2) Should I use streams? If so and I get my
daved170 wrote:
> Hello everybody,
> I need to read a text file byte after byte.
> Eache byte is sent to a function that scramble it
> and I need to write the result to binary file.
>
> I've got some questions -
> 1) How do I read the file byte by byte
> 2) Should I use streams? If so and I get my
Hello everybody,
I need to read a text file byte after byte.
Eache byte is sent to a function that scramble it
and I need to write the result to binary file.
I've got some questions -
1) How do I read the file byte by byte
2) Should I use streams? If so and I get my entire scrambled text in
stream
29 matches
Mail list logo