On Thu, Apr 11, 2013 at 10:05 PM, Oscar Benjamin
wrote:
> On 11 April 2013 11:50, Steven D'Aprano
> wrote:
>> Some (most?) modern operating systems provide a cryptographically strong
>> source of non-deterministic randomness. The non-deterministic part comes
>> from external "stuff", which is cal
On 2013-04-11 17:35, Oscar Benjamin wrote:
On 11 April 2013 11:50, Steven D'Aprano
wrote:
On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote:
On 11 April 2013 08:47, Steven D'Aprano
wrote:
One thing to be aware of: urandom may run out of entropy, and then it
will slow down a lot. If
On 11 April 2013 11:50, Steven D'Aprano
wrote:
> On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote:
>
>> On 11 April 2013 08:47, Steven D'Aprano
>> wrote:
>>
>>> One thing to be aware of: urandom may run out of entropy, and then it
>>> will slow down a lot. If you don't care about cryptogr
On 2013-04-11 16:20, Steven D'Aprano wrote:
On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote:
On 11 April 2013 08:47, Steven D'Aprano
wrote:
One thing to be aware of: urandom may run out of entropy, and then it
will slow down a lot. If you don't care about cryptographic randomness,
y
On Thu, 11 Apr 2013 10:47:43 +0100, Oscar Benjamin wrote:
> On 11 April 2013 08:47, Steven D'Aprano
> wrote:
>
>> One thing to be aware of: urandom may run out of entropy, and then it
>> will slow down a lot. If you don't care about cryptographic randomness,
>> you could use this instead:
>
> R
On 11 April 2013 08:47, Steven D'Aprano
wrote:
> One thing to be aware of: urandom may run out of entropy, and then it
> will slow down a lot. If you don't care about cryptographic randomness,
> you could use this instead:
Reading this I'm realising that I don't really know what os.urandom
is. H
On 11 April 2013 02:21, gry wrote:
> Dear pythonistas,
>I am writing a tiny utility to produce a file consisting of a
> specified number of lines of a given length of random ascii
> characters. I am hoping to find a more time and memory efficient way,
> that is still fairly simple clear, and
On Wed, 10 Apr 2013 18:21:51 -0700, gry wrote:
> Dear pythonistas,
>I am writing a tiny utility to produce a file consisting of a
> specified number of lines of a given length of random ascii characters.
> I am hoping to find a more time and memory efficient way, that is still
> fairly simple
On Thu, Apr 11, 2013 at 3:33 PM, Steven D'Aprano
wrote:
> I was originally going to write that using the base64 module would
> introduce bias into the random strings, but after a little investigation,
> I don't think it does.
Assuming that os.urandom() returns bytes with perfectly fair
distributi
On Thu, 11 Apr 2013 11:45:31 +1000, Chris Angelico wrote:
> On Thu, Apr 11, 2013 at 11:21 AM, gry wrote:
>> avail_chrs =
>> '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&
>> \'()*+,-./:;<=>?@[\\]^_`{}'
>
> Is this exact set of characters a requirement? For instance, would
On Thu, Apr 11, 2013 at 12:40 PM, gry wrote:
> Appealing idea, but it's slower than the array solution: 5min 13
> secs. vs 4min 30sec for the array:
>
> for l in range(rows):
> for i in xrange(nchars):
> stdout.write(random.choice(avail_chrs))
> stdout.write('\n')
>
>
> os.urandom
On 11/04/2013 02:21, gry wrote:
Dear pythonistas,
I am writing a tiny utility to produce a file consisting of a
specified number of lines of a given length of random ascii
characters. I am hoping to find a more time and memory efficient way,
that is still fairly simple clear, and _pythonic_.
On Apr 10, 9:52 pm, Michael Torrie wrote:
> On 04/10/2013 07:21 PM, gry wrote:
>
>
>
>
>
>
>
>
>
> > from sys import stdout
> > from array import array
> > import random
> > nchars = 3200
> > rows = 10
> > avail_chrs =
> > '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&
>
On 04/10/2013 07:21 PM, gry wrote:
> from sys import stdout
> from array import array
> import random
> nchars = 3200
> rows = 10
> avail_chrs =
> '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&
> \'()*+,-./:;<=>?@[\\]^_`{}'
> a = array('c', 'X' * nchars)
>
> for l in ran
On Thu, Apr 11, 2013 at 11:21 AM, gry wrote:
> avail_chrs =
> '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&
> \'()*+,-./:;<=>?@[\\]^_`{}'
Is this exact set of characters a requirement? For instance, would it
be acceptable to instead use this set of characters?
avail_chrs
Dear pythonistas,
I am writing a tiny utility to produce a file consisting of a
specified number of lines of a given length of random ascii
characters. I am hoping to find a more time and memory efficient way,
that is still fairly simple clear, and _pythonic_.
I would like to have something th
16 matches
Mail list logo