Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5266

Python • Re: Wait for app to open with Python

$
0
0
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
A nice trick for handling multi-platform is to effectively alias commands so you have a kind of Hardware Abstraction Layer -

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



Viewing all articles
Browse latest Browse all 5266

Trending Articles