Python 1: Installation and beginner's tutorial.
Top Comments
All Comments (206)
-
thanks. What's the fib function all about. I've never heard of it before?
\
-
Thanks for posting.
-
i wanted to know why i was doing certain things
-
Awesome tutorial and I hope you keep going! One thing, GUI is not supposed to be pronounced as a word (at least I don't think). It's G-U-I. That just confused me for a sec.
-
I like steak.
-
@zerocheese hmm well i don't know if you can set it up like that, but you could now probably do:
python -c "import myproject"
and it will run the code in path/to/myproject.py assuming it's in sys.path
-
@murftown when i say sys.path it does point to the directory i keep my python projects, is there a way i can set up python so from the command line i can just say python myproject.py?
-
@zerocheese if you want to load a python file as a module, it needs to be in the sys.path. type "import sys" and then "sys.path" to see what directories python looks in when you say "import whatever". if you want to add a certain directory forever and for always you need to add it to the PYTHONPATH environment variable.
-
@murftown Thanks, i thought there was a shorter way, like if u ran python from the same directory as the script, but its just easier to browse to the file and run it form there...
-
@zerocheese you can run it from the prompt / terminal:
> /whatever/path/to/python /whatever/path/to/your-file-he
re.py or you can right click the .py file and see if there's an option to Open with a certain Application, then choose Python.
Oh NOOO i forgot my colon lol
bringinhomesara 2 years ago 31
Thanks for the basics. Good way to get my feet wet before actually jumping in the deep end, so to speak.. Haha
Xblade1314 1 year ago 3