Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Python Basics part -1 - Hello world

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,567
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 11, 2010

How to create a hello world script using python.
http://FilmsByKris.com

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (metalx1000)

  • hey, im having trouble trying to run the python script and the part were i get stuck at is after using vim and closing it i do chmod +x mypython.py but it goes to the next line and does nothing? got ideas?

  • @cqcboy100: That command shouldn't have and output if it runs properly. It just changes the permissions of your script to make is executable. After you do that, and you only have to do it once, then you would run your script like this:

    ./mypython.py

    the is a dot slash sriptname

  • so if the "#" sign is used for commenting, why do you put "!/usr/bin/python" behind a "#"??

    isn't it supposed to ignore that line??

  • @elnegrobembon: The first line of any script in a Unix like environment (Linux, Mac OS, etc...) tells the system what type of script it is. So, in a way it is a comment. That line is not run and not really part of the code. You could leave it out and the script will work fine, just instead of running the script like this:

    ./script.py

    you would have to run it like this:

    python script.py

    It's just more proper to have it.

  • @metalx1000

    ahhh i see.. so it ignores everything behind the # except for in the first line where you set the environment??

    and it's basically just saying to run that script using python program right?

    i think i got it...

    i appreciate the response man... youre a good teacher too..  thanx a lot for these vids.

  • @elnegrobembon: Right, if you where righting a BASH script, the first line would be:

    #!/bin/bash

    If it was a perl script it would be:

    #!/usr/bin/perl

    Basically telling the system where the interpreter is.

    This line is called the "Shebang"

see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • @tontoF12 I disagree zsh rules, zsh can be used as an irc client :P

  • @cqcboy100 also im new to vim so im trying to follow your commands so im not sure if i save it or not

  • Thanks man!

    Python % bash rulz! ;)

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more