From: Eliot Moss <moss@cs.umass.edu>
To: "René Berber" <rene.berber@gmail.com>,
"cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: Re: Running cygwin from python
Date: Wed, 31 Aug 2022 16:43:48 -0400 [thread overview]
Message-ID: <d8ca5150-4ae7-3b1f-db40-e0f325e54338@cs.umass.edu> (raw)
In-Reply-To: <7bf1b8fe-a43c-0747-0c18-2ac968f8245a@gmail.com>
On 8/31/2022 4:40 PM, René Berber wrote:
> 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.
... except if the OP is talking ab *Windows* python, in which case the
os package will run Windows things, not cygwin ones ...
Best - Eliot
prev parent reply other threads:[~2022-08-31 20:43 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
2022-08-31 20:40 ` René Berber
2022-08-31 20:43 ` Eliot Moss [this message]
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=d8ca5150-4ae7-3b1f-db40-e0f325e54338@cs.umass.edu \
--to=moss@cs.umass.edu \
--cc=cygwin@cygwin.com \
--cc=rene.berber@gmail.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).