From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How do I get a Python REPL in Eshell on M$ Windows? Date: Sun, 05 Jun 2022 08:14:51 +0300 Message-ID: <831qw3bsj8.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17425"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 05 07:15:48 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxic8-0004MP-Eb for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 05 Jun 2022 07:15:48 +0200 Original-Received: from localhost ([::1]:48224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxic6-0000xs-T1 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 05 Jun 2022 01:15:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxibS-0000xe-Cw for help-gnu-emacs@gnu.org; Sun, 05 Jun 2022 01:15:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxibS-0001SS-4a for help-gnu-emacs@gnu.org; Sun, 05 Jun 2022 01:15:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IDdea8U7DS00rJ38y3BS/4w4N32Qk4ZiyuHe1AZWAzk=; b=dOTwxuIEeWo0 CfegwxxGE/GACmmtez7yBunxohCLoZsrWX283CrLuYe5aUNjv35D1xNqWPXNuUtUFt6vTdO6a1s85 B3Z+hUMr6BFi0pEdSUV1me+CVqbvl9h/PhJQh75YJB+ipETGvRz1nCMtn1YXVmDGEvQeNwoecCshQ t/Pv/uLeK3WdP7ZclXaKHhdywmSp7OF19/BQL12FuiIyoWFdbPWxY1Jx+tc/Ss0UUFK+c8AmPgO3T GJB6p+qgS4MNiBq6YXL1qp3QnrokfBxk3PHWQf0U2y7OQfW8HWkew4hUz167JMGGIJ3QzJ6Dq8+8l 2yO8VBPrbpcv3+2ewgMCQg==; Original-Received: from [87.69.77.57] (port=3087 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxibR-0005VG-IX for help-gnu-emacs@gnu.org; Sun, 05 Jun 2022 01:15:05 -0400 In-Reply-To: (message from Eduardo Ochs on Sat, 4 Jun 2022 20:08:17 -0300) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137497 Archived-At: > From: Eduardo Ochs > Date: Sat, 4 Jun 2022 20:08:17 -0300 > > When my students try to run Python in a buffer created with M-x shell > or M-x eshell they don't get an interactive REPL - they get something > that _looks like_ a REPL that is stuck because of bad terminal > settings. In Lua we were able to fix that by running "lua52.exe -i" > instead of just "lua52.exe"... anyone knows how to do something > similar for Python? > > Here is what one student got in his *eshell* buffer: > > Welcome to the Emacs shell > > ~ $ ~/eev-wconfig/lua52.exe -i > Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio > > print(2+3) > 5 > > os.exit() > ~ $ > ~ $ py > print(2+3) > print(2+3) > > He sent me a photo of what he got when he ran "py" in a "normal" > terminal running PowerShell. It was something like this: > > Windows PowerShell > Copyright (C) Microsoft Corporation. Todos os direitos reservados. > > Experimente a nova plataforma cruzada PowerShell https://aka.ms/pscore6 > > PS C:\Users\ferob> py > Python 3.10.4 [etc etc etc] > >>> print(2+3) > 5 > >>> I believe the buffering of Python interpreter's stdout can also be controlled. Search the Internet for "how to make python standard output unbuffered", and you will find the answers.