Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Browsing all 9596 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Wannabe Data Scientist! Here are 8 free online courses to start…

If you are a Data Scientist, you need to know 3 major areas: Coding Statistics Business Fortunately there are free courses for all the 3 around the internet. I am going to collect them here. (Note: I...

View Article


Image may be NSFW.
Clik here to view.

隐藏的宝藏,13 个不可忽视的优秀 Python 库

作为一门语言,你知道 python 是如何获得现在的成功的吗? 不妨去看看它大量的库吧,不管是原生的,还是第三方的,可能会有所收获。 有这么多的库,也就不奇怪为什么有的很多人用,有的却没有引起多少人注意。 而且,专注于一个领域的程序员往往并不知道那些看起来是为其他工作类型创建的库能给他们带来什么好处。 这里有 13个你可能已经忽略,但绝对值得你的注意的优秀的 Python 库。...

View Article


Image may be NSFW.
Clik here to view.

Python入门(二):请求

这次我们入门一下爬虫的请求模块。本篇不会深入地讲请求相关的知识,主要关注在爬虫部分的相关知识,点到为止。 一 、HTTP协议 我们在第一篇爬虫教程讲到了HTTP协议这个东西。讲HTTP协议之前,我们要先讲讲我们平时浏览的网页是怎么来的。...

View Article

Image may be NSFW.
Clik here to view.

说说 Python 字符编码二三事

题图:unsplash.com byRicardo Gomez Angel 不论你是有着多年经验的 python 老司机还是刚入门 Python 不久的新贵,你一定遇到过UnicodeEncodeError、UnicodeDecodeError 错误,每当遇到错误我们就拿着 encode、decode 函数翻来覆去的转换,有时试着试着问题就解决了,有时候怎么试都没辙,只有借用 Google...

View Article

Image may be NSFW.
Clik here to view.

Python学习(一)

安装与使用 1. 以2.7.6为例 安装路径:D:\Program Files (x86)\python27\ 安装完成后打开软件,如果提示: ‘python’不是内部或外部命令,也不是可运行的程序或批处理文件。 需要 手动添加环境变量。 2. 两种运行模式 命令行模式 (1) 使用notepad++ 编写 hello.py 例如: print 'hello world' (2)...

View Article


Image may be NSFW.
Clik here to view.

Building a basic HTTP Server from scratch in Python

In its essence, the modern web is just text going back and forth between clients and servers. As developers, we use web frameworks to help us build strings to send to clients. Web frameworks abstract...

View Article

Image may be NSFW.
Clik here to view.

根据一段话判断情绪

引言 看到一个好玩的项目, 女朋友的微博情绪监控 ,这个是根据一段话来判断情绪的,记得之前有在哪里看到过,未来的一切都是API,也就是很多东西会被封装好,你只需要去用就可以了,这个就是一个很好的例子,你可以不懂语意分析,不懂分词,这些都不要紧,只要你给出你的素材,后面就交给api去处理 代码 #!/usr/bin/env python # -*- coding: UTF-8 -*- import...

View Article

Image may be NSFW.
Clik here to view.

Python中最糟糕的代码模式

下文是Aaron Maxwell投递的客座博文,他是Advanced python Newsletter的作者。 错误代码千千万,在Python中,有一种是最糟糕的。 在其他两位工程师每人花费三天的时间试图去搞定一个Unicode编码的“玄学”问题而徒劳无功后,我仅仅花费了一天时间就定位到了错误的子句,尽管很累,但是很开心。十分钟后,我们就有了应对该bug的方法。...

View Article


Image may be NSFW.
Clik here to view.

python你不得不知道的(文件异常处理)知识

python你不得不知道的(文件异常处理)知识 一点号Python热爱者昨天 php?url=0FcO4kcutv" alt="python你不得不知道的(文件异常处理)知识" />一、常见的异常: SyntaxError 语法错误 NameError 未声明/初始化对象 TypeError 对类型无效的操作 KeyError 字典中查找不存在的键 IOError 输入/输出操作失败...

View Article


Python学习(二)---字符串

字符串可以用单引号 ('...') 或双引号 ("...") 标识 。 \ 可以用来转义引号; 情形一: 如果字符串中 只有单引号而没有双引号,就用双引号引用,否则用单引号引用 。 比如要打印: doesn't: >>>"doesn't" "yes",he said >>>'"yes",he said ' 或者,使用转义符号 \ doesn't:...

View Article

Image may be NSFW.
Clik here to view.

Python Hyperopt Finding the optimal hyper parameters

This comes up as a very common question in ##machinelearning chat room How do you chose the right parameters for your Neural Network model? How do you chose how many hidden layers to use, or what your...

View Article

使用ZoomEye批量快速攻击目标

前言 “zoomeye 是一个针对网络空间的搜索引擎”这是ZoomEye官方(知道创于安全实验室)给予的定义,其功能与shodan.io类似,但其各自的侧重点又有所不同。之前我写过一篇关于shodan的文章,传送门“ 使用shodan的api(python) ”,那时候ZoomEye的功能还相当简洁,经过2年的发展,其搜索深度以及数据量已经媲美shodan.io 场景...

View Article

Image may be NSFW.
Clik here to view.

Django Weekly 25

Worthy Read How to Implement Case-Insensitive Username How to implement a case insensitive authentication using the built in Django User? user_auth ScyllaDB on Compose A blazing fast, drop-in...

View Article


Image may be NSFW.
Clik here to view.

Build a blog with Django: Display published posts

In this post, I'd show you how to display your published posts to your readers. There are many ways to go about this task but I'd show you the best practice way. Our journey would take us through many...

View Article

Ubuntu 14.04下Django项目链接MySQL数据库

在成功安装mysql-python-1.2.5后,开始配置django的mysql连接配置。 打开django项目的二级目录/Hello/Hello/setting.py文件。 默认情况下Django数据为sqlite: # Database # https://docs.djangoproject.com/en/dev/ref/settings/#databases DATABASES = {...

View Article


Today CPython source is migrated to GitHub

[python-Dev] GitHub migration scheduled for Friday Brett Cannon brett at python.org Tue Feb 7 13:03:24 EST 2017 Previous message (by thread): [Python-Dev] User + sys time bigger than real time, in case...

View Article

Error Handling & Logging in Python

In software development, different types of errors can occur. They could be syntax errors, logical errors, or runtime errors. Syntax errors most probably occur during the initial development phase and...

View Article


Image may be NSFW.
Clik here to view.

Hack the planet!!...With Python

So I'm sat watching a film called Hackers...cheesy hacker movie set in the 1990s. But I really do like it. Sure the dialogue is really bad, and the hacking is pure Hollywood, but it is a fascinating I...

View Article

Image may be NSFW.
Clik here to view.

Dilogarithm, polylogarithm, and related functions

The functions dilogarithm , trilogarithm , and more generally polylogarithm are meant to be generalizations of the logarithm. I first came across the dilogarithm in college when I was evaluatingsome...

View Article

SciPy Tutorial: Linear Algebra

SciPy Tutorial: LinearAlgebra If you want to read why you should learn linear algebra or SciPy for data science or which NumPy functions are useful when you’re working with SciPy, check out the full...

View Article
Browsing all 9596 articles
Browse latest View live