Python Forum

Full Version: Importing -
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im not sure that I will be able to get this question answered. I am trying to pick apart a home group module they are using at work and I have run into a block. I understand I might not know enough yet...

but here goes ..

So in their program they include this import statement. In my eyes the smart thing to do is to hit the sshConnector module and take a look at the box method of the sshConnector module. .. I did ..

but when I search through the module, I dont see a box method defined anywhere.
Quote:import box.sshConnector as z
It's not importing box from sshConnector, it's importing sshConnector from box.
(Jun-27-2019, 05:52 PM)sumncguy Wrote: [ -> ]I dont see a box method defined anywhere.
Homemade Wink
λ ptpython
>>> import box.sshConnector as z

>>> z.connect()
'........... connected'
So looking for a box method i will not find it as it's a folder.
box\
  |-- __init__.py
  |-- sshConnector.py
# sshConnector.py
def connect():
    return '........... connected'