Accessing custom EV3 name in code. #260
Answered
by
dlech
ChrisShepherd
asked this question in
Q&A
-
I'm building a project with several EV3s. I've given each of them a unique custom name. I want to download the same code to all of them, but I want each to pick and choose which code to use based on their name Is there a way to access this info on the brick? |
Beta Was this translation helpful? Give feedback.
Answered by
dlech
Feb 22, 2021
Replies: 1 comment 1 reply
-
Hi Chris, Try using this function this to get the hostname: def hostname():
with open('/etc/hostname') as f:
return f.read().strip() This assumes you used |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dlech
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Chris,
Try using this function this to get the hostname:
This assumes you used
sudo ev3dev-config
to give each EV3 a unique hostname.