Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #286: Telecommunications is downgrading.


comp / comp.lang.python / subprocess.Popen does not launch audacity

SubjectAuthor
* subprocess.Popen does not launch audacityTim Johnson
`- Re: subprocess.Popen does not launch audacityGilmeh Serda

1
Subject: subprocess.Popen does not launch audacity
From: Tim Johnson
Newsgroups: comp.lang.python
Date: Fri, 10 Jan 2025 19:15 UTC
References: 1
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: thjmmj15@gmail.com (Tim Johnson)
Newsgroups: comp.lang.python
Subject: subprocess.Popen does not launch audacity
Date: Fri, 10 Jan 2025 10:15:50 -0900
Lines: 34
Message-ID: <mailman.56.1736536555.2912.python-list@python.org>
References: <735b7965-c16c-45a7-a2b8-d9ff1adc21ba@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de jgFWrNB8XiT9cI75oqTonQMI1V/8/yUO2fD6eS2BmBfg==
Cancel-Lock: sha1:qVqtK8xoVuqdHORG6YNVzYDGaSk= sha256:iHqv2B/Zpgonon3l2nuiSxG2TFUrhI41NQq+bH7Be5Q=
Return-Path: <thjmmj15@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=c8osY6o/;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.04;
'skip:\xc2 30': 0.07; 'python3.': 0.09; 'subject:not': 0.09;
'ubuntu': 0.09; 'unsure': 0.09; 'approach,': 0.16; 'insufficient':
0.16; 'legacy': 0.16; 'menus': 0.16; 'pertinent': 0.16; 'received
:mail-pl1-x62b.google.com': 0.16; 'script.': 0.16; 'subject:does':
0.16; 'python': 0.16; 'applications': 0.17; 'message-
id:@gmail.com': 0.18; 'uses': 0.19; 'to:addr:python-list': 0.20;
"i've": 0.22; 'problem,': 0.22; 'programming': 0.25; 'tim': 0.26;
'header:User-Agent:1': 0.30; 'guess': 0.32; 'but': 0.32;
'received:192.168.1': 0.32; 'there': 0.33; 'script': 0.33;
'received:google.com': 0.34; 'able': 0.34; 'from:addr:gmail.com':
0.34; 'using': 0.37; 'received:192.168': 0.37; 'list': 0.39;
'thanks': 0.39; 'still': 0.40; 'ten': 0.61; 'skip:\xc2 10': 0.62;
'great': 0.62; 'outside': 0.67; 'below': 0.69; 'causing': 0.75;
'8bit%:100': 0.76; 'converted': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1736536551; x=1737141351; darn=python.org;
h=content-transfer-encoding:subject:from:to:content-language
:user-agent:mime-version:date:message-id:from:to:cc:subject:date
:message-id:reply-to;
bh=kfHeLewzw3Qxx2r39uECqqV07SgmeF1SJ3lzRKmIP+c=;
b=c8osY6o/X830fuKlKCg8NLFU+bPuOmQ54m4nqrk5cmLSTISZFbvr4rQBASxhBifxvG
IC0tzBODeKxfpP1eDalHc4LD6x/aZVZTwmgdj4tHCG/jnCClrTWTxIEsR1L+G+YJeTnS
EksGP6Iq070CDxNz32LMpzMrwOgMk0Ggvb75N8NC+CD4Kcjx1e2qv3gDRVXZ4vxb1/Xm
dwJgsJWW2GB6dkfmbH3o6ajaB92AenXhgKkdZ338s6bKFot5TA5yAB/O4d0KZWr2hyIL
z1KEIEUKllZ70hoBX/+hBTrH0CrXc2U8oQA16bPzxaTgMsWhCHg89GcLKWAeqzncIuNq
xAPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1736536551; x=1737141351;
h=content-transfer-encoding:subject:from:to:content-language
:user-agent:mime-version:date:message-id:x-gm-message-state:from:to
:cc:subject:date:message-id:reply-to;
bh=kfHeLewzw3Qxx2r39uECqqV07SgmeF1SJ3lzRKmIP+c=;
b=BiluGc/kb/mBhFL87cJOz1+beWwoTEEvEGUZ0yyckbXHBaeEd31yj9s7NmpNHugu6a
MzFrSQF154LSvwlZIIhqYTIJPK6ECBaW0iaFE2BowbpEg8+Mn8iqbbfZ5IhJCJTUpllI
UvEfsY05+B5wry1mJb2E7qKeQiAgmphxz2lpWimpItFsz/zHOpFD2wCdLfAeKEbEjyf4
wbG+ZQqvUEC8POgUPD6a4tZB9MPQvh2QSDg5FuiSzcjjQ9IClTeCqqHp0y1emjhY3PGK
oSMCSSuWcsZAy4rnqpykWA9/7oXYFQ/c5/XlNzgu0ChN9Wd/qDwJHqhpq2w3GMO5pyBB
8XNQ==
X-Gm-Message-State: AOJu0Yy+jsU1xQZswFkhg5CGx9tYpxv7K0Fc8x63rdLpkghgfp3qJ5in
NF2WHOZ7tZHBEsrjl+YRpYDxDNNznDXrs5bZ/whyyLlPhY0S4DFs9Lhyeg==
X-Gm-Gg: ASbGncu2Y6ntfmGyYgdiyPc8O+TPbpJtYzYCU4Lx5jwWcRrc61oa+UGHZUD+3XqECq+
/HNZQpOZFUfJdRdeZGwysuLspA/w94KN9H+s+NVl2t5weqrvHCL9i1sL+lXPCY+J2K6MRqo8T0I
Ghe3fm559K34XXyuUfv3gEYL7QYRSCmiwn8qz+CYYAbDqvRo1922X0FyBQUYMq4h+h6lGxUwxjZ
4NHaoHJJxOgAmAyj8tTixps/Bd5j1B2qDukbuGpIVMraGoBNS6EZM/S3iO4YcdIVHe/1ybtR/he
X-Google-Smtp-Source: AGHT+IE7uOKZX0lV51nnfs/6ySLvdsPOzXqhzXnGBuQgdot2LjbkFkTdYmQPjAezf7364GbpnRLi5g==
X-Received: by 2002:a05:6a21:3291:b0:1e8:bd15:6845 with SMTP id
adf61e73a8af0-1e8bd156ecfmr2920979637.1.1736536551256;
Fri, 10 Jan 2025 11:15:51 -0800 (PST)
User-Agent: Mozilla Thunderbird
Content-Language: en-US
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <735b7965-c16c-45a7-a2b8-d9ff1adc21ba@gmail.com>
View all headers

Using Python 3.12.3 on Ubuntu 24.04

I've converted a legacy python2 script to python3. All went well.
However, a glitch from python2 remains.

The script uses dmenu to create menus to pick applications. Applications
are then invoked from python

using subprocess.Popen(). I have never been able to successfully launch
audacity using this approach,

which does work for other apps.

I can launch audacity successfully using dmenu_run (on its own, outside
of the script)

Below is the pertinent code:

 Popen(choice, stdout=PIPE, stderr=PIPE,
                  stdin=PIPE, close_fds=True)

My guess is my argument list is either insufficient or an argument is
causing the problem, but am unsure of which.

I have been retired from python programming for ten years, and am pretty
rusty, but it is still fun. There are plenty

of other ways to successfully launch audacity but it would be great to
make it work from this script.

Thanks in advance

Tim

Subject: Re: subprocess.Popen does not launch audacity
From: Gilmeh Serda
Newsgroups: comp.lang.python
Organization: Easynews - www.easynews.com
Date: Fri, 10 Jan 2025 21:46 UTC
References: 1 2
Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx07.ams4.POSTED!not-for-mail
From: gilmeh.serda@nothing.here.invalid (Gilmeh Serda)
Subject: Re: subprocess.Popen does not launch audacity
Newsgroups: comp.lang.python
References: <735b7965-c16c-45a7-a2b8-d9ff1adc21ba@gmail.com>
<mailman.56.1736536555.2912.python-list@python.org>
MIME-Version: 1.0
x-no-archive: yes
User-Agent: Pan/0.161 (Chasiv Yar; 7e6f2f6)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Lines: 32
Message-ID: <hzggP.7$qLY1.5@fx07.ams4>
X-Complaints-To: abuse@easynews.com
Organization: Easynews - www.easynews.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Fri, 10 Jan 2025 21:46:53 GMT
X-Received-Bytes: 1842
View all headers

On Fri, 10 Jan 2025 10:15:50 -0900, Tim Johnson wrote:

> using subprocess.Popen(). I have never been able to successfully launch
> audacity using this approach,

Some thoughts you might try:

What does your .desktop file say (launcher menu)? Assuming you have it
installed that way. Or is it a flatpak or something?

Read the .desktop file so you use the exact same command. It might not be
what you expected. It might need some option or it's a different command
from what you thought.

Or, try the command you used, but at the prompt, does that work? Get any
errors?

Or try something simpler, like without PIPEs, sort of back to basics, as
it were.

What's in "choice" variable? Only the (correct) command, or something else
also? Test it to be sure, it's easy to add things that shouldn't be there
in a moment of a brain fatigue.

Does it work outside your script file? For instance by invoking the Python
prompt and try there?

--
Gilmeh

They are relatively good but absolutely terrible. -- Alan Kay, commenting
on Apollos

1

rocksolid light 0.9.8
clearnet tor