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

Image may be NSFW.
Clik here to view.

Optimizely releases new products signaling its emergence as ‘an...

You may know Optimizely as the A/B testing company for Web and mobile. But today, the San Francisco-based firm is unveiling a new version of its product line that signals its full emergence as “an...

View Article


Operator Functions in Python | Set 1

python has predefined functions for many mathematical, logical, relational, bitwise etc operations under the module “operator”. Some of the basic functions are covered in this article. 1. add(a, b):-...

View Article


Python Sweetness: Deploying modern Python apps to ancient infrastructure with...

In recent adventures for work, I once again found myself on a team with an interesting and relatively new-to-me problem that I hadn’t been forced to consider quite so much before. This team is...

View Article

Image may be NSFW.
Clik here to view.

All Alone Now - Useful Python Libraries for Pointless Websites

Over the last couple weeks, I made a little website called All Alone Now for FermiJam - a game/digital art jam inspired by Fermi's Paradox. I consider the site a great success, and I think it struck...

View Article

Image may be NSFW.
Clik here to view.

Python进阶强化训练之数据结构与算法进阶

如何在列表、字典、集合中根据条件筛选数据? 实际问题 过滤列表中的负数 筛选出字典种值高于90的项 筛选出集合种能被3整出的元素 围绕上面三个问题我们来进行讨论,比如下面有一个列表: >>>from random import randint>>>li = [randint(-10, 10) for _ in...

View Article


Notes from a Jupyter/Dataframe project

I’m looking at some League of Legends data; champion win rates by player tier . I’m curious which championshave higher win rateswith skilled players, and/or which are more popular. You can see the...

View Article

Image may be NSFW.
Clik here to view.

Our Resinified Office Lock

If it's Friday, then it's usually time for Friday Hacks at resin.io! This means working on a project of our own interests - as long as it is connected to resin.io in some way. We have many dozens of...

View Article

Image may be NSFW.
Clik here to view.

Python开发程序:支持多用户在线的FTP程序

作业:开发一个支持多用户在线的FTP程序 要求: 用户加密认证 允许同时多用户登录 每个用户有自己的家目录 ,且只能访问自己的家目录 对用户进行磁盘配额,每个用户的可用空间不同 允许用户在ftp server上随意切换目录 允许用户查看当前目录下文件 允许上传和下载文件,保证文件一致性 文件传输过程中显示进度条 附加功能:支持文件的断点续传(仅下载) 程序 1、最最重要的readme: ###...

View Article


Image may be NSFW.
Clik here to view.

Python是走向数据挖掘巅峰的必备良药

python是走向数据挖掘巅峰的必备良药 一点号编程派8小时前 php?url=0ERu4EK1Eo" alt="Python是走向数据挖掘巅峰的必备良药"...

View Article


Image may be NSFW.
Clik here to view.

//No Comment - Python 3.6.0 Beta 1

//No Comment - python 3.6.0 Beta 1 Written by Mike James Friday, 16 September 2016 Python 3.6.0 Beta 1 Is here Sometimes the news is reported well enough elsewhere and we have //no comment other than...

View Article

Python-Day7 面向对象进阶/异常处理/Socket

一、 面向对象高级语法部分 1.静态方法 通过@staticmethod装饰器即可把其装饰的方法变为一个静态方法,什么是静态方法呢?其实不难理解,普通的方法,可以在实例化后直接调用,并且在方法里可以通过self.调用实例变量或类变量,但静态方法是不可以访问实例变量或类变量的,一个不能访问实例变量和类变量的方法,其实相当于跟类本身已经没什么关系了,它与类唯一的关联就是需要通过类名来调用这个方法。...

View Article

Image may be NSFW.
Clik here to view.

python征程1.3(初识python)

1.字典。 字典是python中的映射的数据类型,由键值对构成,几乎所有类型的python对象都可以用作键,不过一般还是以数字或是字符串最为常见。值可以是任意类型的python对象,字典元素用{}来包裹。 (1)要注意“键值对”的相关概念。 假设字典为 dics = {0:'a', 1:'b', 'c':3} [解释] 当键'key'(键)不存在是,打印'not...

View Article

Image may be NSFW.
Clik here to view.

Python进阶强化训练之文件I/O高效处理技巧

如何读写文本文件? 实际案例 某文本文件编码格式已直(如UTF-8,GBK,BIG5),在python2.x和python3.x中分别如何读取这些文件? 解决方案 字符串的语义发生了变化: python2 python3 str bytes unicode str python2.x 写入文件前对 unicode 编码,读入文件后对二进制字符串解码 >>> f =...

View Article


Image may be NSFW.
Clik here to view.

Django基础

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME':'dbname', 'USER': 'root', 'PASSWORD': 'xxx', 'HOST': '', 'PORT': '', }}#...

View Article

Image may be NSFW.
Clik here to view.

Import Python: ImportPython Issue 90 - Real-time streaming data pipeline,...

import python blog ImportPython Issue 90 - Real-time streaming data pipeline, generators, channels, and more Posted on Sept. 16, 2016 Worthy Read Real-time streaming data pipeline in python streaming...

View Article


Image may be NSFW.
Clik here to view.

基于非阻塞异步回调Web后台框架开发分享

Nida简介 Nida是一个单线程多进程,非阻塞异步回调,基于Level-Trigger事件循环驱动的高并发后台框架,使用python语言开发,基于Tornado改写。简化并去掉了Tornado一些复杂的特性,方便阅读与学习核心源码。 一个使用Nida搭建的简单echo HTTP服务的例子如code1所示: code.1 def handle_request(request): message =...

View Article

Image may be NSFW.
Clik here to view.

Python进阶强化训练之装饰器使用技巧进阶

如何使用函数装饰器? 实际案例 某些时候我们想为多个函数,统一添加某种功能,比如记时统计、记录日志、缓存运算结果等等。 我们不想在每个函数内一一添加完全相同的代码,有什么好的解决方案呢? 解决方案 定义装饰奇函数,用它来生成一个在原函数基础添加了新功能的函数,替代原函数 如有如下两道题: 题目一...

View Article


Image may be NSFW.
Clik here to view.

django缓存

由于Django是动态网站,所有每次请求均会去数据进行相应的操作,当程序访问量大时,耗时必然会更加明显,最简单解决方式是使用:缓存,缓存将一个某个views的返回值保存至内存或者memcache中,5分钟内再有人来访问时,则不再去执行view中的操作,而是直接从内存或者Redis中之前缓存的内容拿到,并返回。 Django中提供了6种缓存方式: 开发调试 内存 文件 数据库...

View Article

Python的命令行解析工具OptParse

作者:糖果 无论是用C语言,还是用Java,有时都会写一些命令行的工具,解析用户在命令输入的参数,而python有自己特色的命令行参数解析库,就是optparse。hpfeed-cli的源码就是用optparse来解析命令行参数的,hpfeed是给威胁地图发送威胁数据的,使用的是hpfeed协议,hpfeed-cli是一个在terminal中直接运行的命令行程序,有着非常复杂的参数输入。 None...

View Article

理解 Python 中的元类

理解 python 中的元类 1小时前来源:开发者头条 元类 (metaclass) 是创建类的类,类是元类的实例,只有 type 及其派生类才可能充当元类。正如我们要先创建一个类,然后才能创建实例,我们先要创建元类,然后才能创建类。 好吧上面这段话确实很绕,下面我们一步一步来看 首先在 Python 中类也是一个对象 class A(object):...

View Article
Browsing all 9596 articles
Browse latest View live