Python Forum
Importing - - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Importing - (/thread-19419.html)



Importing - - sumncguy - Jun-27-2019

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



RE: Importing - - ichabod801 - Jun-27-2019

It's not importing box from sshConnector, it's importing sshConnector from box.


RE: Importing - - snippsat - Jun-27-2019

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