Skip to content
Jinho D. Choi edited this page Jan 15, 2016 · 4 revisions

Python 2.7

  • Download and install the latest version of Python 2.7.x.
  • Open a terminal and enter the following command: python --version.
  • If it prompts Python 2.7.x, Python is successfully installed on your machine.

PyCharm

  • Download and install the community version of PyCharm.
  • Launch PyCharm.
  • Create a project by choosing File -> New Project.
  • Create the directory location cs329.
  • Make sure to choose an interpreter whose version is 2.7.x.
  • Create a file quiz0.py by choosing File -> New -> Python File.
  • Copy and paste the following code to quiz0.py.
# while loop
s = 0
i = 0
while i < 10:
    s += i
    i += 1
print s,

# for loop using range
s = 0
for i in range(0,10):
    s += i
print s,

# sum using range
print sum(range(10))
  • Run the code by choosing Run -> Run 'quiz0'.
  • If you see 45 45 45 on the console, your program is successfully run.

Quiz

  • Login to lab0z.mathcs.emory.edu.
  • Create a directory quiz0 under the cs329 directory.
  • Put quiz0.py under cs329/quiz0.
  • If you are using a Windows machine or not familiar with command-line tools:
  • Use an FTP client (e.g., FileZilla) to upload your file.
  • If you are using a Mac/Linux machine and familiar with command-line tools:
  • Run the following command by replacing yourID with your mathcs ID (e.g., choi).
rsync -avc quiz0.py [email protected]:~yourID/cs329/quiz0/

(CS|LING|QTM) 329
Computational Linguistics

Instructor


Emory University

Clone this wiki locally