Python学习思考(1)

目前学习的方法分为两条线:

  1. 系统性教材(《Python编程:从零基础到项目实战》)
  2. 基于明确方向的实操(目前学习到爬虫)

系统性教材的内容比较浅显,给予基础性的全面介绍,虽然有配套的教学讲解视频,但是基本没有看,因为相比于读文字,看视频实在是效率很低的一种方式,而且热媒体不利于思考。

阅读更多

JSON

基本概念

JSON(JavaScript Object Notation)是一种轻量级的数据交换格局。它基于ECMAScript的一个子集。 JSON选用完全独立于言语的文本格局,但是也使用了类似于C言语宗族的习气(包含C、C++、C#、Java、JavaScript、Perl、Python等)。这些特性使json调试成为抱负的数据交换言语。 易于人阅览和编写,同时也易于机器解析和生成(一般用于提高网络传输速率)。

JSON 数据的书写格式是键(名称)/值对。 
JSON 键值对是用来保存 JS 对象的一种方式,和 JS 对象的写法也大同小异,键/值对包括字段名称(在双引号中),后面写一个冒号,然后是值。 
JSON 值可以是:字符串(在双引号中)、数组(在中括号中)、数字(整数或浮点数)、逻辑值(true 或 false)、对象(在大括号中)、 null。 

版权声明:上文为CSDN博主「漫天飞舞的雪花」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/lvdepeng123/java/article/details/81066277

阅读更多

AttributeError: module ‘requests’ has no attribute ‘get’

爬虫学习时遇到这个报错,因为在教学系统的练习界面里面程序没有问题,但是复制到本机的VSCode里却出现了这个提示。Google搜索了一下,大部分人是因为将自己的练习文件命名为requests.py,导致真正的requests模块调用有误。

但是我的文件并不是命名为request,后来发现因为是查看HTTP响应代码而把文件命名为http.py,没想到也导致了同样的问题。后来改成h.py就好了……

阅读更多

简单是 Python 编程的第一要则

本文是 Python 之禅特别系列的第二篇,我们将要关注其中第三与第四条原则:简单与复杂。 ——Moshe Zadka1)Moshe has been involved in the Linux community since 1998, helping in Linux “installation parties”. He has been programming Python since 1999, and has contributed to the core Python interpreter. Moshe has been a DevOps/SRE since before those terms existed, caring deeply about software reliability, build reproducibility and other such things. He has worked in companies as small as three people and as big as tens of thousands — usually some place around where software meets system administration.

阅读更多

References   [ + ]

1.Moshe has been involved in the Linux community since 1998, helping in Linux “installation parties”. He has been programming Python since 1999, and has contributed to the core Python interpreter. Moshe has been a DevOps/SRE since before those terms existed, caring deeply about software reliability, build reproducibility and other such things. He has worked in companies as small as three people and as big as tens of thousands — usually some place around where software meets system administration.