Re: [Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Alan Gauld via Tutor
On 05/09/18 18:12, Chip Wachob wrote: > In your examples name1 and name2 could be anything that is contained > in that module.. a variable, function, class, etc.. correct? Correct. They are just names. Again a difference between Python and C. In C a name is a label associated with a memory

Re: [Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Chip Wachob
This helps tremendously! One last question. In your examples name1 and name2 could be anything that is contained in that module.. a variable, function, class, etc.. correct? On Wed, Sep 5, 2018 at 12:58 PM, Alan Gauld via Tutor wrote: > On 05/09/18 15:06, Chip Wachob wrote: > >> Okay, I

Re: [Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Alan Gauld via Tutor
On 05/09/18 15:06, Chip Wachob wrote: > Okay, I think I'm starting to get a handle on the visibility of > things. As you said, much different than C. Yes. The significant thing is to remember that in Python you are importing names. In C you include the contents of the file. #include Lets you

Re: [Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Chip Wachob
Thank you! Okay, I think I'm starting to get a handle on the visibility of things. As you said, much different than C. Just to confirm that I'm understanding correctly: Even through the import Adafruit_GPIO as GPIO line exists in the AdafruitInit.py file, which is imported by the import

Re: [Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Alan Gauld via Tutor
On 05/09/18 14:05, Chip Wachob wrote: > # module AdafruitInit.py > # from the Adafruit tutorials.. > import Adafruit_GPIO.FT232H as FT232H > import Adafruit_GPIO as GPIO > > FT232H.use_FT232H() > > ft232h = FT232H.FT232H() > > # config settings for the SPI 'machine' > spi = FT232.SPI(ft232h, 4,

Re: [Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Chip Wachob
Alan, Once again, thank you for the feedback and comments. Revised code snips: Sorry they were not complete. Several typos while trying to create the SSCCE version. # module AdafruitInit.py # from the Adafruit tutorials.. import Adafruit_GPIO.FT232H as FT232H import Adafruit_GPIO as GPIO

Re: [Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Alan Gauld via Tutor
On 05/09/18 04:12, Chip Wachob wrote: > # module RSI.py > def write(byte): >spi.write(byte) You don't have any import statements here. You need to import spi to use it. > # toggle the latch signal >ft232h.output(5, GPIO.LOW) >ft232h.output(5, GPIO.HIGH) And the same for ft232h >