On 26 fév, 22:08, qtrimble wrote:
> I'm a python newbie but I do have some basic scripting experience. I
> need to take the line starting with "wer" and extract the year and day
> of year from that string. I want to be able to add the year and day
> of year from the last line having "wer*" to th
* qtrimble:
I'm a python newbie but I do have some basic scripting experience. I
need to take the line starting with "wer" and extract the year and day
of year from that string. I want to be able to add the year and day
of year from the last line having "wer*" to the lines occurring in
between
I'm a python newbie but I do have some basic scripting experience. I
need to take the line starting with "wer" and extract the year and day
of year from that string. I want to be able to add the year and day
of year from the last line having "wer*" to the lines occurring in
between "wer*" lines.
On Feb 17, 7:38 pm, Steven D'Aprano
wrote:
> On Wed, 17 Feb 2010 17:13:23 -0800, Jonathan Gardner wrote:
> > And once you realize that every program is really a compiler, then you
> > have truly mastered the Zen of Programming in Any Programming Language
> > That Will Ever Exist.
>
> In the same w
On Wed, 17 Feb 2010 17:13:23 -0800, Jonathan Gardner wrote:
> And once you realize that every program is really a compiler, then you
> have truly mastered the Zen of Programming in Any Programming Language
> That Will Ever Exist.
In the same way that every tool is really a screwdriver.
--
Stev
On Feb 16, 3:48 pm, Imaginationworks wrote:
> Hi,
>
> I am trying to read object information from a text file (approx.
> 30,000 lines) with the following format, each line corresponds to a
> line in the text file. Currently, the whole file was read into a
> string list using
On Feb 17, 1:40 pm, Paul McGuire wrote:
> On Feb 16, 5:48 pm, Imaginationworks wrote:
>
> > Hi,
>
> > I am trying to read object information from a text file (approx.
> > 30,000 lines) with the following format, each line corresponds to a
> > line in the text fil
On Feb 16, 5:48 pm, Imaginationworks wrote:
> Hi,
>
> I am trying to read object information from a text file (approx.
> 30,000 lines) with the following format, each line corresponds to a
> line in the text file. Currently, the whole file was read into a
> string list using
On Feb 16, 7:14 pm, Gary Herron wrote:
> Imaginationworks wrote:
> > Hi,
>
> > I am trying to read object information from a text file (approx.
> > 30,000 lines) with the following format, each line corresponds to a
> > line in the text file. Currently, the whole f
Imaginationworks wrote:
Hi,
I am trying to read object information from a text file (approx.
30,000 lines) with the following format, each line corresponds to a
line in the text file. Currently, the whole file was read into a
string list using readlines(), then use for loop to search the
On Tue, 16 Feb 2010 23:48:17 -, Imaginationworks
wrote:
Hi,
I am trying to read object information from a text file (approx.
30,000 lines) with the following format, each line corresponds to a
line in the text file. Currently, the whole file was read into a
string list using readlines
Hi,
I am trying to read object information from a text file (approx.
30,000 lines) with the following format, each line corresponds to a
line in the text file. Currently, the whole file was read into a
string list using readlines(), then use for loop to search the "= {"
and "};&qu
On Jan 19, 7:00 am, Peter Otten <__pete...@web.de> wrote:
> Dr. Benjamin David Clarke wrote:
>
> > I currently have a program that reads in values for an OptionMenu from
> > a text file. I also have an option to add a line to that text file
> > which corresponds to a
Dr. Benjamin David Clarke wrote:
> I currently have a program that reads in values for an OptionMenu from
> a text file. I also have an option to add a line to that text file
> which corresponds to a new value for that OptionMenu. How can I make
> that OptionMenu update its values b
* Dr. Benjamin David Clarke:
I currently have a program that reads in values for an OptionMenu from
a text file. I also have an option to add a line to that text file
which corresponds to a new value for that OptionMenu. How can I make
that OptionMenu update its values based on that text file
I currently have a program that reads in values for an OptionMenu from
a text file. I also have an option to add a line to that text file
which corresponds to a new value for that OptionMenu. How can I make
that OptionMenu update its values based on that text file without
restarting the program
he laptop with the file I seriously doubt anybody who
>finds it will go through each and every file and try to find what's in
>it, even though they look like data files and there is no hint what so
>ever that any one of them contains encrypted info. If they see a text
>file, well, tha
Anthra Norell wrote:
> I consider the encryption unbreakable [...] (from previous thread)
I am not a cryptographer. (from this thread)
Then you shouldn't be making claims about your encryption algorithms.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
On 2010-01-12 05:59 AM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-11 14:09 PM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Upon which another critic
conjured up the horror vision of gigahertzes hacking my pathetic
little
Robert Kern wrote:
> On 2010-01-12 05:59 AM, Anthra Norell wrote:
[ping, pong, ping, pong]
> If the OP uses a real encryption algorithm, he can rely on the fact that
> he can use the algorithm for large files or for plaintexts that a
> malicious agent might choose even if he did not communicate (or
On 2010-01-12 05:59 AM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-11 14:09 PM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Upon which another critic
conjured up the horror vision of gigahertzes hacking my pathetic
little
effort to pieces as
Robert Kern wrote:
On 2010-01-11 14:09 PM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
"Don't use a random generator for encryption purposes!" warns the
manual, of which fact I was reminded in no uncertain terms on this
forum
a few years ago when I p
Anthra Norell writes:
> Why EVER make anything yourself when you can buy it?
Do you make your own processors? Your own hard disk drives?
Why not?
--
John Bokma
Read my blog: http://johnbokma.com/
Hire me (Perl/Python): http://castleamber.com/
--
http://mail.python.org/mailman/listinfo/python
John Bokma writes:
>> Why EVER make anything yourself when you can buy it?
>
> Do you make your own processors? Your own hard disk drives?
> Why not?
Well, if you try to make your own processors or hard drives, worst
normal outcome is they don't work and you try something else instead.
This is mo
Paul Rubin writes:
> John Bokma writes:
>>> Why EVER make anything yourself when you can buy it?
>>
>> Do you make your own processors? Your own hard disk drives?
>> Why not?
>
> Well, if you try to make your own processors or hard drives, worst
> normal outcome is they don't work and you try so
On 2010-01-11 14:09 PM, Anthra Norell wrote:
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
"Don't use a random generator for encryption purposes!" warns the
manual, of which fact I was reminded in no uncertain terms on this forum
a few years ago when I proposed the following
Anthra Norell writes:
> Why EVER make anything yourself when you can buy it?
http://en.wikipedia.org/wiki/Dunning-Kruger_effect
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way th
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
geremy condra writes:
> And having no dependencies frees you from the burden of testing
> where your software will be deployed? I don't think so.
If you just use the stdlib and are a bit careful about OS dependent
features, your code can run pretty much everywhere. More to the point,
if (say) yo
Carl Banks wrote:
> On Jan 8, 11:14 am, Daniel Fetchinson
> wrote:
>> I have a plain text file which I would like to protect in a very
>> simple minded, yet for my purposes sufficient, way. I'd like to
>> encrypt/convert it into a binary file in such a way that posse
On Sun, Jan 10, 2010 at 3:26 PM, Paul Rubin wrote:
> geremy condra writes:
>> Not sure why in the world you would homebrew something like this- a
>> small dependency isn't that bad, and aes can be pretty simple to use.
>> Might as well go for the industrial strength approach.
>
> In my experience
On Jan 8, 11:14 am, Daniel Fetchinson
wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password allows anyone t
Paul Rubin wrote:
> Steve Holden writes:
>>> Right now, even asking for HTTPS support is too much to ask. Heck,
>>> even asking for the fake HTTPS support to be identified as such is too
>>> much, apparently.
>>>
>> No, Paul, nobody will complain if you *ask* ...
>
> Er, that wasn't me...
>
Oh s
Nobody writes:
> But, yeah, the OP needs to be aware of the difference (and probably isn't,
> yet). So to take that a step further ...
> The key passed to arcfour.schedule() shouldn't be re-used
> If you need to verify the data, append a hash of the ciphertext ...
> If you want to encrypt mul
Steve Holden writes:
>> Right now, even asking for HTTPS support is too much to ask. Heck,
>> even asking for the fake HTTPS support to be identified as such is too
>> much, apparently.
>>
> No, Paul, nobody will complain if you *ask* ...
Er, that wasn't me...
> A question I've been asking myse
Nobody wrote:
> On Sun, 10 Jan 2010 12:26:05 -0800, Paul Rubin wrote:
>
>> I'd like it a lot if the Python stdlib could include a serious
>> cryptography module.
>
> And I'd like a truckload of gold ;)
>
> Right now, even asking for HTTPS support is too much to ask. Heck,
> even asking for the f
On Sun, 10 Jan 2010 12:26:05 -0800, Paul Rubin wrote:
> I'd like it a lot if the Python stdlib could include a serious
> cryptography module.
And I'd like a truckload of gold ;)
Right now, even asking for HTTPS support is too much to ask. Heck,
even asking for the fake HTTPS support to be identi
On Sun, 10 Jan 2010 08:54:51 -0800, Paul Rubin wrote:
> Nobody writes:
>> RC4 (aka ArcFour) is quite trivial to implement, and better than inventing
>> your own cipher or using a Vignere: ...
>
> That's a cute implementation, but it has no authentication and doesn't
> include any randomness, whi
geremy condra writes:
> Not sure why in the world you would homebrew something like this- a
> small dependency isn't that bad, and aes can be pretty simple to use.
> Might as well go for the industrial strength approach.
In my experience, 1) small dependencies ARE that bad, since they mean
you ha
Not sure why in the world you would homebrew something like this- a
small dependency isn't that bad, and aes can be pretty simple to use.
Might as well go for the industrial strength approach.
Geremy Condra
--
http://mail.python.org/mailman/listinfo/python-list
Nobody writes:
> RC4 (aka ArcFour) is quite trivial to implement, and better than inventing
> your own cipher or using a Vignere: ...
That's a cute implementation, but it has no authentication and doesn't
include any randomness, which means if you use the same key for two
inputs, there is a secur
>> Thanks, this looks very simple too, but where is the decryption code?
>> Wikipedia seems to suggest that encryption and decryption are both the
>> same but running crypt on the output of crypt doesn't give back the
>> original string. So probably I'm misunderstanding something.
>
> Yes, the natu
On Sun, 10 Jan 2010 15:30:12 +, Steven D'Aprano wrote:
>> Thanks, this looks very simple too, but where is the decryption code?
>> Wikipedia seems to suggest that encryption and decryption are both the
>> same but running crypt on the output of crypt doesn't give back the
>> original string. S
On Sun, 10 Jan 2010 09:59:31 +0100, Daniel Fetchinson wrote:
> Thanks, this looks very simple too, but where is the decryption code?
> Wikipedia seems to suggest that encryption and decryption are both the
> same but running crypt on the output of crypt doesn't give back the
> original string. So
On Sun, 10 Jan 2010 09:59:31 +0100, Daniel Fetchinson wrote:
> Thanks, this looks very simple too, but where is the decryption code?
> Wikipedia seems to suggest that encryption and decryption are both the
> same but running crypt on the output of crypt doesn't give back the
> original string. So
>> I have a plain text file which I would like to protect in a very
>> simple minded, yet for my purposes sufficient, way. I'd like to
>> encrypt/convert it into a binary file in such a way that possession of
>> a password allows anyone to convert it back into the or
On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password
Robert Kern writes:
> Are you on a 64-bit platform? Unfortunately, array's integer typecodes
> are platform-specific, but p3.py requires a 32-bit integer ...
Oh yes, thanks, I never did get around to dealing with 64 bit platforms.
I also notice that some of the unit test functions use print state
Daniel Fetchinson writes:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way.
For encrypting strings, use this module:
http://nightsong.com/phr/crypto/p3.py
Obviously this is limited to strings that fit in memory,
Daniel Fetchinson writes:
>>http://www.nightsong.com/phr/crypto/p3.py
>
> Thanks a lot, currently I'm having trouble using this code on python
> 2.6 but probably some small tweaking will fix it.
Yikes, this is the first I've heard of such a problem. I will
look into it. Thanks. (Also than
>> I have a plain text file which I would like to protect in a very
>> simple minded, yet for my purposes sufficient, way. I'd like to
>> encrypt/convert it into a binary file in such a way that possession of
>> a password allows anyone to convert it back into the or
Daniel Fetchinson writes:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password allows anyone to convert it back
Anthra Norell wrote:
Daniel
Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password allows any
> > I have a plain text file which I would like to protect in a very
> > simple minded, yet for my purposes sufficient, way. I'd like to
> > encrypt/convert it into a binary file in such a way that possession of
> > a password allows anyone to convert it back int
On 1/9/10, Steven D'Aprano wrote:
> On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote:
>
>> I have a plain text file which I would like to protect in a very simple
>> minded, yet for my purposes sufficient, way. I'd like to encrypt/convert
>> it int
>>>>> I have a plain text file which I would like to protect in a very
>>>>> simple minded, yet for my purposes sufficient, way. I'd like to
>>>>> encrypt/convert it into a binary file in such a way that possession of
>>>>> a
Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password allows anyone to convert it back
On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very simple
> minded, yet for my purposes sufficient, way. I'd like to encrypt/convert
> it into a binary file in such a way that possession of a password allo
PyCrypto is already pretty easy to use by itself. I dont know why you want a
wrapper on top of it.
On Fri, Jan 8, 2010 at 11:02 PM, Irmen de Jong wrote:
> On 8-1-2010 22:39, Daniel Fetchinson wrote:
>
>>
>>>http://www.nightsong.com/phr/crypto/p3.py
>>>
>>
>> Thanks a lot, currently I'm having
On 2010-01-08 15:47 PM, Daniel Fetchinson wrote:
I have a plain text file which I would like to protect in a very
simple minded, yet for my purposes sufficient, way. I'd like to
encrypt/convert it into a binary file in such a way that possession of
a password allows anyone to convert it
On 8-1-2010 22:39, Daniel Fetchinson wrote:
http://www.nightsong.com/phr/crypto/p3.py
Thanks a lot, currently I'm having trouble using this code on python
2.6 but probably some small tweaking will fix it.
If you keep having issues with this module, maybe you can try this:
http://www.fre
>>> I have a plain text file which I would like to protect in a very
>>> simple minded, yet for my purposes sufficient, way. I'd like to
>>> encrypt/convert it into a binary file in such a way that possession of
>>> a password allows anyone to convert it b
>> I have a plain text file which I would like to protect in a very
>> simple minded, yet for my purposes sufficient, way. I'd like to
>> encrypt/convert it into a binary file in such a way that possession of
>> a password allows anyone to convert it back into the or
On 2010-01-08 13:14 PM, Daniel Fetchinson wrote:
I have a plain text file which I would like to protect in a very
simple minded, yet for my purposes sufficient, way. I'd like to
encrypt/convert it into a binary file in such a way that possession of
a password allows anyone to convert it
I have a plain text file which I would like to protect in a very
simple minded, yet for my purposes sufficient, way. I'd like to
encrypt/convert it into a binary file in such a way that possession of
a password allows anyone to convert it back into the original text
file while not possessin
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:
&g
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
e 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(filename, 'r') # open in text mode
> > f.rea
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 statem
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
wlfr...@ix.netcom.com HTTP://wlfraed.home.netcom.com/
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.
Thanks again All
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
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 ti
(sys.argv) > 3:
> key = sys.argv[3]
> else:
> key = None
> process(fin, fout, key)
> --
> Wulfraed Dennis Lee Bieber KD6MOG
> wlfr...@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Thank you all.
Dennis I r
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 th
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
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
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 te
inhahe wrote:
i don't understand the point of using 'with'
but i don't understand what 'with' does at all
i've tried to understand it a few times
anyway here:
import random
result = random.choice(open("c:\\test.txt").readlines())
Yep. That'll do the trick. The point of "with" is that,
while i
AM, Tim Golden wrote:
> Olof Bjarnason wrote:
>>
>> 2009/11/27 baboucarr sanneh :
>>>
>>> hi all
>>>
>>> i would like to create a python program that would read from a text file
>>> and
>>> returns one result at random.
>>>
Olof Bjarnason wrote:
2009/11/27 baboucarr sanneh :
hi all
i would like to create a python program that would read from a text file and
returns one result at random.
e.g
in the text file i have these data
1.hello
2.my name
3.is
4.World
Your help is highly appreciated..thnx in advance
Hi
baboucarr sanneh wrote:
i would like to create a python program that would read from a text file
and returns one result at random.
#!/usr/bin/env python
# assuming the file fits into memory, and you are interested in
# random lines
from random import randrange
f = open('data.txt
2009/11/27 baboucarr sanneh :
> hi all
>
> i would like to create a python program that would read from a text file and
> returns one result at random.
This might be of use:
http://code.activestate.com/recipes/426332/#c2
--
Cheers,
Simon B.
--
http://mail.python.org/mailman/lis
401 - 500 of 1034 matches
Mail list logo