winsound.Beep() takes only integral values for frequency.
Therefore you cannot use it if you want either just intonation or
equal temperment scales exactly.
--
regards,
Sarma.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
On Sat, Sep 15, 2012 at 6:50 PM, Scurvy Scott wrote:
>
> I'm trying to generate a list of every possible 16 character string
> containing only 2-7 and a-z lowercase.
This type of problem is just nested iteration:
>>> seq = '01'
>>> r = []
>>> for g0 in seq:
... for g1 in seq:
Hello all, I'm just wondering how to run this block of code X amount of
times (a lot) and then store the ouput to a .txt file.
The code I've written is below.
from Crypto.PublicKey import RSA
import hashlib
m = RSA.generate(1024)
b = hashlib.sha1()
b.update(str(m))
a = b.hexdigest()
print a[:16]
This behavior seems strange to me: the find method of a string returns the
position zero when you search for an empty string (granted, I can't quite
figure out why you'd search for an empty string, either).
>>> 'abc'.find('')
0
Anyone care to share a good explantion for this behavior and possi
scratch that, new code is below for your perusal:
from Crypto.PublicKey import RSA
import hashlib
def repeat_a_lot():
count = 0
while count < 20:
m = RSA.generate(1024)
b = hashlib.sha1()
b.update(str(m))
a = b.hexdigest()
print a[:16] + '.onion'
On 09/16/2012 07:56 PM, Scurvy Scott wrote:
> scratch that, new code is below for your perusal:
>
> from Crypto.PublicKey import RSA
> import hashlib
>
> def repeat_a_lot():
> count = 0
> while count < 20:
You're kidding, aren't you? while loops are meant for those times when
you don't kn
On Sun, Sep 16, 2012 at 7:51 PM, Don Jennings wrote:
> This behavior seems strange to me: the find method of a string returns the
> position zero when you search for an empty string (granted, I can't quite
> figure out why you'd search for an empty string, either).
>
'abc'.find('')
> 0
>
>
On Sun, Sep 16, 2012 at 5:23 PM, Dave Angel wrote:
> On 09/16/2012 07:56 PM, Scurvy Scott wrote:
> > scratch that, new code is below for your perusal:
> >
> > from Crypto.PublicKey import RSA
> > import hashlib
> >
> > def repeat_a_lot():
> > count = 0
> > while count < 20:
>
> >You're ki
On Sun, Sep 16, 2012 at 8:33 PM, eryksun wrote:
>
> The 'in' operator also searches for a substring:
>
> >>> '' in 'abc'
> True
I forgot to mention, this use of slices is a peculiarity to strings.
In contrast, list.index and list.__contains__ ("in") match against
individual items. An empt
On 17/09/2012 01:56, Scurvy Scott wrote:
Why would you use an underscore rather than a letter or name like I've
always seen. I've never seen an underscore used before.
Try reading some of the documentation here http://www.python.org/doc/
It's amazing what you can learn.
--
Cheers.
Mark La
Hi, I have a bezier line with 20 points on it and I am trying to reduce
this to a line with 4 points, keeping the first and last points and 2
evenly spaced points in between like so:
**
becomes:
*. . . .*
These points are removable only by index, so if I remove poi
On 17 September 2012 02:15, Pete O'Connell wrote:
> Hi, I have a bezier line with 20 points on it and I am trying to reduce
> this to a line with 4 points, keeping the first and last points and 2
> evenly spaced points in between like so:
> **
> becomes:
> *. . .
Ah of course. Thanks very much Oscar!
Pete
On Mon, Sep 17, 2012 at 1:29 PM, Oscar Benjamin
wrote:
> On 17 September 2012 02:15, Pete O'Connell wrote:
>
>> Hi, I have a bezier line with 20 points on it and I am trying to reduce
>> this to a line with 4 points, keeping the first and last points an
On 09/16/2012 08:56 PM, Scurvy Scott wrote:
> On Sun, Sep 16, 2012 at 5:23 PM, Dave Angel wrote:
>
>> On 09/16/2012 07:56 PM, Scurvy Scott wrote:
>>> scratch that, new code is below for your perusal:
>>>
>>> from Crypto.PublicKey import RSA
>>> import hashlib
>>>
>>> def repeat_a_lot():
>>> co
hey im new to the tutor thing so please correct me if im doing something wrong.
Anyway what i am trying to do is make a simple string (word) generator and get
it to make strings (or words) starting at 10 chars up to 100 in steps of 5
using a make word function. Now my problem is how do i get
On 17/09/12 10:56, Scurvy Scott wrote:
Why would you use an underscore rather than a letter or name like I've
always seen. I've never seen an underscore used before.
An underscore on its own is often used to mean "don't care". Like a
scratch variable to hold a result when you don't actually ne
On 17/09/12 11:15, Pete O'Connell wrote:
Hi, I have a bezier line with 20 points on it and I am trying to reduce
this to a line with 4 points, keeping the first and last points and 2
evenly spaced points in between like so:
In general in Python, it is faster and much easier to create a new list
On 17/09/12 12:45, Matthew Dalrymple wrote:
Anyway what i am trying to do is make a simple string (word)
generator and get it to make strings (or words) starting at 10 chars
up to 100 in steps of 5 using a make word function. Now my problem
is how do i get it to run the mkword function and manip
Wow, thanks Dave, et al., for explaining things the way they did. I'm not
trying to and apologize for top posting, gmail wasn't giving me the option
of replying to all. I definitely understand what was going on and why when
you all were explaining the code portions to me.
_
Scurvy Scott wrote:
> Actually the loop would run 2^80 times
Remember the previous thread? This means the loop will not terminate in the
next few million years.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
htt
20 matches
Mail list logo