On Sat, Mar 19, 2016 at 8:03 AM, Steven D'Aprano wrote:
> On Sat, Mar 19, 2016 at 04:05:58PM +1100, Ben Finney wrote:
>
>> import random
>>
>> def roll_die(num_sides, rng=None):
>> """ Return a result from a random die of `num_sides` sides.
>>
>> :param num_sides: The n
Alan Gauld wrote:
> On 18/03/16 15:31, Peter Otten wrote:
>
>> I suppose he thinks that hexadecimal and binary is the same. The data you
>> showed is binary. For example the following sequence of bytes
>>
>> 9 1 120 1 253 2
>>
>> is displayed as the bytestring
>>
>> b'\t\x01x\x01\xfd'
>
> Wha
Yeh wrote:
> Thanks for your help,
>
> Sorry for top-post and MUC. It is MCU - Micro Controller Unit.
>
>> I supposed that you are trying to read binary data.
>
> my friend said to me that the data should be the hexadecimal, and I need
> convert them to string "YY" and decimal integers first. b
On Wed, Mar 16, 2016 at 08:36:59AM +, Matt Williams wrote:
> Dear Tutors,
>
> I am looking for some advice. I have some data that has three dimensions to
> it. I would like to store it such that one could manipulate (query/ update/
> etc.) by dimension - so it would be feasible to ask for all
On 18/03/16 15:31, Peter Otten wrote:
> I suppose he thinks that hexadecimal and binary is the same. The data you
> showed is binary. For example the following sequence of bytes
>
> 9 1 120 1 253 2
>
> is displayed as the bytestring
>
> b'\t\x01x\x01\xfd'
What happened to the 2 at the end?
Sh
Yeh Z wrote:
[Please don't top-post. Thank you]
>Thanks for your help,
>
>It's my bad, I should put them to a list, not a array?
>such as:
>YY, 100, 140, 200, 110, 160?
I supposed that you are trying to read binary data.
>Firstly, I'm confused about how to convert them to
On 17/03/16 17:48, sina sareth via Tutor wrote:
Please start a new thread for a new subject and please
change the subject line it makes searching the archives
much easier.
> Hi thereI would like to make 2 apps I wonder if somebody has a similar codes.
>
We would need a bit more background inf
Thanks for your help,
It's my bad, I should put them to a list, not a array?
such as:
YY, 100, 140, 200, 110, 160?
Firstly, I'm confused about how to convert them to string and integers?
the raw bytes? Is it different to the bytes packing by "pack"? I want to
read them by a h
On 17/03/16 11:32, CMG Thrissur wrote:
>>> But Winpython portable version works like a charm on windows.
>>
> I think linux is much better and i will stick to it, but at work i have
> to work on win 10 and that to i sometimes have to make python utilities
> for others to work on which requires a
On 19/03/16 13:03, Steven D'Aprano wrote:
> But all joking aside, Python's pseudo-random number generator is one of
> the best in the world, the Mersenne Twister. For non-cryptographical
> purposes, it is as random as anything you are likely to need.
>
> https://en.wikipedia.org/wiki/Mersenne_T
On Sat, Mar 19, 2016 at 04:05:58PM +1100, Ben Finney wrote:
> import random
>
> def roll_die(num_sides, rng=None):
> """ Return a result from a random die of `num_sides` sides.
>
> :param num_sides: The number of sides on the die.
> :param rng: An instance
On Fri, Mar 18, 2016 at 11:26:13PM -0500, boB Stepp wrote:
> If I had a function to roll a die, such as:
>
> import random
>
> def roll_die(num_sides):
> return random.randint(1, num_sides)
>
> How would I write unit tests for this?
(1) One way would be to monkey-patch the random module wi
Thanks for your help,
Sorry for top-post and MUC. It is MCU - Micro Controller Unit.
> I supposed that you are trying to read binary data.
my friend said to me that the data should be the hexadecimal, and I need
convert them to string "YY" and decimal integers first. but why the data which
I
On 19/03/16 04:26, boB Stepp wrote:
> If I had a function to roll a die, such as:
>
> How would I write unit tests for this?
Ben has given the general case answer.
> And I do not see how I can test for an appropriate "randomness" to the
> numbers the function generates without to a lot of iter
On Thursday 17 March 2016 12:40 AM, eryk sun wrote:
On Wed, Mar 16, 2016 at 12:56 PM, Alan Gauld wrote:
On 16/03/16 12:46, CMG Thrissur wrote:
I tried to install activestate on win 10 but due to my ignorance or
lack of knowlege i could n't get to install pyqt or sip. i tried it
through pip
I would visit http://www.python.org/ and hover over the "Downloads"
text, then choose the desired package.
If you want a 64-bit kit, go to
https://www.python.org/downloads/release/python-351/ and choose
"Windows x86-64 executable installer".
On Tue, Mar 15, 2016 at 3:31 PM, Ken G. wrote:
> Havin
On 16/03/16 12:46, CMG Thrissur wrote:
> > Personally I always install ActiveState Python on
> > Windows
> I tried to install activestate on win 10 but due to my ignorance or
> lack of knowlege i could n't get to install pyqt or sip. i tried it
> through pip.
Active state only installs standar
On Mar 16, 2016 5:59 AM, "Matt Williams"
wrote:
>
> Dear Tutors,
>
> I am looking for some advice. I have some data that has three dimensions
to
> it. I would like to store it such that one could manipulate (query/
update/
> etc.) by dimension - so it would be feasible to ask for all of the data
>
On Wednesday 16 March 2016 11:26 PM, Alan Gauld wrote:
On 16/03/16 12:46, CMG Thrissur wrote:
Personally I always install ActiveState Python on
Windows
I tried to install activestate on win 10 but due to my ignorance or
lack of knowlege i could n't get to install pyqt or sip. i tried it
thro
19 matches
Mail list logo