Closed wangchung12321 closed 7 years ago
Hey Wang, thanks for the kind words! So nice of you to join Github just for PyEdsby:)
Importing the Edsby class can actually done in a number of ways, so you have some options:
For Python 2.7, you'll first need to create an empty file named __init__.py
in the same directory as edsby.py and your code. Once you've done that, you can import PyEdsby like so:
from edsby import Edsby
You can also place the class file in a subdirectory. Say, for example, you keep all your imports in a subdirectory named lib/
:
from lib.edsby import Edsby
In Python 3 (which PyEdsby should be able to run under), you can disregard the above. Importing the class is a simple matter of:
from .edsby import Edsby
The final option you have available is to simply paste the class definition inside of your python file. It's much messier, but it would work if you needed it for your specific use case.
Finally, you'll need to install the python requests module before you do anything else. This is easy to do with pip
:
For Python 2.7: pip install requests
For Python 3: pip3 install requests
If your $PYTHONPATH isn't working for whatever reason, you can have pip install to the current directory by appending --target=./
to the commands above.
Let me know if that works for you! If not, I'll be around.
Peace!
I'm guessing this got you started off, so I'll close this issue. Let me know if you run into any other bumps, and I'll reopen:)
Hi, this is such a great project you have!
Sorry to bother you with my NOOB-ness, but I can't seem to get this running on Python 2.7. Do I compile and run the "edsby.py" code or the example code? Do I need to import the Edsby class to somewhere?
Thanks so much!