A nice trick for handling multi-platform is to effectively alias commands so you have a kind of Hardware Abstraction Layer -Stick to one platform at a time first - get it working on the Pi first then introduce Windows.
Personally, I put the functions definitions outside of code where possible along the lines of:
Imports
Def code
Main code
Code:
def GetChar_Windows(): ... def GetChar_Linux(): ... if WINDOWS : GetChar = GetChar_Windowselse : GetChar = GetChar_Linuxwhile True: ch = GetChar() print("Got", ch)
Statistics: Posted by hippy — Fri Jul 12, 2024 9:23 am