Python Forum
Call a bash script from within a Python programme
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call a bash script from within a Python programme
#3
If you already have a script for this you can do
import subprocess as sp
sp.run(['lp_XL.sh', 'foo.xls'])
If you have libreoffice installed, it can also be done by calling the 'soffice' command with appropriate arguments.
Pedroski55 likes this post
Reply


Messages In This Thread
RE: Call a bash script from within a Python programme - by Gribouillis - Dec-04-2021, 08:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why am I getting this error from Dave Beazly's programme? Pedroski55 4 518 Apr-26-2024, 12:31 PM
Last Post: Pedroski55
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 785 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Is possible to run the python command to call python script on linux? cuten222 6 980 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,829 Jun-29-2023, 11:57 AM
Last Post: gologica
  math formula does not give the same result as bash script [SOLVED] AlphaInc 3 1,093 Apr-02-2023, 07:21 PM
Last Post: AlphaInc
  Showing and saving the output of a python file run through bash Rim 3 2,702 Oct-06-2021, 10:48 AM
Last Post: gerpark
  Automatic user/password entry on prompt by bash script PBOX_XS4_2001 3 2,954 May-18-2021, 06:42 PM
Last Post: Skaperen
  Programme will not returns the day number not the day name Oldman45 8 3,275 Jul-27-2020, 11:29 AM
Last Post: Oldman45
  How to kill a bash script running as root from a python script? jc_lafleur 4 6,225 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,434 May-28-2020, 05:27 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020