Path: csiph.com!aioe.org!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Arndt Newsgroups: de.comp.lang.python Subject: Re: [Python-de] Warten auf user-input, aber nicht zu lange Date: Tue, 26 Apr 2016 16:13:44 +0200 Lines: 71 Message-ID: References: <571F3E6B.4090402@fam-goebel.de> <571F7798.4060306@chrisarndt.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ePenvI5fwuxEOVS1nuNot9ALMX3lBiodp" X-Trace: news.uni-berlin.de azwN/Islo8EBR38cBtjshQExQzBQ+mKsFP7X3ruBvMBA== Return-Path: X-Original-To: python-de@python.org Delivered-To: python-de@mail.python.org X-Virus-Scanned: Debian amavisd-new at mx1.0x20.eu Openpgp: id=F0BA1EAE86651989C0A1C9901E0D97B33A4E1F31 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 In-Reply-To: <571F3E6B.4090402@fam-goebel.de> X-BeenThere: python-de@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Die Deutsche Python Mailingliste List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <571F7798.4060306@chrisarndt.de> X-Mailman-Original-References: <571F3E6B.4090402@fam-goebel.de> Xref: csiph.com de.comp.lang.python:4435 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ePenvI5fwuxEOVS1nuNot9ALMX3lBiodp Content-Type: multipart/mixed; boundary="Gas5pE6CX7Iu87o3P7GLme7FBpDv2qrL7" From: Christopher Arndt To: python-de@python.org Message-ID: <571F7798.4060306@chrisarndt.de> Subject: Re: [Python-de] Warten auf user-input, aber nicht zu lange References: <571F3E6B.4090402@fam-goebel.de> In-Reply-To: <571F3E6B.4090402@fam-goebel.de> --Gas5pE6CX7Iu87o3P7GLme7FBpDv2qrL7 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Am 26.04.2016 um 12:09 schrieb Ulrich Goebel: > Wie schreibt man eine solche Funktion ENTER_gedrueckt()? Dazu musst du die Konsoleneingabe abfragen, ohne zu blocken. Dazu gibt es in Python keine eingebaute Funktion. Normalerweise benutzt man f=FCr s= o etwas ein GUI (Tkinter, PyGTK, PyQt, pygame, etc.) oder Konsolen-Framework (curses), das die plattformabh=E4ngigen Methoden daf=FC= r kapselt. Ansonsten und wenn nur POSIX-Systeme unterst=FCtzt werden m=FCssen, hilft= dir diese Funktion: https://gist.github.com/SpotlightKid/816e12fc9dd7003f5c6b41ce0a633de2 (Die Zeitsteuerung =FCberlasse ich dir zur =DCbung ;)) Unter Windows gibt es die Funktionen 'kbhit' und 'getch' im msvcrt-Modul, mit denen man sich eine =E4hnliche L=F6sung basteln kann: https://docs.python.org/3/library/msvcrt.html Chris --Gas5pE6CX7Iu87o3P7GLme7FBpDv2qrL7-- --ePenvI5fwuxEOVS1nuNot9ALMX3lBiodp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Puzzled by the all these strange characters? Comment: See http://tinyurl.com/cehoa7 for an introduction Comment: to public key encryption and signing. iQIcBAEBCAAGBQJXH3ebAAoJEB4Nl7M6Th8xC90P/RfIJhorCkMGtHCeLij3PzuL FLtoefI9LsYfTbCkQeSe7LN5J0rrV9zrhrul3MYrvSEMdHpe+11FcgH+oFiQLbn4 Zz7+mvHqZ+vqIWAYeoMe/IVQcKX0Y7IUer5rf5rHTFJ+KJH1MeogqNioKz7r3O5m Zz/l6IPx21jwnjvdxtarpoX+9638/Elxs+MMp2L7+85H22IWyE6uTL6R8Z62fb3O KPdvGTOaUYAZ9XypAWUwj+ITtYgSA1eUpVlDO40MWrsAtJIlT04oS6w6iKrKy809 REGzW++GJiqqL1NJJgpMwT2JkTusQm4cb+cafeBGgWTfPV4pvI8s5LttKZzN4std kwkNwhv1P30wxokQXnWNeg+mh/HufH6PcNAVXnjIZl5Pa6MA+0QTDftnpMowOEe6 q+NIJk7UuyejhFtI8N9G2oNjRBufsPp7mi7Bcu+IBSfe544j+kmwrAIy6jA4TIrB 8e82lgEXG78v/sC7YYi4tuoVj2mlZKD6wXvdgfAlitb2jf3ydFKn3mDI9E1x9qW4 MyMaWXaLLWHyFgvJykvJbQhTDo1X7T6jMvo7OMShym0et8PZ0dT17ZEYyWMC0JYy 9jhsLO/60x5hnkarSBaRNW2Q9bUZGASUMMu/ZiDReKxbhakUSZrUxTj/zPVCFU38 VIT7sX6nuYJmdoNdgfLD =e8M/ -----END PGP SIGNATURE----- --ePenvI5fwuxEOVS1nuNot9ALMX3lBiodp--