public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "René Berber" <rene.berber@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Running cygwin from python
Date: Wed, 31 Aug 2022 15:40:02 -0500	[thread overview]
Message-ID: <7bf1b8fe-a43c-0747-0c18-2ac968f8245a@gmail.com> (raw)
Message-ID: <20220831204002.QJ3_WDF2XDNxBSP_NTc8XYU_nVs2Ij03aCpRAWBPZJ8@z> (raw)
In-Reply-To: <251df5f2-56b8-0812-c990-a517bd686ec5@cs.umass.edu>

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.
-- 



  reply	other threads:[~2022-08-31 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31 17:41 Toyoshima Denis
2022-08-31 17:41 ` Toyoshima Denis
2022-08-31 18:39 ` Eliot Moss
2022-08-31 20:40   ` René Berber [this message]
2022-08-31 20:40     ` René Berber
2022-08-31 20:43     ` Eliot Moss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7bf1b8fe-a43c-0747-0c18-2ac968f8245a@gmail.com \
    --to=rene.berber@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).