Python Forum
<SOLVED>os.system needs a string in quotes
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
<SOLVED>os.system needs a string in quotes
#12
This works perfectly!
cmd = [ "srm", "-rv", path ]
subprocess.call(cmd)
I can even delete folders and files with really weird names like
Quote:/home/fred/Git/this "is" a test of (srm)
or
Quote:/home/fred/Git/who (am) "I" 'going' to be?



Yahoo!
Thanks guys! :dance:
OS: Arch
Editor: Atom with Material Syntax UI and the Termination terminal plugin

Micah 6:8
Reply


Messages In This Thread
RE: os.system needs a string in quotes - by wavic - Oct-04-2016, 08:45 PM
RE: os.system needs a string in quotes - by Ofnuts - Oct-05-2016, 08:42 AM
RE: os.system needs a string in quotes - by Fred Barclay - Oct-06-2016, 05:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help on how to include single quotes on data of variable string hani_hms 5 2,409 Jan-10-2023, 11:26 AM
Last Post: codinglearner
  [SOLVED] [BeautifulSoup] Why does it turn inserted string's brackets into &lt;/&gt;? Winfried 0 1,666 Sep-03-2022, 11:21 PM
Last Post: Winfried
  [SOLVED] [BeautifulSoup] Turn select() into comma-separated string? Winfried 0 1,252 Aug-19-2022, 08:07 PM
Last Post: Winfried
  Adding string after every 3rd charater [SOLVED] AlphaInc 2 1,392 Jul-11-2022, 09:22 AM
Last Post: ibreeden
Question [SOLVED] Delete specific characters from string lines EnfantNicolas 4 2,411 Oct-21-2021, 11:28 AM
Last Post: EnfantNicolas
  Replace String in multiple text-files [SOLVED] AlphaInc 5 8,547 Aug-08-2021, 04:59 PM
Last Post: Axel_Erfurt
  Replace String with increasing numer [SOLVED] AlphaInc 13 5,472 Aug-07-2021, 08:16 AM
Last Post: perfringo
Thumbs Up Parsing a YAML file without changing the string content..?, Flask - solved. SpongeB0B 2 2,396 Aug-05-2021, 08:02 AM
Last Post: SpongeB0B
  reading lines from a string [Solved] ebolisa 14 6,797 Mar-28-2021, 08:16 PM
Last Post: perfringo
  Two types of single quotes Led_Zeppelin 2 2,033 Mar-15-2021, 07:55 PM
Last Post: BashBedlam

Forum Jump:

User Panel Messages

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