Learning To Program
House Keeping:
1) Using the Command Prompt:
Its integral to programming that you use the command prompt.
Go to C:/Windows/System32/cmd.exe (Windows XP) and make a short cut on your desktop.
Right Click the Short Cut and Change the Properties including:
--Start in: This is a great way to have your command prompt open in your working directory everytime. That way you don't need to cd, change directory, to get to your everyday programs; or you dont need to type long directory path names to run common programs.
--Cool! you can also change the colors, layout, and more--so your command prompt is fun/functional
1)A) Navigating the Command Promt
--cd (change directory)
--cd .. (go back a directory)
--Path (display paths)
--mkdir (in cmd. promt type help mkdir for easy explanation to make directories)
--Start . (opens explorer for current directory)
--Start .. (opens explorer for one directory up)
--C:\windows\java> CD ..\system32 --> C:\windows\system32
Moving up and down the folder tree in one command. CD (change dir), .. (move down tree), then go to file brilliant!
--fc filename.txt filename1.txt (prints the contents of two texts so comparisons can be made)
Command Prompt while running Programs
java Assignment1 < input1.txt > myout1.txt //runs java program with input for system.in and creates text file
2) Setting up Path so everyday programs can be run with a single, or few, commands.
--Some of these setting are for Python, and some are just good to have for basic programming functionality.
In your Command prompt type Path.
You will see the directories windows looks in when the command prompt runs a program.
--To edit Path, so that it includes directories where you will store your programs you can do 2 things:
Right click on My Computer, go to properties, click on the advanced tab, click on the Environment Button and look for
Path in either user variables or system variables, I can't explain the difference, so I put in both.
Now this is only where Windows or the Command Prompt looks to execute files.
To change the Python Path go to HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\PythonPath in Registry Editor and add your paths where you would like Python to search for Programs
To change Java Path
"In
Windows 2000/XP, open "Control Panel". (You might be able to get there
by going through "Start" -> "Settings") Select "System". (you might
need to select "Performance and Maintenance" before this) Select
"Advanced" Select "Environmental variables" Add C:. to CLASSPATH and
PATH. If it already contains something like: D:\java\. Then you need to
add C:. as D:\java\.;C:. Then click OK buttons to get out. Then reboot
your computer. "
(Taken from Object Oriented Programing course ASU CSE 205)
There is some convention on changing paths--do some searching to determine what they are; however I can tell you that it would be a good habit to make a folder named bin. And begin to Save your main programs there
Next, I will start adding to my bin file and try to start running programs with less effort.
Also, I will start exploring using Python IDLE to more interactively clean up and run programs.
House Keeping:
1) Using the Command Prompt:
Its integral to programming that you use the command prompt.
Go to C:/Windows/System32/cmd.exe (Windows XP) and make a short cut on your desktop.
Right Click the Short Cut and Change the Properties including:
--Start in: This is a great way to have your command prompt open in your working directory everytime. That way you don't need to cd, change directory, to get to your everyday programs; or you dont need to type long directory path names to run common programs.
--Cool! you can also change the colors, layout, and more--so your command prompt is fun/functional
![]() |
From Urban Ecological Processes |
1)A) Navigating the Command Promt
--cd (change directory)
--cd .. (go back a directory)
--Path (display paths)
--mkdir (in cmd. promt type help mkdir for easy explanation to make directories)
--Start . (opens explorer for current directory)
--Start .. (opens explorer for one directory up)
--C:\windows\java> CD ..\system32 --> C:\windows\system32
Moving up and down the folder tree in one command. CD (change dir), .. (move down tree), then go to file brilliant!
--fc filename.txt filename1.txt (prints the contents of two texts so comparisons can be made)
Command Prompt while running Programs
java Assignment1 < input1.txt > myout1.txt //runs java program with input for system.in and creates text file
2) Setting up Path so everyday programs can be run with a single, or few, commands.
--Some of these setting are for Python, and some are just good to have for basic programming functionality.
In your Command prompt type Path.
You will see the directories windows looks in when the command prompt runs a program.
--To edit Path, so that it includes directories where you will store your programs you can do 2 things:
Right click on My Computer, go to properties, click on the advanced tab, click on the Environment Button and look for
Path in either user variables or system variables, I can't explain the difference, so I put in both.
Now this is only where Windows or the Command Prompt looks to execute files.
![]() |
From Urban Ecological Processes |
To change the Python Path go to HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\PythonPath in Registry Editor and add your paths where you would like Python to search for Programs
![]() |
From Urban Ecological Processes |
To change Java Path
"In
Windows 2000/XP, open "Control Panel". (You might be able to get there
by going through "Start" -> "Settings") Select "System". (you might
need to select "Performance and Maintenance" before this) Select
"Advanced" Select "Environmental variables" Add C:. to CLASSPATH and
PATH. If it already contains something like: D:\java\. Then you need to
add C:. as D:\java\.;C:. Then click OK buttons to get out. Then reboot
your computer. "
(Taken from Object Oriented Programing course ASU CSE 205)
There is some convention on changing paths--do some searching to determine what they are; however I can tell you that it would be a good habit to make a folder named bin. And begin to Save your main programs there
Next, I will start adding to my bin file and try to start running programs with less effort.
Also, I will start exploring using Python IDLE to more interactively clean up and run programs.
No comments:
Post a Comment
If your thinking about something.
Type it here.