- go to the Python Download page.
- choose the correct version(s). V3.3.2 is the current version as of this writing but some Python code won't run on V3.3.2 so one might need to get V2.7.5. I have both version installed and use V2.7.5 for Rosalind and V3.3.2 for Computational Molecular Evolution. I haven't run across the need for V2.7.5 yet but that's the version Rosalind's ini1 asks you to load. I'm going to keep it simple but suggest you install both versions.
- Download and Install V2.7.5. Let it use its default file folder. For Windows that's C:\Python27.
- Download and Install V3.3.2. Let it use its default file folder. For Windows that's C:\Python33.
- Create a folder for each project. I have a folder for Rosalind under Documents.
- If the project will be using V2.7.5:
- Find the "IDLE (Python GUI)" Icon in the start menu under "Python 2.7".
- Right click on it and select "Copy".
- Open the projects folder.
- Right Click on the folder's background and select "Paste".
- Right Click on the newly pasted short cut and select "Properties".
- Click on the "Shortcut" tab.
- Change the "Start in: to the fully qualified path of the directory you just created.
- Click on the "OK" button.
I hope that gets you set up.
The first time I tried INI1 I didn't do the right thing. I don't know why. It said to type
import thisin the command line and see what happens. I did that but for some reason I didn't get "Then, click the 'Download dataset' button below and copy the Zen of Python into the space provided." What a mess.
As it turns out this.py is a module in C:\Python33\Lib for V3.3.2 or in C:\Pythod27\Lib for V2.7.5. You can open these modules in the editor and see what they look like The only difference is the format of the print statement. The small difference in the print statement is one of the few differences between the two versions beginners will notice right away. There are other differences.
When you want to run a module from the shell you type "import " followed by the name of the module then press enter. I haven't tried putting the same module name in my working directory and in the library folder so I don't know what would happen.
About String constants.
String constants can be quoted by either single quote(') or double quote(").While writing this I learned a little bit about Python string constants.
If you haven't played around with string constants try some of these:
>>> '' '' '' >>> ' '' ' ' ' >>> " " ' ' >>> " ' " " ' " >>> ' \' ' " ' " >>>
Then try some of your own. Have fun. Work Problem INI1 if you haven't done so already.
Nice Post! Thanks for sharing with us.python 101
ReplyDeleteNice Post! Thanks for sharing with us.python 101
ReplyDelete