First page Back Continue Last page Overview Image

Allgemeine Lösung

import os, platform

def getch():

if platform.system() == "Linux":

os.system("bash -c \"read -n 1\"")

elif platform.system() == "Windows":

import msvcrt

msvcrt.getch()

print("Taste druecken!")

getch()

print("Okay")

Andere Testmethode:

import os

if os.name == "nt":

command = "dir"

else:

command = "ls -l"

os.system(command)