Jump to content

Python help


Recommended Posts

17 hours ago, maniccyberdog said:

I’m not calling bash commands from python.  I can type LED SETUP at a command prompt and this works as expected.  If I add the same command to a .py file it doesn’t work.  Do I need to import a library to python first?

LED and BUTTON are bash functions, so they won't work in Python.

You can probably use a Python library to call bash functions, though. E.g. https://stackoverflow.com/questions/4256107/running-bash-commands-in-python

Link to comment
Share on other sites

2 hours ago, maniccyberdog said:

Thanks, that was my thoughts, different to what the docs say! 

‘These commands simplify interfacing with the hardware and may be called from payloads written in bash, python and PHP, or directly from the console via SSH.’

That is a bit unclear, sorry about the confusion.

I think it's talking about the fact that payloads can be written in different languages, not just bash. Sorry about the confusion, maybe @Sebkinne can add this to his ever-growing LOT (list of things)?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...