Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8409791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:00:41+00:00 2026-06-10T00:00:41+00:00

friends, I have a simple script import subprocess subprocess.call([./run_xf]) old=open(‘./inv.mt0′,’r’) lines=old.readlines() lines=lines[3:] new=open(‘./inv.mt1′,’w’) new.writelines(lines)

  • 0

friends,

I have a simple script

import subprocess

subprocess.call(["./run_xf"])

old=open('./inv.mt0','r')

lines=old.readlines()

lines=lines[3:]

new=open('./inv.mt1','w')

new.writelines(lines)

old.close()

new.close()

subprocess.call(["rm", "inv.mt0"], shell=True)

All the codes work except the last one.

run_xf runs hspice and generate inv.mt0. then i copy part of inv.mt0 to inv.mt1. then i want to delete inv.mt0. But this doesn’t work.

For this specific example, it complains rm can’t find operand. But if i write them together, it doesn’t delete the file as well.

thanks

xf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:00:43+00:00Added an answer on June 10, 2026 at 12:00 am

    If you are using shell=True you must pass a string to subprocess.call, not a list. See http://docs.python.org/library/subprocess.html#subprocess.call for more details.

    However, invoking subprocess with shell=True is not recommended due to security implications. You should remove shell=True and leave the list-style args.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

friends, i have a EditText on simple activity with a button. when every i
friends, I have a piece of code which can perform simple add, subtraction, multiplication,
I have created a very simple app to invite friends. This is my code:
So I have made a simple site for a friend using codeigniter and grocery
I have three classes, I am simply display my Facebook friends in tableView. And
Hello friends I have tried many times but I am not successful than please
I have a friends table with columns user1 and user2 and a users table
I have the following friends = [{ name: Jack, attr1:def, attr2:def }, { name:
I have a working WAMP environment (Apache Friends). I decided to try Subversion and
I have a table called 'friends', this contains the columns person1 and person2 .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.