- 博客(19)
- 资源 (3)
- 收藏
- 关注
原创 《“笨办法”学python3》Ex 16
知识点close:关闭保存read:读取文件,可将文件赋给一个变量readline:读取文本中一行truncate:清空文件write('stuff'):将 stuff 写入文件seek(0):将读写位置放在文件开头cls:powershell清屏注:修改时参考https://www.jianshu.com/p/ce2be0faac82程序from ...
2019-03-14 10:01:14
314
转载 如何快速转载CSDN中的博客
前言 对于喜欢逛CSDN的人来说,看别人的博客确实能够对自己有不小的提高,有时候看到特别好的博客想转载下载,但是不能一个字一个字的敲了,这时候我们就想快速转载别人的博客,把别人的博客移到自己的空间里面,当然有人会说我们可以收藏博客啊,就不需要转载,(⊙o⊙)… 也对。。实现 因为我自己当初想转载的时候却不知道该怎么转载,所以学会了之后就把方法写出来,帮助那些想转载却不知道该怎么转载的人(...
2019-01-24 20:45:23
102
转载 网络爬虫遇见的报错及处理方法
0.环境介绍1. pip install psutil出错-You are using pip version 10.0.1, however version 18.0 is available.2. 使用BeautifulSoup的时候提示以下错误:bs4.FeatureNotFound: Couldn't find a tree builder with the features yo...
2018-11-30 23:12:00
915
原创 《“笨办法”学python3》Ex 15
知识点:读取文件. 脚本读取和命令行读取. txt = open(filename)print(txt.read())file_again = input("> ")txt_again = open(file_again)print(txt_again.read())程序:from sys import argvscript, filename = argv...
2018-11-15 23:01:04
421
原创 《“笨办法”学python3》Ex 14
知识点练习使用 argv 和 input()程序from sys import argvscript, user_name = argvprompt = '> 'print(f"Hi {user_name}, I'm the {script} script. ")print("I'd like to ask you a few questions. ")print...
2018-11-15 22:49:55
468
原创 《“笨办法”学python3》Ex 13
知识点:from sys import argvimport可以将python特性(模块module)引入脚本,需要什么调用什么,使得代码很小. import 也可以作为文档查script,first,second,third = argvargv是参数变量,这行代码将argv解包.将(命令行中的)输入参数赋给4个变量写一个接受参数的脚本. 按照程序输入,出现报错:no...
2018-11-13 11:51:53
872
原创 《“笨办法”学python3》Ex 12
知识点:input函数带输出的一种函数用法程序:age = input("How old are you?")height = input("How tall you are?")weight = input("How much do you weigh?")print(f"So, you're {age} old, {height} tall and {weight} he...
2018-11-12 22:58:48
205
原创 《“笨办法”学python3》Ex 11
知识点:引入外界输入变量 a= input()代码:print("How old are you?",end=' ')age = input()print("How tall are you?", end=' ')height = input()print("How much do you weigh?", end=' ')weight = input()print(f...
2018-11-12 22:52:02
212
原创 《“笨办法”学python3》Ex 10
知识点:输出转义字符转义字符 功能 \\ \ \' ' \" " \a 响铃符 \b 退格符 \f 进纸符 \n 换行符 \N{name} Unicode 数据库中字符名,name是名字 \r 回车 \t 制表符 \uxxxxx 值为16进制的xxxx字符 \v 垂...
2018-11-09 17:40:23
128
原创 《“笨办法”学python3》Ex 9
知识点:print的再练习连续打印多行用3个双引号括起来""""""程序:# Here's some new strange stuff, remember type it exactly.days = "Mon Tue Wed Thu Fri Sat Sun"months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"pr...
2018-11-09 16:51:52
129
原创 《“笨办法”学python3》Ex 8
知识点:更复杂的打印给出字符串格式多为变量,formatter = "{} {}"输出print(formatter.format(内容,内容)P.S.为什么“one”用引号,False不用:True和False是Python关键字. 程序:formatter = "{} {} {} {}"print(formatter.format(1 , 2 , 3 , ...
2018-11-08 19:12:26
357
原创 《“笨办法”学python3》Ex 7
知识点:print("word"*10):重复打印的方法依旧重复练习程序:print("Mary had a little lamb. ")print("Its fleece was white as {}.".format('snow'))print("And everywhere that Mary went. ")print("."*10) # what'd that...
2018-11-08 19:01:25
150
原创 《“笨办法”学python3》Ex 6
知识点:文本中插入变量字符串的方法print(f".......{valuable}"}w和e是两个字符串变量可以用print(w+e)直接打印程序:types_of_people = 10x = f"There are {types_of_people} types of people. "binary = "binary"do_not = "don't"y ...
2018-11-08 17:49:44
213
原创 《“笨办法”学python3》Ex 5
知识点:EX5是打印和变量的更多练习,其中整数转浮点数只用在在运算中加入浮点数计算,比如 5 * 5.0 = 25.0程序:my_name = 'Ping X'my_age = 23 # not a liemy_height = 161 # cmmy_weight = 51.5 # kgmy_eyes = 'Brown'my_teeth = 'White'my_hair ...
2018-11-08 11:34:48
491
原创 《“笨办法”学python3》Ex 4
知识点:变量赋值,直接:名+=+值==用于检查两边是否相等,要与=区分.程序:#车数cars = 100#每车容量space_in_a_car = 4.0#司机数drivers = 30#乘客数passengers = 90#空车数cars_not_driven = cars - drivers#可用车数cars_driven = drivers#总容纳量...
2018-11-08 11:30:18
225
原创 《“笨办法”学python3》Ex 3
知识点:在python3中进行数字计算和真值判断. 与C++相同,+,-,/,*,%程序:#统计我的鸡print("I will now count my chickens:")#母鸡25+30/6=30print("Hens",25+30/6)#公鸡100-25*3%4=97print("Roosters",100-25*3%4)#统计我的蛋print("Now ...
2018-11-08 11:26:58
325
原创 《“笨办法”学python3》Ex 2
知识点:#:注释文字程序:# A comment, this is so you can read your program later.# Anything after the # is ignored by python. \print("I could have code like this. ") # and the comment after is ignored...
2018-11-08 11:18:44
130
原创 《“笨办法”学python3》Ex 1
知识点:打印print用法程序:print("Hello World!")print("Hello Again")print("I like typing this.")print("This is fun.")print('Yay! Printing.')print("I'd much rather you 'not'.")print('I "said" do
2018-11-08 11:16:00
230
原创 《“笨办法”学python3》附录+Ex 0
背景介绍:本科非计算机专业,基本零基0础 python3 入门。电脑环境:python 3.7.1 + 64位 windows系统+Atom文本编辑器笔记介绍:笔记会概述每个练习的核心内容,分享遇见的问题以及解决方案,欢迎各位批评指正。不会的部分内容参考博主从流域到海域:https://blog.csdn.net/Solo95/article/details/5044902...
2018-11-08 11:09:52
2033
gurobipy.rar
2019-07-17
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人