<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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>ubuntu,debian,redhat -linuxany.com &#187; import</title>
	<atom:link href="http://www.linuxany.com/archives/tag/import/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxany.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 08:59:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Python 动态加载模块的3种方法</title>
		<link>http://www.linuxany.com/archives/1563.html</link>
		<comments>http://www.linuxany.com/archives/1563.html#comments</comments>
		<pubDate>Fri, 10 Jun 2011 04:52:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[hasattr]]></category>
		<category><![CDATA[import]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1563</guid>
		<description><![CDATA[1，使用系统函数__import_() stringmodule = __import__('string') 2,使用imp 模块 import imp stringmodule = imp.load_module('string',*imp.find_module('string')) 3,使用exec import_string = &#34;import string as stringmodule&#34; exec&#160;import_string 变量是否存在 1,hasattr(Test,'t') 2, 'var'&#160;&#160; in&#160;&#160; locals().keys() 3,'var'&#160;&#160; in&#160;&#160; dir() 4,vars().has_key('s') 您还可能感兴趣的内容在Debian上安装SVNPython: 导入中文模块]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1563.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Debian上安装SVN</title>
		<link>http://www.linuxany.com/archives/1246.html</link>
		<comments>http://www.linuxany.com/archives/1246.html#comments</comments>
		<pubDate>Fri, 16 Apr 2010 01:54:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Java/jsp]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[checkout]]></category>
		<category><![CDATA[htpasswd]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[subersion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnadmin]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1246</guid>
		<description><![CDATA[版本信息： Debain: 5.0 Kernel: 2.6.26-1-686 Subversion: 1.5.6 Apache: 2.2.11 服务端： 1、安装 apt-get install subversion subversion-toolsapt-get install apache2 libapache2-svn 2、项目 mkdir /opt/linuxany -psvnadmin create /opt/linuxany/test1svnadmin create /opt/linuxany/test2 3、配置 1)vi /etc/apache2/httpd.conf #注意以下2行可能已在apache2中有配置了，如果restart时候发现错误，则注释掉即可LoadModule dav_svn_module modules/mod_dav_svn.soLoadModule authz_svn_module modules/mod_authz_svn.so#svn连接到服务器后的根目录，即/等同于/opt/linuxany(例如：svn list http://IP/test1)；若此处为/svn，则/svn等同于/opt/linuxany(例如：svn list http://IP/svn/test1)[Location /] DAV svnSVNParentPath /opt/linuxany #[项目根目录]AuthzSVNAccessFile /opt/linuxany/authz.conf #[用户权限配置文件]AuthType BasicAuthName &#34;Subversion.zoneyump&#34;AuthUserFile /opt/linuxany/authfile #[用户密码配置文件]Require valid-user[/Location] 2)vi /opt/linuxany/authz.conf [test1:/]&#160; &#160; #[/opt/linuxany/test1下所有文件及目录]* [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1246.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python: 导入中文模块</title>
		<link>http://www.linuxany.com/archives/371.html</link>
		<comments>http://www.linuxany.com/archives/371.html#comments</comments>
		<pubDate>Wed, 20 Aug 2008 13:20:55 +0000</pubDate>
		<dc:creator>x72</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[import]]></category>

		<guid isPermaLink="false">http://www.linuxlaptop.cn/?p=395</guid>
		<description><![CDATA[“切片 是一个非常有用的概念，其一般形式为 l[start:end:step]，其中 start 和 end 分别是开始和结束索引，step 是在切片时要跨过的条目数量。此外，还可以对结束索引使用负值，即从序列的结尾往回计数。另一个有用的功能是以一种很合适的方式处理错误（如超过序列的长度）。如前一个例子所示，您还可以选择忽略切片中使用的三个值中的一个或多个值。例如，我在切片 l[0::2] 中没有使用结束索引。” 反转一个字符串 &#62;&#62;&#62; s='abcde'&#62;&#62;&#62; t=s[::-1]&#62;&#62;&#62; t'edcba'&#62;&#62;&#62; 这是List的切片方法,探索 Python 类型的层次结构一位中的介绍： ChinaUnix上的 使用__import__()导入模块 例如：测试.py模块 def foo():print 'Hello' 导入方法：直接test=__import__(&#8216;测试&#8217;) 即可 &#62;&#62;&#62; test=__import__('测试')&#62;&#62;&#62; test&#60;module '测试' from 'D:\home\w\py\mypy\测试.py'&#62;&#62;&#62;&#62; test.foo()Hello&#62;&#62;&#62; 在IDLE的Python Shell下面一般是中文gb2312编码 XP的中文系统 一般也是Gb2312编码，这是可以直接使用__import__(&#8216;测试&#8217;)导入。 但是IDLE编辑器有时不是使用GB2312编码，我一般设置为utf-8，这时需要转换一下 假设为utf-8编码： name=u&#8217;测试&#8217;.encode(&#8216;gb2312&#8242;) test=__import__(name) 即可。然后使用test引用模块中的内容。 您还可能感兴趣的内容Python 进行DNS解析监控Python 时间戳转换Python 邮件模块小应用Python表单和常用数据验证Python 动态加载模块的3种方法]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/371.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

