Python Forum
Sound Approach for Running a Shell Command?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sound Approach for Running a Shell Command?
#7
This is my attempt at using the HEREDOC method:

import os

heredoc = """zulip-send --stream test --subject at_test --'message this is a test'END"""

os.system("at 8:55 <<END%s" % heredoc)
print "test"
The simpler version using the pwd command works fine, but with the above situation, 'at' yells at me about trying to use parameters that don't (for it) exist. Why would it be seeing --stream as a parameter for 'at' rather than as a parameter for 'zulip-send'?

import os

heredoc = """pwdEND"""

os.system("at 8:55 <<END%s" % heredoc)
print "test"
Reply


Messages In This Thread
RE: Sound Approach for Running a Shell Command? - by matt_the_hall - Dec-09-2020, 07:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run shell command, capture the output, then write it into textfile? tatahuft 4 1,164 Dec-20-2024, 02:13 PM
Last Post: Axel_Erfurt
  Running powershell command in flask wtf form robertkwild 10 2,771 Jun-27-2024, 09:49 AM
Last Post: robertkwild
  Advice needed on how to approach this problem... sawtooth500 1 1,523 Apr-06-2024, 01:55 PM
Last Post: snippsat
  Open a dos shell for ssh command martinmistere 6 3,240 Jun-07-2022, 12:24 PM
Last Post: martinmistere
  batch file for running python scipt in Windows shell MaartenRo 2 3,253 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  Need feedback on my approach for python dashboard for Asana pashtett 0 1,861 Nov-24-2020, 11:51 AM
Last Post: pashtett
  Running Python in Command Prompt Anwar 3 4,462 Nov-15-2020, 03:15 PM
Last Post: snippsat
  Error when running mktorrent subprocess command pythonnewbie138 4 5,617 Sep-16-2020, 01:55 AM
Last Post: pythonnewbie138
  Error: How to to close and restart your shell after running 'conda init' angelica 3 12,159 May-27-2020, 10:00 AM
Last Post: snippsat
  Approach to creating Audit table pynewbie 4 5,317 Feb-24-2020, 06:12 PM
Last Post: pynewbie

Forum Jump:

User Panel Messages

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