0
点赞
收藏
分享

微信扫一扫

Intellij IDEA15:建立Python 工程

Sikj_6590 2022-12-28 阅读 175


#! /usr/bin/env python
# -*- coding: utf-8 -*-

def foo():
str="function"
print(str);

def foo1(num):
print('num' ,num);

def foo2(name ,age):
print('name' ,name);
print('age' ,age);

if __name__=="__main__":
print("main")
foo2('yuhui' ,30)
foo1(6)
foo()

 

五个步鄹:

1)Windows中Python安装

2Intellij IDEA15中Python安装

3Intellij IDEA15建立Python项目

4编辑Python脚本

5)安装pip

 

 

 

Windows中Python安装:

Intellij IDEA15:建立Python 工程_python

 

Intellij IDEA15中Python安装:

Intellij IDEA15:建立Python 工程_Windows_02

 

Intellij IDEA15建立Python项目

Intellij IDEA15:建立Python 工程_Python_03

Intellij IDEA15:建立Python 工程_Windows_04

Intellij IDEA15:建立Python 工程_python_05

Intellij IDEA15:建立Python 工程_Windows_06

 

编辑Python脚本

Intellij IDEA15:建立Python 工程_Windows_07

Intellij IDEA15:建立Python 工程_Windows_08

 

Intellij IDEA15:建立Python 工程_Python_09

 

 

5)安装pip

Intellij IDEA15:建立Python 工程_python_10

 

1、如果上面的错误,则是没有引入urllib的包,需要通过pip进行引入。

 

 

2、pip引入的命令为pip install urllib ,默认安装在C:\Python27\Lib\site-packages

3、pip未安装,则进入命令行,然后把目录切换到python的安装目录下的Script文件夹下,运行 easy_inatall pip。

这样就可以引入python的package

 

 

 

 

举报

相关推荐

0 条评论