Python Forum
using a shell script within python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using a shell script within python
#1
I want to use a C-shell script within a python program, which works with two arguments.

os.system("recall 20170121 ../E725.txt xy 1")

But I want to use it for a stack, so declared the variables like below, but when I call them within the script it gives an error, that the input file doesn' exist. How can I call the variables?

date_ID=(filename[17:25])
fullpath = '../%s' % (filename)
os.system("import_S1_TOPS_modified $date_ID $fullpath vv 1")
Reply


Messages In This Thread
using a shell script within python - by Krszt - Oct-10-2018, 09:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help creating shell scrip for python file marciokoko 10 1,380 Sep-16-2023, 09:46 PM
Last Post: snippsat
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,276 Jun-29-2023, 11:57 AM
Last Post: gologica
  Launch Python IDLE Shell from terminal Pavel_47 5 1,257 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  batch file for running python scipt in Windows shell MaartenRo 2 1,901 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  cant use ping, sudo or other commands in remote shell script. throwaway34 7 3,617 May-17-2021, 11:29 AM
Last Post: throwaway34
  How to make a Python program run in a dos shell (cmd) Pedroski55 2 2,333 Nov-09-2020, 10:17 AM
Last Post: DeaD_EyE
Bug Python Shell 3.9.0 - Issue with indentation Earis 17 6,661 Oct-31-2020, 07:00 AM
Last Post: Earis
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,935 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,313 May-28-2020, 05:27 PM
Last Post: micseydel
  Python "Terminal" vs "Shell" SectionProperties 2 2,677 Apr-10-2020, 08:36 AM
Last Post: SectionProperties

Forum Jump:

User Panel Messages

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