Results 1 to 8 of 8

Thread: Python help

  1. #1
    Join Date
    Apr 2007
    Beans
    3

    Python help

    Well, i installed IDLE as i can save my programs with that. Once i have a programmed saved i go under properties and make the file an executable one but when i try to run it nothing happens. Am i doing something wrong? Thanks in advanced.

  2. #2
    Join Date
    Sep 2006
    Beans
    156
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: Python help

    Quote Originally Posted by JackTheRipper View Post
    Well, i installed IDLE as i can save my programs with that. Once i have a programmed saved i go under properties and make the file an executable one but when i try to run it nothing happens. Am i doing something wrong? Thanks in advanced.
    I did not understand your problem.

    may be you wanted to add #!/usr/bin/python
    or
    you desire a development environment: in this case install Eric

    sorry
    msn : mas_dero@hotmail.com; skype: masdero

  3. #3
    Join Date
    Apr 2007
    Beans
    3

    Re: Python help

    Basically, i have my program all layed out. I save it as a .py and make it an executable file. When i open it a dialog box comes up and gives me the options to "run in terminal", "Display", "Cancel", or "Run". I've tried both Run in Terminal and Run and neither seem to work. Am i doing something wrong here?

  4. #4
    Join Date
    Sep 2006
    Beans
    156
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: Python help

    Quote Originally Posted by JackTheRipper View Post
    Basically, i have my program all layed out. I save it as a .py and make it an executable file. When i open it a dialog box comes up and gives me the options to "run in terminal", "Display", "Cancel", or "Run". I've tried both Run in Terminal and Run and neither seem to work. Am i doing something wrong here?
    Code:
    cat prog.py
    #!/usr/bin/python
    
    print "ciao"
    Code:
    chmod +x prog.py
    msn : mas_dero@hotmail.com; skype: masdero

  5. #5
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: Python help

    Quote Originally Posted by JackTheRipper View Post
    Basically, i have my program all layed out. I save it as a .py and make it an executable file. When i open it a dialog box comes up and gives me the options to "run in terminal", "Display", "Cancel", or "Run". I've tried both Run in Terminal and Run and neither seem to work. Am i doing something wrong here?
    You open it in file manager?

    To run it like that, you need the shebang line as first line of your script: "#!/usr/python" or wherever your python lives, to tell bash which program should interpret that script.

    But you can open your file in IDLE and run it from there too (Run, or F5), even without making it executable. Check "Instant Hacking" and "IDLE toying" links here: http://learnpython.pbwiki.com/HowToStart

  6. #6
    Join Date
    Mar 2007
    Location
    USA
    Beans
    Hidden!
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Python help

    After you set the permissions run the app in the same term

    ./prog.py

    The dot slash are important to tell the shell where the script is located.

  7. #7
    Join Date
    Apr 2007
    Beans
    3

    Re: Python help

    Alright, thanks guys. I'm pretty new to the world of linux and ubuntu so i'm still learning.

  8. #8
    Join Date
    Sep 2006
    Beans
    156
    Distro
    Kubuntu 7.10 Gutsy Gibbon

    Re: Python help

    You are welcome
    msn : mas_dero@hotmail.com; skype: masdero

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
  •