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
  Advice needed on how to approach this problem... sawtooth500 1 337 Apr-06-2024, 01:55 PM
Last Post: snippsat
  Open a dos shell for ssh command martinmistere 6 1,848 Jun-07-2022, 12:24 PM
Last Post: martinmistere
  batch file for running python scipt in Windows shell MaartenRo 2 2,005 Jan-21-2022, 02:36 PM
Last Post: MaartenRo
  Need feedback on my approach for python dashboard for Asana pashtett 0 1,367 Nov-24-2020, 11:51 AM
Last Post: pashtett
  Running Python in Command Prompt Anwar 3 3,187 Nov-15-2020, 03:15 PM
Last Post: snippsat
  Error when running mktorrent subprocess command pythonnewbie138 4 3,979 Sep-16-2020, 01:55 AM
Last Post: pythonnewbie138
  Error: How to to close and restart your shell after running 'conda init' angelica 3 10,361 May-27-2020, 10:00 AM
Last Post: snippsat
  Approach to creating Audit table pynewbie 4 3,963 Feb-24-2020, 06:12 PM
Last Post: pynewbie
  Running linux command line apps... dbrdh 0 1,700 Jan-30-2020, 01:14 PM
Last Post: dbrdh
  list approach due nested order 3Pinter 6 2,931 Oct-07-2019, 01:49 PM
Last Post: 3Pinter

Forum Jump:

User Panel Messages

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