<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:media="http://search.yahoo.com/mrss/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Python - 四号程序员</title>
	<atom:link href="https://www.coder4.com/archives/tag/python/feed" rel="self" type="application/rss+xml" />
	<link>https://www.coder4.com</link>
	<description>Keep It Simple and Stupid</description>
	<lastBuildDate>Tue, 16 Jul 2024 10:46:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Ubuntu 24.04使用python虚拟环境</title>
		<link>https://www.coder4.com/archives/8185</link>
					<comments>https://www.coder4.com/archives/8185#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Tue, 16 Jul 2024 10:46:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[venv]]></category>
		<category><![CDATA[虚拟环境]]></category>
		<guid isPermaLink="false">https://www.coder4.com/?p=8185</guid>

					<description><![CDATA[新版Python不再建议直接pip安装了，而是要使用虚拟环境 sudo apt install -y python3-dev python3-virtualenv 创建虚拟环境 virtualenv newenv source newenv/bin/activate # 取消激活 deactivate &#160;[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/8185/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MobileNetV3的oxxruntime推理(Python)</title>
		<link>https://www.coder4.com/archives/8175</link>
					<comments>https://www.coder4.com/archives/8175#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Fri, 07 Jun 2024 11:25:01 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[onnx]]></category>
		<category><![CDATA[推理]]></category>
		<guid isPermaLink="false">https://www.coder4.com/?p=8175</guid>

					<description><![CDATA[import cv2 import numpy as np import onnxruntime as ort def load_model(model_path): """加载ONNX模型""" session = ort.InferenceSession(model_path) return session def preprocess_image(image_path): image = cv2.imread(image_path)[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/8175/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>使用nuitka将Python文件编译成可执行程序</title>
		<link>https://www.coder4.com/archives/6569</link>
					<comments>https://www.coder4.com/archives/6569#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Thu, 25 Jul 2019 12:08:28 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[nuitka]]></category>
		<category><![CDATA[可执行]]></category>
		<guid isPermaLink="false">https://www.coder4.com/?p=6569</guid>

					<description><![CDATA[安装 sudo pip3 install nuitka 编译成可执行程序 python3 -m nuitka --standalone --follow-imports ./test.py 会生成一个test.dist的目录，把整个目录拷贝上去，就可以执行了。 需要说明的是，现在nuitka不支持静态链接，所以如果glibc相关库对不上的话，也是没法执行的，建议安装个同版本的系统(docker即可)，去编译下就好。[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/6569/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>gevent中与&quot;线程&quot;相关的几个例子</title>
		<link>https://www.coder4.com/archives/4449</link>
					<comments>https://www.coder4.com/archives/4449#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Fri, 27 Feb 2015 10:54:40 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Gevent]]></category>
		<category><![CDATA[greenlet]]></category>
		<category><![CDATA[线程池]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4449</guid>

					<description><![CDATA[标题虽然说是线程，其实gevent用的是“greenlet”，可能翻译成"微线程"更合适一些。 1、线程池 import time import gevent from gevent.threadpool import ThreadPool def my_func(text, num): print text, num pool = ThreadPool(100) start = time.time() for i in xrange(100000):[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4449/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Python中使用 词典+可变参数 简化 初始化+配置 工作</title>
		<link>https://www.coder4.com/archives/4431</link>
					<comments>https://www.coder4.com/archives/4431#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Tue, 17 Feb 2015 02:54:16 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[dict]]></category>
		<category><![CDATA[初始化]]></category>
		<category><![CDATA[参数]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4431</guid>

					<description><![CDATA[在Python中，是支持可变长参数，甚至词典参数的，具体见 《Python中函数的参数传递与可变长参数》 而使用词典参数的方式，可以让我们节省很多不必要的初始化工作。 以初始化MySQL的conn为例： Before： # App Config DB_HOST = "localhost" DB_PORT = 3306 DB_NAME = "db" DB_USER = "coder4" DB_PASS = "password" # Init conn sel[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4431/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Python中使用selenium抓取Javascript动态页面</title>
		<link>https://www.coder4.com/archives/4426</link>
					<comments>https://www.coder4.com/archives/4426#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Sun, 15 Feb 2015 09:53:05 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[动态]]></category>
		<category><![CDATA[抓取]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4426</guid>

					<description><![CDATA[selenium是一套用于测试WebUI的自动化测试框架，它通过调用Chrome、Firefox来完成动态页面(含Javascript)的加载，因此也可以用来完成动态网页抓取。 1、下载selenium wget http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar 2、启动selenium-standalone java -jar ./selenium-se[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4426/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Python抓取框架Scrapy快速入门教程</title>
		<link>https://www.coder4.com/archives/4411</link>
					<comments>https://www.coder4.com/archives/4411#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Fri, 13 Feb 2015 11:09:53 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Scrapy]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4411</guid>

					<description><![CDATA[Scrapy是一个非常好的抓取框架，它不仅提供了一些开箱可用的基础组建，还能够根据自己的需求，进行强大的自定义。本文对基本用法和常见问题做一个记录。 1、安装 Scrapy虽然是python的模块，但是依赖包比较多，所以我推荐使用apt安装： sudo apt-get install python-scrapy 编译狂人 或者 处女座 可以从Pypi上下载自行编译安装。友情提示下：pip或者ezsetup上的自动依赖是不全的，需要自己再补其他包。 本文所用的版本是当前最新版[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4411/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Python中函数的参数传递与可变长参数</title>
		<link>https://www.coder4.com/archives/4407</link>
					<comments>https://www.coder4.com/archives/4407#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Mon, 09 Feb 2015 04:43:47 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[参数]]></category>
		<category><![CDATA[变长]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4407</guid>

					<description><![CDATA[转载自：Python中函数的参数传递与可变长参数 1.Python中也有像C++一样的默认缺省函数 def foo(text,num=0): print text,num foo("asd") #asd 0 foo("def",100) #def 100 定义有默认参数的函数时，这些默认值参数位置必须都在非默认值参数后面。 调用时提供默认值参数值时，使用提供的值，否则使用默认值。 2.Python可以根据参数名传参数 def foo(ip,port)[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4407/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Python中使用pack/unpack编码字节数据</title>
		<link>https://www.coder4.com/archives/4374</link>
					<comments>https://www.coder4.com/archives/4374#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Mon, 12 Jan 2015 12:38:29 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[pack]]></category>
		<category><![CDATA[unpack]]></category>
		<category><![CDATA[字节数据]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4374</guid>

					<description><![CDATA[在Python中，是没有int, long这些c系的强类型的，但是有的时候，我们需要按照字节规则，生成这样的数据。 例如：生成一份网络序的，char+unsigned long数据(4+8字节)： from struct import pack pack('!BQ', 100, 1000) 'd\x00\x00\x00\x00\x00\x00\x03\xe8' 其中，第1个!表示为网络字节序。 BQ是占位符号，分别表示8bit的unsigned char和64bit的unsi[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4374/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Python Sort多值排序</title>
		<link>https://www.coder4.com/archives/4372</link>
					<comments>https://www.coder4.com/archives/4372#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Mon, 12 Jan 2015 12:18:53 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[多值]]></category>
		<category><![CDATA[排序]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=4372</guid>

					<description><![CDATA[假设使用lambda函数 s = sorted(s, key = lambda x: (x[1], x[2])) 如上所示，返回一个tuple，其中[0]是第1个排序key，[1]是第2个。[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/4372/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
