Announcement

Collapse
No announcement yet.

Need help Python (school)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help Python (school)

    Ok, I have an assignment in school, to create a simple program in Python. I want to make some kind of computer shut down timer, easy and simple?
    I am not so good in Python and pretty n00b in programming so could someone give me some tips and tricks how to make it?
    Cheers :)

  • #2
    What OS are you planning on running this python code?

    If you are going to run this code on windows, the following lines would help you shut down a computer.

    import os
    #run os based command like opening notepad
    os.system("shutdown -OPTIONS")

    Once you open command prompt and type "shutdown /help" you will get a lot of options. Select the ones you want and replace the "-OPTIONS" part in the last line of the code with the options you want.

    You also mentioned that you would need a timer to shutdown the machine. Have a look at this URL (Remote Shutdown on Windows Python recipes ActiveState Code). It has a good python program to shutdown a system with a few options. That should be helpful to you.

    Comment


    • #3
      thank you very much :) this should help me a lot i think :))

      Comment


      • #4
        On Linux you can basically use the same code, but you will have to use other options. "shutdown -h now", would it be if you wanted to shutdown immediately.

        Comment


        • #5
          Originally posted by Util1ty View Post
          thank you very much :) this should help me a lot i think :))
          Hi Util1ty,

          I remember reading in one of the rules section that replying with Thanks message might be considered SPAM. Use of Thanks button at the bottom of the someone's message is a recommended way of expressing gratitude.

          Long time members, please correct me if i am wrong.

          Comment


          • #6
            Originally posted by hermit View Post
            Hi Util1ty,

            I remember reading in one of the rules section that replying with Thanks message might be considered SPAM. Use of Thanks button at the bottom of the someone's message is a recommended way of expressing gratitude.

            Long time members, please correct me if i am wrong.
            thanks lol kidding :) Im not so good at remembering all the rules at all sites im in :S
            Gonna run the program on Windows 7, yes :)

            Comment


            • #7
              I know a little python..
              HHSSSSSSSHSSSS
              SSSSSSSS
              sigpic

              WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT


              Comment


              • #8
                I may come with further questions in the future :)

                Comment


                • #9
                  Python is a great language and very easy to learn. Lots of stuff can be found on the python documentation online. If you really want to learn more I recommend the book 'Learning Python', but I can answer small questions regarding it as well.

                  Best of luck with your project.

                  Comment


                  • #10
                    Thanks maybe check that out :)
                    Program is done now very simple but it works :)
                    Thanks for the help :)

                    Comment


                    • #11
                      Originally posted by Util1ty View Post
                      Thanks maybe check that out :)
                      Program is done now very simple but it works :)
                      Thanks for the help :)
                      If the program is done I'm closing the thread. PM me or one of the other think tank mods if you want it reopened. If you need help with something else you can start a new thread.
                      Last edited by videogames; February 27, 2011, 04:42 PM.

                      Comment

                      Working...
                      X