From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) by sourceware.org (Postfix) with ESMTPS id A810E3851ABB for ; Wed, 31 Aug 2022 20:40:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A810E3851ABB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-xc36.google.com with SMTP id z23-20020a4ad1b7000000b0044931ffdcafso2707195oor.4 for ; Wed, 31 Aug 2022 13:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:newsgroups:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=gMqoTV0CIZZ07S8oI/l8o1MQ41rWmPNkhDF5nW37Ejw=; b=jprcTx1WmfGcOV0fTfAMtdo+DcZg4D/OsiTAqE7F9m21Rg0N7U5dBZvJ5IUog0kfDZ 5mFEMCE+mgT3iT2UW5GKwL6z8ImCUOJA3QDco1oGBflUtbI/ZW8+x/cim4hJOxjSwCYo jcx9KvRtTOoyIhpXKNfWs9xgpcIw8VAhdi8KGzAAGmOX38z4v14hh3lIjsYBktKUZipE oQePhtbfSYFIK3gYSCPL/+jxvP8pW4rvZLdUcacxkRv4TtQu+WeqfpsL1Fbt+4I16UXT 8egxRFVuAMJsxmZKflXHVLqY9Oi+GLXsCqsPviN1NU8WJuk2dTzPNdfoh/+LR0nujTio frsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:newsgroups:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=gMqoTV0CIZZ07S8oI/l8o1MQ41rWmPNkhDF5nW37Ejw=; b=ZlS7bxUbRONIaSPk9cfS5zm5i39l5H5ZqTE163cQ8kG1lYRbncCfuadCwqZHLc4Axj UkSvekuvTDsclwUPvfWMbF2wBM4sm4mHdho955nLI97BHb/HU6RYw5UcfNK0rs0XpFCQ JZ9IabW8t4Yc+qL0KZ4lLAoPHGJjoZrPZvXEYw/UN8b+FeVTitUNcDEl0pkkLVyiLm2a rvJE83R5oewuFbmRRl3OIOolkvMtcSTzcG+RIMCZjdljIMqAGH7aLw0pZpv01efm0p+n WIToOkPLJxjyP+uVBpHfFMI+v/c3PqTejqXJhu2h8g6Lt96Nzk3z8qbgrY48nkzVabJi KX2Q== X-Gm-Message-State: ACgBeo14hAycTr4j0dVzihSYrXOO158+zyPaeKgjM1JHcS0JaEs3/r8Z H8b+TI3pRR/1odQvVOPmRihuDgGwMNc= X-Google-Smtp-Source: AA6agR7hSvmCEsQ6ZPdVRacXPs0ox6ElE/XkR3E7L9RwJDwsZf9DsUcj33GOHH19/wwTPXeKNoJmOQ== X-Received: by 2002:a05:6820:1348:b0:44e:1ddd:3968 with SMTP id b8-20020a056820134800b0044e1ddd3968mr1773004oow.80.1661978403344; Wed, 31 Aug 2022 13:40:03 -0700 (PDT) Received: from [192.168.10.5] ([189.216.168.69]) by smtp.gmail.com with ESMTPSA id h7-20020a4abb87000000b00435a8024bc1sm8479079oop.4.2022.08.31.13.40.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 13:40:02 -0700 (PDT) Message-ID: <7bf1b8fe-a43c-0747-0c18-2ac968f8245a@gmail.com> Date: Wed, 31 Aug 2022 15:40:02 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Lightning/0.9 Thunderbird/2.0.0.19 Mnenhy/0.7.6.0 Subject: Re: Running cygwin from python Content-Language: en-US To: "cygwin@cygwin.com" Newsgroups: gmane.os.cygwin References: <251df5f2-56b8-0812-c990-a517bd686ec5@cs.umass.edu> From: =?UTF-8?Q?Ren=c3=a9_Berber?= In-Reply-To: <251df5f2-56b8-0812-c990-a517bd686ec5@cs.umass.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_ABUSEAT,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/31/2022 1:39 PM, Eliot Moss wrote: > On 8/31/2022 1:41 PM, Toyoshima Denis wrote: >> Hi there, how are you? >> >> I’d like to know if there’s any possibility of running simple commands >> inside Cygwin through Python code. -----------------^^^^^^^^^^^^^^^^^^^^ >> If yes, could you provide some examples? > > This will happen automatically if you use Cygwin's python. > If you don't, then you have to run a program (for example, ls) > by giving the path to the executable - on my system that is: > > C:\cygwin64\bin\ls.exe [snip] I think he meant something like this: $ python Python 3.9.10 (main, Jan 20 2022, 21:37:52) [GCC 11.2.0] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.system("ls") ... output is a list of strings with the contents of current directory ^D Which is not a question for the Cygwin list, its elementary python. -- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id E12A53850431 for ; Wed, 31 Aug 2022 20:40:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E12A53850431 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oTUVP-00049y-FG for cygwin@cygwin.com; Wed, 31 Aug 2022 22:40:11 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin@cygwin.com From: =?UTF-8?Q?Ren=c3=a9_Berber?= Subject: Re: Running cygwin from python Date: Wed, 31 Aug 2022 15:40:02 -0500 Message-ID: <7bf1b8fe-a43c-0747-0c18-2ac968f8245a@gmail.com> References: <251df5f2-56b8-0812-c990-a517bd686ec5@cs.umass.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Lightning/0.9 Thunderbird/2.0.0.19 Mnenhy/0.7.6.0 Content-Language: en-US In-Reply-To: <251df5f2-56b8-0812-c990-a517bd686ec5@cs.umass.edu> X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Message-ID: <20220831204002.QJ3_WDF2XDNxBSP_NTc8XYU_nVs2Ij03aCpRAWBPZJ8@z> On 8/31/2022 1:39 PM, Eliot Moss wrote: > On 8/31/2022 1:41 PM, Toyoshima Denis wrote: >> Hi there, how are you? >> >> I’d like to know if there’s any possibility of running simple commands >> inside Cygwin through Python code. -----------------^^^^^^^^^^^^^^^^^^^^ >> If yes, could you provide some examples? > > This will happen automatically if you use Cygwin's python. > If you don't, then you have to run a program (for example, ls) > by giving the path to the executable - on my system that is: > > C:\cygwin64\bin\ls.exe [snip] I think he meant something like this: $ python Python 3.9.10 (main, Jan 20 2022, 21:37:52) [GCC 11.2.0] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.system("ls") ... output is a list of strings with the contents of current directory ^D Which is not a question for the Cygwin list, its elementary python. --