Running Programs
From Neural Wiki
This is a newbies guide to creating and running programs. This is a very daunting prospect to someone who has never done it, and I hope this will help. Before you start, you need a programming language installed (Python, Perl, FORTRAN ect) and some kind of editor like EMACS or VIM.
[edit] Windows XP
Once you have installed your programming language software and an editor, it is time to create and run your programs
Go to the START button, click it, then click run. A box titled Run will appear. Type in cmd and hit enter.
On my computer, a prompt appears that says
C:\Documents and Settings\lab.SRB-138-DELL5.000>
- THIS WILL VARY BY COMPUTER! HOWEVER YOU SHOULD HAVE SOME VARIATION OF C:\...>
[edit] Generally speaking, scripts should be run from the folder that they are physically located in
I store and run most of my programs from a folder located on the desktop. This simplifies things and makes the files, programs and results easy to find. This means that you must direct the prompt to the folder containing both your PROGRAMS and your FILES TO ANALYZE. For example, if my files and programs are in a folder titled TEST on the desktop, at the prompt, I will type in
cd Desktop/test
then hit enter. Now the prompt reads
C:\....\Desktop\Test>
[edit] Running Scripts
Once the prompt is pointed to the correct folder, you can start using the scripts. FORTRAN scripts have a .f extension, perl scripts have a .pl extension. If I want to run a perl script titled analysis.pl, at the prompt I will type in
perl analysis.pl
and hit enter.
Running FORTRAN scripts requires an extra step. To run a FORTRAN script titled analysis.f, at the prompt I will type in either
g77 analysis.f or gfortran analysis.f
and hit enter. This choice depends whether I have installed g77 or gfortran on my computer. These commands compile the program, but do not run it. All this does is load the program into the buffer, and check for errors. If there is an error, it will tell you. You must fix the error before you can run the program.
If your program is error free, then at the prompt type in
a
and hit enter. Now the program will run and create your programmed outputs.
