View Full Version : Newbie python question
Aphexe
September 23rd, 2008, 03:06 PM
I've recently switched from vista to linux and i'm having trouble figuring out how to save and load python files D:.
All i know is i type Python into the terminal and it brings up python then... i'm pretty much clueless on what to do after.
Bachstelze
September 23rd, 2008, 03:11 PM
You can make Python scripts with your favourite text editor, and run them with
python myscript.py
cmay
September 23rd, 2008, 03:16 PM
you should open a text editor. type
#!/usr/bin/env python
print "hello world"
save in home directory as hello.py
open terminal and
chmod 755.hell.py
then run in terminal by
./hello.py
or at least it is the way i would do it.
the file permissions need to be as executable.
i like to do this way.
good luck.
pmasiar
September 23rd, 2008, 03:17 PM
you probably used Python IDE called IDLE. It is included with Windows installer, but for Linux you need to install it separately (just do it via Synaptic in GUI). Or you can use any other editor, just make sure it has Python mode (replace tabs with 4 spaces)
Aphexe
September 23rd, 2008, 03:23 PM
Thanks so much! I downloaded IDLE and its much more clear to me now :)
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.