Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import as module #98

Open
dmhuisma opened this issue Aug 23, 2020 · 2 comments
Open

import as module #98

dmhuisma opened this issue Aug 23, 2020 · 2 comments

Comments

@dmhuisma
Copy link

Can this be imported as a module instead of executing using cli? I am trying to bundle my application using pyinstaller, with it invoking the command "python3 cc2538-bsl.py -p /dev/ttyUSB0 -e -w -v firmware.hex" using subprocess.run. It seems to try to use my pc's python environment instead of the bundled runtime (it could be argued that this should be handled by pyinstaller, but I am looking into this on both fronts). This would not be an issue if I could import it and use it as a module. The reason this is an issue is because it defeats the purpose of pyinstaller, the user now must have a python runtime installed.

@dmhuisma
Copy link
Author

I have found a workaround.

I used pyinstaller to create an executable out of cc2538-bsl. Now I don't have to worry about the python environment when I execute it.

I will leave this issue open because I think it is still a good idea to be able to import this as a module, so that it can be easily used within other python projects, especially when it must be bundled and deployed like in my case.

@JelmerT
Copy link
Owner

JelmerT commented Aug 23, 2020

This is indeed definitely a feature we want, will need to look into it how much work and changes it would be.
PRs on this more than welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants