[Tutor] Beginner: Socket object and packets

2015-12-05 Thread Marc Eymard
Hi tutor, I am trying to locate the first blank line in the first received packet when pinging an internet server using a socket object. My assumption is there will be a mandatory blank line right after the http headers in accordance with the http protocol. Consider the following: import s

[Tutor] Beginner - explaining 'Flip a coin' bug

2014-02-12 Thread Marc Eymard
Hello there, I want to emulate a coin flip and count how many heads and tails when flipping it a hundred times. I first coded coinflip_WRONG.py with "count_flips += 1" statement within the if/else block. When running it, either returned values are wrong or the script seems to enter in an infin

Re: [Tutor] thanks - Beginner - explaining 'Flip a coin' bug

2014-02-15 Thread Marc Eymard
nction you've designed, should have more than two possibilities, within a complete algorithm to the real world functionality of the coin in question. On Wed, Feb 12, 2014 at 10:25 AM, Marc Eymard wrote: Hello there, I want to emulate a coin flip and count how many heads and

[Tutor] Beginner - understanding randint arguments

2014-02-15 Thread Marc Eymard
Hello Tutor, I need to generate a random integer between 0 and 100. The range is supposed to be adjusted by my two variables: low_range and high_range. The logic of using the variables as part of the function arguments is to manage to get a smaller range each time the function is called excludi

[Tutor] Beginner - Clarifying 'understanding randint arguments'

2014-02-17 Thread Marc Eymard
Hi Tutor, The previous elements I sent to the mailing list were incomplete and needs no answer from Tutor. To clarify and re-phrase my script issue: I want to code a game whereby the computer guesses either by luck or deduction a number I pick within [0, 100]. In attached machine_guess_number

[Tutor] Beginner - list not returning correct variable value

2014-03-13 Thread Marc Eymard
Hello Tutor, I am a self-taught Python script beginner and I do it from the Michael Dawson Book. In attached script, can somebody tell me why the values of the variables strenght_points, health_points, wisdom_points and dexterity_points stay at 0 value when 'printing' their value from the list

[Tutor] FW: Beginner - list not returning correct variable value

2014-03-19 Thread Marc Eymard
Hello Tutor, Could somebody help me with below query? Thanks Marc From: marc_eym...@hotmail.com To: tutor@python.org Subject: Beginner - list not returning correct variable value Date: Thu, 13 Mar 2014 16:12:28 + Hello Tutor, I am a self-taught Python script beginner and I do it from th

[Tutor] Thread Object integration with GPIO

2017-04-29 Thread Marc Eymard
Hello there, I have hooked up an ultrasonic sensor to my Raspberry Pi-enabled robot in order to get continuous distance-to-obstacle reading. The sensor is properly connected via GPIO and already reads the distance properly when running a simple script. However, I need to integrate the sensor r

[Tutor] Thread Object integration with GPIO

2017-04-30 Thread Marc Eymard
Hello there, I have hooked up an ultrasonic sensor to my Raspberry Pi-enabled robot in order to get continuous distance-to-obstacle reading. The sensor is properly connected via GPIO and already reads the distance properly when running a simple script. However, I need to integrate the sensor rea