PyCharm编辑器及第一个程序

创建新的工程test

然后在工程里创建一个helloworld.py的文件,输入一下代码

#!/usr/bin/env python3

# *.* coding:utf-8 *.*
name = raw_input("Please input your name: ")

print("Hello " + name)

运行时提示name = raw_input("Please input your name: ")
NameError: name 'raw_input' is not defined

这个是由于python3已经不支持函数ram_input函数了,统一改成input,

然后按alt+shift+F10运行程序。运行效果如下

/home/grubly/PycharmProjects/test/venv/bin/python /home/grubly/PycharmProjects/test/helloWorld
Please input your name: grubly
Hello grubly


Process finished with exit code 0


你可能感兴趣的:(linux软件)