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 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
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

[Tutor] Fwd: Accessing variables from other modules

2018-09-05 Thread Chip Wachob
My apologies. I hit reply and not reply to all. Alan, I think I answered many of your questions in this message to Steven. -- Forwarded message -- From: Chip Wachob Date: Tue, Sep 4, 2018 at 1:48 PM Subject: Re: [Tutor] Accessing variables from other modules To: Steven

Re: [Tutor] Accessing variables from other modules

2018-09-05 Thread Chip Wachob
Alan, Thanks for your comments. I just forwarded a copy of a message to the list that I inadvertently sent as a reply only. So in that message there's information about the code. Thank you for confirming that once the interpreter is finished running my script that all the data is gone. The

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 >

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