Python模块中的特殊属性

Le Thu 09 October 2025

Like most other programming languages, in Python the codebase is also organized into modules. The modules in Python are created by the import system, either using an import statement or using importlib.import_module() or directly using the import() function call.

The module object has a namespace associated with it which is a dictionary dict. Attribute reference of module object is translated to a lookup into the dictionary.

Module object has some attributes that gets created and filled with data while the module object itself is created. In this article we will discuss about all the attributes that Python module objects has and what they are for.

module.name The name attribute is the fully qualified name of the module. This is used to uniquely identify the module in the import system. When you directly execute a script, its name attribute is set to main.

module1.py

def function(): print("function")

module2.py

import module1

print(module1.name)

module1

print(name)

main

In the above code, when we access name of module1 from inside the module2 we get “module1” as value. And when we directly access the name attribute of currently executing module we get main.

module.spec The import machinery uses a variety of imformation about the modules. Those information are the specs of the modules. The purpose of the module spec is to keep the import related information on per module basis. The module spec is used to transfer state information between different componenets of import system. When a Python script is executed directly its spec is set to None.

module1.py

def function(): print("function")

module2.py

import module1

print(module1.spec)

ModuleSpec(name='exercise', loader=<_frozen_importlib_external.SourceFileLoader object at 0x10682e420>, origin='/Users/admin/Documents/module1.py')

print(spec)

None

module.package The package attribute of a module is used to indicate the package where the module belongs to. If the module is a top level script that gets run directly then the package attribute is set to empty string (’’) or None. This attribute helps Python resolve relative imports correctly.

Consider the following package structure.

mypackage/ init.py module1.py subpackage/ init.py module2.py script.py If we print the package attribute inside module2.py, by running it as part of imported package would print something like “mypackage.subpackage”.

module2.py

print(package)

script.py

from mypackage.subpackage import module2

OUTPUT:

mypackage.subpackage

However, if we run module2.py directly using python module2.py, it will print empty string (’’) or None.

module.loader The loader object that is used to load the module by the import system. This attribute is usefull to get access to the load specific functionality of a module. Python’s importlib module uses this for advanced module mechanism.

import script

print(script.loader)

<_frozen_importlib_external.SourceFileLoader object at 0x1092fe420>

module.path It is a sequence of string that indicates where the packages submodules will be found. If a module has path attribute that means it is a package. Non-package modules should not have this attribute.

When we have the package structure mentioned above the path attribute will output like following.

script.py

import mypackage

print(mypackage.path)

['/Users/admin/Documents/mypackage']

module.file This attribute contains a string value that points to the location from where the module was loaded. It is only available if the module is loaded from a file based source. Built-in module don’t have file attribute and when a module is loaded non-standard way, thie attribute may absent.

import mypackage

print(mypackage.file)

/Users/admin/Documents/mypackage/init.py

module.cached This attribute is a string path of the compiled version of the code (.pyc) inside the pycache directory. Usually if file attribute is set then cached will also be set, but there are some cases where cached has value where as file may not have.

import mypackage

print(mypackage.cached)

/Users/admin/Documents/mypackage/pycache/init.cpython-312.pyc

module.doc This attribute is set to the documentation string of the module if present otherwise it is set to None.

"""This is documentation string"""

print(doc)

This is documentation string

module.annotations It is a dictionary that contains variable annotations collected during module body execution. If no annotations exists, it defaults to empty dictionary {}. It doesn’t include annotations of local variables inside functions.

script.py

count: int = 0

print(annotations)

{'count': }

module.dict This is a namespace dictionary that contains all the module level variables, classes, functions and objects. It is mutable, so you can modify it dynamically. You can not access dict as a global variable within a module but can access it as an attribute of module objects.

import mymodule

print(mymodule.dict) OUTPUT

{ 'name': 'mymodule', 'doc': None, 'package': None, 'loader': <...>, 'spec': <...>, 'x': 10, 'y': 'hello', 'greet': , 'MyClass': , } Conclusion Internally Python heavily rely on special methods and attributes. In this article you learned about the special attributes that Python module objects provides. Although those attributes are not something that you will use in your day to day job but knowing them is an extra knowledge that will help you understand Python’s internals which ultimately helps you write better code.

参考资料

  • https://docs.python.org/3/reference/datamodel.html#callable-types
  • https://docs.python.org/3/reference/import.html#importsystem

Par 纳兰风来, Catégorie : python

Tags :

Autres articles

Fish Shell用法

Le Mon 24 February 2025

Fish靓点:

  • 可观无用命令。输错的命令或不存在的命令,会显示为红色。及时反馈。
  • 识路途。好的路途带有下划线。
  • 自动现身。输入命令时 …

Par 纳兰风来, Catégorie : tools

Lire la suite …

转Git仓库为Mercurial Hg仓库

Le Mon 24 February 2025

Mercurial软件包中已经包含了转换所需的工具。不仅可用将git仓库转换为hg仓库,还可以将 CVS, Subversion, Git, Darcs, Monotone, Bazaar, GNU Arch, Mercurial,Perforce仓库转换为hg仓库。

首先修改.hgrc文件,这个文件通常位于home目录。

[extensions]
hgext.convert=

之后施行转换。

hg convert …

Par 纳兰风来, Catégorie : tools

Lire la suite …

Vue 3中按条件设置HTML元素的class值,同时附加其他的class值

Le Mon 24 February 2025

姑娘想给一个HTML元素的class属性添加一些内容。这些内容有的是直接写死的,有的要按条件设置。 这时候,姑娘需要给这个元素添加两个class属性。这让姑娘惊异 …

Par 纳兰风来, Catégorie : 25-003

Lire la suite …

uni-app得知缓存字节数目及清理缓存的办法

Le Sun 23 February 2025

姑娘有自己的cache_helper.js

function human_readable_size(bytes, decimals = 2) {
    if (!Number(bytes)) {
        return '0 Bytes';
    }

    const kbToBytes = 1024;
    const dm = decimals < 0 ? 0 : decimals;
    const sizes = [
        'Bytes',
        'KiB',
        'MiB',
        'GiB',
        'TiB',
        'PiB',
        'EiB',
        'ZiB',
        'YiB',
    ];

    const index = Math.floor(
        Math.log(bytes) / Math.log(kbToBytes),
    );

    return …

Par 纳兰风来, Catégorie : 25-003

Lire la suite …

将字节数目转为人类友好的格式

Le Sun 23 February 2025

姑娘偷来了一段代码。

function bytesToSize(bytes, decimals = 2) {
  if (!Number(bytes)) {
    return '0 Bytes';
  }

  const kbToBytes = 1024;
  const dm = decimals < 0 ? 0 : decimals;
  const sizes = [
    'Bytes',
    'KiB',
    'MiB',
    'GiB',
    'TiB',
    'PiB',
    'EiB',
    'ZiB',
    'YiB',
  ];

  const index = Math.floor(
    Math.log(bytes) / Math.log(kbToBytes …

Par 纳兰风来, Catégorie : foundation

Lire la suite …

uni-app得知当前应用程序的版本号码

Le Sun 23 February 2025

uni-app获取当前的应用程序的版本号的接口:

uni.getSystemInfo({
    success: function ({appVersion}) {
        console.log("girl's application version is:", appVersion)
    }
})

姑娘为了方便,将它改装一下:

// params: cb(application_version_text)
function girls_application_version(cb) {
    uni.getSystemInfo({
        success({ appVersion }) {
            cb(appVersion)
        },
        fail() {
            cb(null)
        }
    })
}
async function girls_application_version() {
    return await new Promise(function (resolve …

Par 纳兰风来, Catégorie : 25-003

Lire la suite …

Vue 3框架组合式API的生命周期挂钩

Le Sun 23 February 2025

姑娘不喜欢Vue,也不喜欢Vue 3框架组合式API中的生命周期挂钩。

姑娘喜欢回调函数。至少,回调函数很漂亮。姑娘喜欢漂亮之人、漂亮之物。

Vue 3中有如此之物:

function onMounted(callback: () => void): void
function onUpdated …

Par 纳兰风来, Catégorie : 25-003

Lire la suite …

Vue 3框架编写的应用程序中数组的用法

Le Sun 23 February 2025

姑娘说,要有数组。

import { ref } from 'vue'

const hers_fancy_integers = ref([1, 3, 5, 7, 9, 2, 4, 6, 8, 10])

使用数组:

hers_fancy_integers.value

姑娘发现,使用ref之物,读取它的值需要借助value。

如若直 …

Par 纳兰风来, Catégorie : 25-003

Lire la suite …

Vue 3中制作自己的组件

Le Sat 22 February 2025

组件是可以多次重复使用的Vue代码。制作好自己的组件后,遇到相同的功能时,调用组件即可,不需要再重复组件的代码内容。

组 …

Par 纳兰风来, Catégorie : 25-003

Lire la suite …

Grid组件在采用了Vue 3框架的应用中的用法

Le Sat 22 February 2025

首选要有个grid组件。

<!-- gridTitle:宫格名称 gridNum: 一行展示格数 gridList:宫格数据 @click:宫格点击按钮 -->

<ccGridButton gridTitle="九宫格" gridNum="3" :gridList="gridList" @click="gridClick"></ccGridButton>

<!-- gridTitle:宫格名称 gridNum: 一行 …

Par 纳兰风来, Catégorie : 25-003

Lire la suite …

gwhois包在Ubuntu系统中的安装及使用

Le Mon 17 February 2025

apt update
apt install gwhois -y

用法:

gwhois DOMAIN
# gwhois devgirl.xyz
Process query: 'devgirl.xyz'


No lookup service available for your query 'devgirl.xyz'.
gwhois remarks: If this is a valid domainname or handle, please file a bug report.




-- 
  To resolve one of the above handles:   OTOH offical …

Par 纳兰风来, Catégorie : tools

Lire la suite …

whois包在Ubuntu系统中的安装及使用

Le Mon 17 February 2025

apt update
apt install whois

用法:

whois DOMAIN
# whois devgirl.xyz
Domain Name: DEVGIRL.XYZ
Registry Domain ID: D461698014-CNIC
Registrar WHOIS Server: whois.dnspod.com
Registrar URL: http://www.dnspod.cn
Updated Date: 2024-06-22T14:03:50.0Z
Creation Date: 2024-06-08T02:03:56.0Z
Registry Expiry Date: 2025 …

Par 纳兰风来, Catégorie : tools

Lire la suite …

将Python venv目录放置在/tmp目录下

Le Mon 17 February 2025

查看磁盘分区分布:

# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay         3.3G  1.7G  1.5G  53% /
overlay         689G  446G  216G  68% /run
tmpfs            64M     0   64M   0% /dev
tmpfs            10M  4.0K   10M   1% /.PlnPyKFp4CRfFtgC1_run
shm              64M   96K   64M   1% /dev …

Par 纳兰风来, Catégorie : python

Lire la suite …

diff趣闻

Le Mon 17 February 2025

妹妹你看: - 九十九只幺蛾子,扎在代码堆 - 九十九只幺蛾子,扎在代码堆 - 不抓一只,怎显威名 - 一百二十七只幺蛾子,扎在代码堆 …

Par 纳兰风来, Catégorie : story

Lire la suite …

diff文件比较工具体验

Le Mon 17 February 2025

diff是文件比较工具,可以逐行比较两个纯文本文件。

diff的输出有三种形式:

  • normal 默认输出方式
  • context 会输出修改过部分的前后文,默认是前后3行。
  • unified 合并模式,把上下文 …

Par 纳兰风来, Catégorie : tools

Lire la suite …

自行部署Isso评论系统(服务器端)

Le Thu 13 February 2025

Isso是评论系统,可以自行部署服务器端,也可以使用第三方提供的服务。

此处自行搭建。

isso是Python程序,发布于PyPI,使用pip安装即可。

建立相关目录。

mkdir /opt/isso
mkdir /opt/isso …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

给Pelican驱动的博客添加上Isso评论系统

Le Thu 13 February 2025

Pelican是静态博客系统,Isso是评论系统。

要让Pelican支持Isso,需要一个支持Isso的Pelican主题。 如果主题不支持,则需要修改主题。

Pelican的默认主题是notmyidea,这个主题没有加入Isso的支持。

pelicanconf.py配置文件中加入:

ISSO_SERVER = "https://isso.example …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

my-ops

Le Thu 13 February 2025

my-ops主要记录一些日常运维操作。

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

CSS元素溢出问题

Le Wed 12 February 2025

页面中某个元素溢出时,会导致页面布局不协调。

这样的元素被称为ghost CSS elements。

body, html {
    overflow-x: hidden;
}

上述方案并不能解决实际问题。

使用 …

Par 纳兰风来, Catégorie : study-coding

Lire la suite …

APIFlask

Le Wed 12 February 2025

主页: https://apiflask.com GitHub: https://github.com/greyli/apiflask

APIFlask 在 Flask 的基础上添加了更多 Web API 相关的功能支持,核心特性包括:

更多方便的装饰器,比如 @app.input …

Par 纳兰风来, Catégorie : study-coding

Lire la suite …

FastAPI 和 Flask

Le Wed 12 February 2025

FastAPI 是基于 Web 框架 Starlette 添加了 Web API 功能支持的(框架之上的)框架,而后者是和 Starlette 同类的通用 Web 框架。

Par 纳兰风来, Catégorie : study-coding

Lire la suite …

让页面中丢失的图片展示为特定图片(使用 HTML、JavaScript、Flask 或 Nginx)

Le Wed 12 February 2025

页面展示图片时,若图片不存在,通常需要展示一个兜底图片。

本文设:

  • 图片路径为 /imgs
  • 默认图片为 /imgs/default.jpg

现有几种方案,择一 …

Par 纳兰风来, Catégorie : study-coding

Lire la suite …

Study Coding

Le Wed 12 February 2025

Par 纳兰风来, Catégorie : study-coding

Lire la suite …

几个相册程序

Le Wed 12 February 2025

Cloud Studio操作系统使用Ubuntu。

Ubuntu Focal Fossa (20.04 LTS) 有几个用于生成web相册的程序,它们分别是: album、cthumb、fgallery。

album和cthumb是Perl写的脚本。fgallery暂时不知道是什么语言写的。

经过试用,album和fgallery都可以正常使用。

cthumb不能正常使用。cthumb可以输出版本号和帮助信息,但生成相册时,会出现各种Perl语言错误信息。

日常使用中 …

Par 纳兰风来, Catégorie : software

Lire la suite …

Cloud Studio的几个版本

Le Wed 12 February 2025

Cloud Studio的功能

Cloud Studio提供的功能有:

  • 基本的Visual Studio Code功能。包括文件资源管理器、编辑器、终端集成、插件等。
  • 终端。提供有bash、zsh、fish等终端。
  • *SSH访问。可以通过SSH访问。注意:据观察仅仅 …

Par 纳兰风来, Catégorie : software-as-a-service

Lire la suite …

Cloud Studio链接

Le Wed 12 February 2025

https://ide.cloud.tencent.com/

https://cloudstudio.net/ https://cloudstudio.net/t https://docs.qq.com/aio/DRUFZcHVvZlJuY3l2

Par 纳兰风来, Catégorie : software-as-a-service

Lire la suite …

gallery-dl - Command-line program to download image galleries and collections from several image hosting sites

Le Wed 12 February 2025

gallery-dl是个Python程序。

Supported Sites

Consider all listed sites to potentially be NSFW.

https://github.com/mikf/gallery-dl/blob/master/docs/supportedsites.md

Par 纳兰风来, Catégorie : software

Lire la suite …

Study Ops

Le Wed 12 February 2025

Par 纳兰风来, Catégorie : study-ops

Lire la suite …

dpkg --listfiles用法

Le Fri 07 February 2025

dpkg --listfiles some-pkg

# or
dpkg -L some-pkg

列出已经安装的某个包的所拥有的文件列表。

比如列出nginx-light的文件列表:

root@ws-cfkazs-0 /workspace# dpkg -L nginx-light
/.
/usr
/usr/sbin
/usr/sbin/nginx
/usr/share
/usr/share/doc
/usr/share …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

产生certbot请求命令行

Le Fri 07 February 2025

代码:

def gen_certbot_req(domains):
    print("certbot certonly --webroot -w /srv/acme-challenge \\")
    for domain in domains:
        if domain:
            print("-d {} \\".format(domain))
    print("")

用法:

labels = """
backend
web
mobile
lang
java
python
ai
aigc
bigdata
database
algo
av
cloudnative
cloud
advanced
opensource
ops
server
os
hardware
embedded
microsoft
softwareengineering
test …

Par 纳兰风来, Catégorie : my-coding

Lire la suite …

产生Zone文件

Le Fri 07 February 2025

$ORIGIN wildberg.icu.

; CNAME records
new.51ctoposts            600   IN  CNAME   51ctoposts.wildberg.icu.;
program.51ctoposts            600   IN  CNAME   51ctoposts.wildberg.icu.;
aigc.51ctoposts            600  IN  CNAME   51ctoposts.wildberg.icu.;
web.51ctoposts            600   IN  CNAME   51ctoposts.wildberg.icu.;
database.51ctoposts            600  IN  CNAME   51ctoposts.wildberg.icu.;
mobile.51ctoposts            600    IN  CNAME …

Par 纳兰风来, Catégorie : my-coding

Lire la suite …

/tmp目录及其持久性

Le Fri 07 February 2025

一些工作空间启动时,不会挂载/tmp目录。

  /workspace df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay         3.3G  305M  2.8G  10% /
overlay         985G  332G  613G  36% /run
tmpfs            64M     0   64M   0% /dev
tmpfs            10M  4.0K   10M …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

启动博客

Le Thu 06 February 2025

创建python ven环境。仅需创建一次。

python -m venv myenv

启用python venv环境。需要在每次使用fish shell时启用。

source myenv/bin/activate.fish

安装pelican

pip install pelican markdown

使用pelican-quickstart创建博客

(myenv) root@ws-cfkazs-0 /workspace# pelican-quickstart 
Welcome to pelican-quickstart …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

站点证书观测

Le Thu 06 February 2025

https://crt.sh?q=cloudstudio.icu

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

磁盘空间

Le Thu 06 February 2025

  /workspace df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay         3.3G  293M  2.8G  10% /
tmpfs            10M  4.0K   10M   1% /.PlnPyKFp4CRfFtgC1_run
overlay         689G  396G  258G  61% /tmp
tmpfs            64M     0   64M   0% /dev
shm              64M   84K   64M   1% /dev/shm
cgroup          1.0M     0  1.0M   0 …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

Site Domains

Le Thu 06 February 2025

主站域名:

  • cloudstudio.icu
  • www.cloudstudio.icu

博客站域名:

  • blog.cloudstudio.icu

文件托管域名:

  • p.cloudstudio.icu

Cloud Studio跳转域名:

  • costs.cloudstudio.icu
  • dash.cloudstudio.icu
  • docs.cloudstudio.icu

腾讯云跳转域名:

  • coding.cloudstudio.icu
  • dns.cloudstudio.icu …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

Nginx之安装

Le Thu 06 February 2025

(myenv) root@ws-cfkazs-0 /workspace# cat /etc/debian_version 
bullseye/sid
(myenv) root@ws-cfkazs-0 /workspace# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"
(myenv) root@ws-cfkazs-0 /workspace# 
apt update
apt install nginx-light

debian系统中,有nginx-light,nginx-full,nginx-extras三个包。

三个包的不同在 …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

nginx start

Le Thu 06 February 2025

nginx

html目录位于/var/www/html

(myenv) root@ws-cfkazs-0 /workspace [0|1]# ls /var/www/html
blog.cloudstudio.icu.zip  blog.cloudstudio.icu.zip.md5  cloudstudio.icu.zip  cloudstudio.icu.zip.md5  index.nginx-debian.html

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

nginx stop

Le Thu 06 February 2025

用pkill命令停止nginx

pkill nginx

nginx的停止命令

(myenv) root@ws-cfkazs-0 /workspace# nginx -s stop
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

nginx的退出命令

(myenv) root@ws-cfkazs-0 /workspace [0|1]# nginx -s quit
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

WARNING Docutils has no localization for 'zh'. Using 'en' instead. readers.py:205

Le Thu 06 February 2025

编译pelican项目时,出现如下提示:

[11:31:04] WARNING  Docutils has no localization for 'zh'. Using 'en' instead.                                                                                                    readers.py:205

阅读pelican reader.py代码

from docutils.parsers.rst.languages import get_language as get_docutils_lang

#...

class RstReader(BaseReader):

    #...

    def __init__(self, *args, **kwargs):
        super().__init__(*args …

Par 纳兰风来, Catégorie : my-coding

Lire la suite …

申请TLS证书

Le Thu 06 February 2025

以webroot方式申请证书。

sudo certbot certonly --webroot \
  -w /srv/acme-challenge/ \
  \
-d cloudstudio.icu \
-d blog.cloudstudio.icu \
-d coding.cloudstudio.icu \
-d costs.cloudstudio.icu \
-d dash.cloudstudio.icu \
-d dns.cloudstudio.icu \
-d docs.cloudstudio.icu \
-d domain.cloudstudio.icu \
-d lighthouse.cloudstudio.icu \
-d p.cloudstudio.icu \
-d tls …

Par 纳兰风来, Catégorie : my-ops

Lire la suite …

lscpu输出信息

Le Tue 04 February 2025

输入命令:

lscpu

输出信息:

Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          16
On-line CPU(s) list:             0-15
Thread(s) per core:              1
Core(s) per socket …

Par 纳兰风来, Catégorie : lsinfo

Lire la suite …

BeautifulSoup

Le Mon 03 February 2025

Python 爬虫(Web Scraping)是指通过编写 Python 程序从互联网上自动提取信息的过程。

爬虫的基本流程通常包括发送 HTTP 请求获取网页内容 …

Par 纳兰风来, Catégorie : dev

Lire la suite …

CppCMS - C++ Web Framework.

Le Mon 03 February 2025

http://cppcms.com/wikipp/en/page/main

CppCMS — High Performance C++ Web Framework What is CppCMS? CppCMS is a Free High Performance Web Development Framework (not a CMS) aimed at Rapid Web Application Development. It differs from most other web development frameworks like: Python Django, Java Servlets in the following …

Par 纳兰风来, Catégorie : frameworks

Lire la suite …

crow

Le Mon 03 February 2025

Crow is very fast and easy to use C++ micro web framework (inspired by Python Flask)

https://crowcpp.org/master/ https://github.com/CrowCpp/Crow A Fast and Easy to use microframework for the web.

Par 纳兰风来, Catégorie : github-repos

Lire la suite …

Dev Girl

Le Mon 03 February 2025

Dev Girl网站的内容,是札记,是书写代码的札记,也是欣赏美女的札记。

书写代码和欣赏美女,效果殊途同归:赏心悦目。

Par 纳兰风来, Catégorie : devgirl

Lire la suite …

facil

Le Mon 03 February 2025

https://facil.io/0.7.x/fiobj_mustache

facil.io - The C Web Application Framework

https://facil.io/

Par 纳兰风来, Catégorie : frameworks

Lire la suite …

hiberlite

Le Mon 03 February 2025

https://github.com/paulftw/hiberlite

C++ ORM for SQLite

C++ object-relational mapping with API inspired by the awesome Boost.Serialization - that means almost no API to learn.

Par 纳兰风来, Catégorie : github-repos

Lire la suite …

imutils

Le Mon 03 February 2025

https://github.com/PyImageSearch/imutils

A series of convenience functions to make basic image processing functions such as translation, rotation, resizing, skeletonization, and displaying Matplotlib images easier with OpenCV and both Python 2.7 and Python 3.

For more information, along with a detailed code review check out the following …

Par 纳兰风来, Catégorie : github-repos

Lire la suite …

kore

Le Mon 03 February 2025

https://kore.io/ https://docs.kore.io/4.2.0/api/json.html

Kore is a web application platform for writing scalable, concurrent web based processes in C or Python.

It is built with a "secure by default" approach. It is fully privilege separated while using strong security features at …

Par 纳兰风来, Catégorie : frameworks

Lire la suite …

libonion

Le Mon 03 February 2025

Lightweight C library to add web server functionality to your program

https://www.coralbits.com/libonion/

https://github.com/davidmoreno/onion

Par 纳兰风来, Catégorie : library

Lire la suite …

Lwan

Le Mon 03 February 2025

https://lwan.ws/ https://github.com/lpereira/lwan

Lwan is a high-performance & scalable web server.

Requests per second vs. number of concurrent connections?

performance-chart Hello, World! (C) 100B file Hello, World! (LuaJIT) 32KiB file Lwan was until recently just a personal research effort that focused mostly on building a solid …

Par 纳兰风来, Catégorie : frameworks

Lire la suite …

Oat++

Le Mon 03 February 2025

https://oatpp.io/

An Open Source C++ Web Framework

https://github.com/oatpp/oatpp

🌱Light and powerful C++ web framework for highly scalable and resource-efficient web application. It's zero-dependency and easy-portable.

Par 纳兰风来, Catégorie : frameworks

Lire la suite …

Pistache

Le Mon 03 February 2025

An elegant C++ REST framework.

https://pistacheio.github.io/pistache/

https://github.com/pistacheio/pistache

Par 纳兰风来, Catégorie : frameworks

Lire la suite …

Python语言中,元组、字典、列表的序列化与反序列化

Le Mon 03 February 2025

序列化是指把Python的对象编码转化为JSON格式的字符串;反过来,反序列化是是把JSON格式的字符串解码为Python数据对象。

Python专门提供了JSON库来处理序列化和反序列化。

把内置数据结构如元组、字典、列表进行序列化处理后,类型为str(字符串),经过 …

Par 纳兰风来, Catégorie : dev

Lire la suite …

Python元组序列化

Le Mon 03 February 2025

序列化是指把Python的对象编码转化为JSON格式的字符串;反过来,反序列化是是把JSON格式的字符串解码为Python数据对象。

Python专门提供了JSON库来处理序列化和反序列化。

把内置数据结构如元组、字典、列表进行序列化处理后,类型为str(字符串)。

元组 …

Par 纳兰风来, Catégorie : dev

Lire la suite …

simdb

Le Mon 03 February 2025

https://github.com/LiveAsynchronousVisualizedArchitecture/simdb

A high performance, shared memory, lock free, cross platform, single file, no dependencies, C++11 key-value store

Par 纳兰风来, Catégorie : github-repos

Lire la suite …

sophia

Le Mon 03 February 2025

https://github.com/pmwkaa/sophia

Modern transactional key-value/row storage library.

Sophia is RAM-Disk hybrid storage. It is designed to provide best possible on-disk performance without degradation in time. It has guaranteed O(1) worst case complexity for read, write and range scan operations.

It adopts to expected write rate …

Par 纳兰风来, Catégorie : github-repos

Lire la suite …

语法糖和语法盐

Le Mon 03 February 2025

语法糖(Syntactic sugar),英国计算机科学家彼得·兰丁发明的术语,指计算机程序设计语言中添加的某种语法,这种语法对语言的功能 …

Par 纳兰风来, Catégorie : dev

Lire la suite …

treefrogframework

Le Mon 03 February 2025

https://www.treefrogframework.org/

High-speed C++ MVC Framework for Web Application

Small but Powerful and Efficient TreeFrog Framework is a high-speed and full-stack C++ framework for developing Web applications, which supports HTTP and WebSocket protocol.

Web applications can run faster than that of scripting language because the server-side framework was …

Par 纳兰风来, Catégorie : frameworks

Lire la suite …

关系代数表达式

Le Sun 02 February 2025

关系代数用于描述数据库中数据之间的操作。

关系代数运算有选择(σ)、投影(π)、连接(⨝)等。

投影(π)运算,只从数据库中筛选特定 …

Par 纳兰风来, Catégorie : databases

Lire la suite …

陶喜乐 秀人XIUREN No.1705 陶喜乐_lele 写真 (70P)

Le Thu 01 August 2024

乐乐开心,我也开心。

陶喜乐

陶喜乐

Par 纳兰风来, Catégorie : girl

Lire la suite …

小白兔 福利COS 阳光美少女萌芽儿o0 - 恶毒白兔 写真 (54P)

Le Fri 05 July 2024

这么翘的屁股,爱了爱了。

小白兔

小白兔

Par 纳兰风来, Catégorie : girl

Lire la suite …