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

  • Home
  • SEARCH
  • 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 8130085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:35:01+00:00 2026-06-06T08:35:01+00:00

I understand my question is not that clear so let me try explaining it

  • 0

I understand my question is not that clear so let me try explaining it here.

What I am trying to do is suspend my computer after completing a certain task.

My script:

#my logic or task(Downloading a file)#
cmd = shlex.split("sudo pm-suspend")
>>> subprocess.call(cmd)
[sudo] password for noob: 

As you can see it asks for my password but the problem is I will not be sitting on my system while the script is getting executed.

So, my question is how to handle this problem or what other alternative way exist to tackle this problem.

Python version is 2.7.3.

  • 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-06T08:35:02+00:00Added an answer on June 6, 2026 at 8:35 am

    Assuming your pm-suspend is at /usr/sbin/pm-suspend

    Make your sudoers entry in /etc/sudoers:

    <username> ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a really short question I think but I'm not sure I understand
My question, is not a philosophical one, but one of methodology. I understand how
You guys probably don't understand my question, I'll try to explain further. I have
I understand that this question may be subjective, this is why I need an
I understand that this question could be answered with a simple sentence and that
I understand what const correctness means and my question is not about what const
In all the languages that I understand this is not possible but someone was
I hope the question is not too unspecific. At the moment, I am trying
First I want to make it clear that this is a homework based question.
it's my first question here and I hope that I'm doing it right. I

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.