两种导入包方式

1、pip

2、easy_install

方式例如:pip install requests 

python 基础学习 第一天 (导入包和py基础)
import requests
r = requests.get("http://www.bilibili.com")
print(r.url)   
print(r.encoding)
print(r.text)  #显示HTML文本内容

python基础

########################字符串输出三种格式
age = 3
name = 'tom'
print('%s was %d years old'% (name,age))
print(name + " was " + str(age) + ' years old')
print('{0} was {1} years old'.format(name,age))#format 格式化 格式
########################
import sys
a = 1 #整型
b = 3.7 #浮点型
c = complex(float(a),b)#实部是a 虚部是b   1+3.7j
print(c)
print(sys.float_info)#float相关信息
########################

 

 

相关文章:

  • 2021-07-06
  • 2021-06-07
  • 2021-11-07
  • 2021-06-20
  • 2021-07-04
  • 2021-06-30
  • 2021-06-18
猜你喜欢
  • 2021-09-19
  • 2021-07-14
  • 2021-04-16
  • 2022-12-23
  • 2021-08-11
相关资源
相似解决方案