Results 1 to 4 of 4

Thread: (Python) Beginner question, scripts won't run?

  1. #1
    Join Date
    Mar 2013
    Beans
    14

    (Python) Beginner question, scripts won't run?

    This is a extremely basic question and I feel awful just asking it but:


    I'm trying to teach myself Python and I've been reading the stickies.. However when I start saving strings of codes into gedit, the site I'm learning off of tells me to "run the script"

    How do I "run the script" through just gedit so it'll pop up in the Python3 terminal in Ubuntu?

    I save it as test1.py but I have no idea what to do with it.

  2. #2
    Join Date
    May 2011
    Beans
    225
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: (Python) Beginner question, scripts won't run?

    You run most python scripts from the command line. So open a terminal with ctrl+alt+t and then cd to the directory your script is and run the script with:
    Code:
    ./<your script>
    However, your script is probably not marked as executable yet, so you will first have to do:
    Code:
    chmod +x <your script>

  3. #3
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: (Python) Beginner question, scripts won't run?

    From the terminal (Ctrl+Alt+t)
    Code:
    python test1.py
    or
    Code:
    python3 test1.py

  4. #4
    Join Date
    Mar 2013
    Beans
    14

    Re: (Python) Beginner question, scripts won't run?

    I feel so dumb, thank you guys so much!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •