<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="rss.xsl" media="screen"?>
<rss version="2.0">
  <channel>
    <title>星辰.Net技术社区论坛 - Python</title>
    <link>http://www.netcsharp.cn/showforum-38.aspx</link>
    <description>Latest 20 threads</description>
    <copyright>Copyright (c) 星辰.Net技术社区论坛</copyright>
    <generator>Discuz!NT</generator>
    <pubDate>Fri, 21 Nov 2008 17:28:14 GMT</pubDate>
    <ttl>60</ttl>
    <item>
      <title>Python基础教程(12) - 条件判断的缩写</title>
      <description><![CDATA[开始以为Python中没有像其他语言一样的条件判断的缩写形式：
return (1==1) ? &amp;quot;is easy&amp;quot; : &amp;quot;my god&amp;quot; //C#中的用法

其实，在Python中，是这样写的：
print (1==2) and 'Fool' or 'Not bad'......]]></description>
      <link>http://www.netcsharp.cn/showtopic-1570.aspx</link>
      <category>Python</category>
      <author>neptune</author>
      <pubDate>Mon, 13 Oct 2008 11:31:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(11) - 大小写转换以及判断</title>
      <description><![CDATA[转换大小写和其他语言一样，Python为string对象提供了转换大小写的方法：upper() 和lower()。还不止这些，Python还为我们提供了首字母大写，其余小写的capitalize()方法，以及所有单词首字母大写，其余小写的title()方法。函数较简单，看下面的例子：
http://www.cnblogs.com/Images/OutliningIndicators/None.g]]></description>
      <link>http://www.netcsharp.cn/showtopic-1523.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Mon, 06 Oct 2008 10:29:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(10) - 除法小技巧</title>
      <description><![CDATA[Python中将两个整数相除，默认结果是为整数的。但我们可以通过下面的方法，使得两个整数相除的结果为小数。
from __future__ import division



print 7/3

输出结果：
2.3333333333]]></description>
      <link>http://www.netcsharp.cn/showtopic-1438.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Mon, 15 Sep 2008 12:37:00 GMT</pubDate>
    </item>
    <item>
      <title>Python中的函数和方法装饰漫谈(Function decorator)</title>
      <description><![CDATA[装饰方法的产生：Python2.2通过增加静态方法和类方法扩展了Python的对象模型。但是当时没有提供一个简化的语法去定义static/class方法，只得在定义好的方法尾部去调用staticmethod()/classmethod()方法达到目的。例如：class C:

   def meth (cls):

   meth = classmethod(meth)   # 使meth]]></description>
      <link>http://www.netcsharp.cn/showtopic-1351.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Sun, 31 Aug 2008 00:52:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(9) - translator</title>
      <description><![CDATA[1.string.maketrans设置字符串转换规则表(translation table)allchars = string.maketrans('', '')#所有的字符串，即不替换字符串

   aTob = string.maketrans('a','b')#将字符a转换为字符b

2.translate函数进行字符串的替换和删除，第一个参数是字符串转换规则表(translati]]></description>
      <link>http://www.netcsharp.cn/showtopic-1344.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Fri, 29 Aug 2008 00:39:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(8) - 字符串中的字符倒转</title>
      <description><![CDATA[方法一，使用：s = 'python'

print s

方法二，使用reverse()方法：l = list(s)

l.reverse()

print ''.join(l)

输出结果：
nohtyp
nohtyp]]></description>
      <link>http://www.netcsharp.cn/showtopic-1330.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Wed, 27 Aug 2008 07:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(7) - 连接字符串(join %)</title>
      <description><![CDATA[join 方法用于连接字符串数组s = 

print ''.join(s)

print '-'.join(s)

输出结果：
abcd
a-b-c-d
使用 % 连接多个变量a = 'hello'

b = 'python'

c = 1

print '%s %s %s %s' % (a, b, c, s)

......]]></description>
      <link>http://www.netcsharp.cn/showtopic-1315.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Sat, 23 Aug 2008 17:37:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(6) - strip lstrip rstrip</title>
      <description><![CDATA[Python中的strip用于去除字符串的首位字符，同理，lstrip用于去除左边的字符，rstrip用于去除右边的字符。这三个函数都可传入一个参数，指定要去除的首尾字符。注意的是，传入的是一个字符数组，编译器去除两端所有相应的字符，直到没有匹配的字符，比如：

theString = 'saaaay yes no yaaaass'

print theString.strip('say']]></description>
      <link>http://www.netcsharp.cn/showtopic-1307.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Thu, 21 Aug 2008 21:44:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(5) - ljust rjust center</title>
      <description><![CDATA[Python中打印字符串时可以调用ljust（左对齐），rjust（右对齐），center（中间对齐）来输出整齐美观的字符串，使用起来非常简单，包括使用第二个参数填充（默认为空格）。看下面的例子就会明白了：
print '|','*'.ljust(10),'|'

print '|','*'.ljust(10,'-'),'|'

print '|','*'.rjust(10,'-'),']]></description>
      <link>http://www.netcsharp.cn/showtopic-1299.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Mon, 18 Aug 2008 18:27:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(4) - isinstance判断对象类型</title>
      <description><![CDATA[Python中判度对象类型方法非常简单，不需要像别的语言一样使用如下的判断方法：

if (typeof(objA) == typeof(String))

{

    //TODO

}

在Python中只需要使用内置的函数isinstance，使用起来非常简单，......]]></description>
      <link>http://www.netcsharp.cn/showtopic-1235.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Wed, 16 Jul 2008 20:34:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(3) - 字符转换</title>
      <description><![CDATA[Python提供了ord和chr两个内置的函数，用于字符与ASCII码之间的转换。如：&amp;gt;&amp;gt;&amp;gt; print ord('a')

97

&amp;gt;&amp;gt;&amp;gt; print chr(97)

a下面我们可以开始来设计我们的大小写转换的程序了：

#!/usr/bin/env python

#coding=utf-8



def UCaseChar(c]]></description>
      <link>http://www.netcsharp.cn/showtopic-1206.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Wed, 09 Jul 2008 12:06:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(2) - 字符遍历</title>
      <description><![CDATA[通常我们要遍历一个字符串中的每个字符，都要先获取字符串的长度，然后用一个For循环把每个字符取出，进行处理。但是，又是我们的Python，为我们提供了很多便捷的方式去遍历一个字符串中的字符。比如，将一个字符串转换为一个字符数组：theList = list(theString)同时，我们可以方便的通过for语句进行遍历：for c in theString:
do_something_with(]]></description>
      <link>http://www.netcsharp.cn/showtopic-1198.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Sun, 06 Jul 2008 11:14:00 GMT</pubDate>
    </item>
    <item>
      <title>Python基础教程(1)--交换变量</title>
      <description><![CDATA[Python中交换变量不需要临时变量,如：a, b, c = b, c, a来个复杂一点的例子，再来一顿家喻户晓的“冒泡排序”吧：array = 
for i in range(len(array) - 1, 1, -1):
for j in range(0, i):
if array &amp;gt; array:
array, array = array, array
print array]]></description>
      <link>http://www.netcsharp.cn/showtopic-1193.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Sat, 05 Jul 2008 02:21:00 GMT</pubDate>
    </item>
    <item>
      <title>Python中的名称绑定</title>
      <description><![CDATA[python中的name binding是非常好玩的，有意思。
大家还不知道什么叫name binding吧，就是假如你叫 “超人”， 然后超人就绑定到了你这个对象上，这个就是name binding了。
比如

  代码:a = 1
这个的意思就是把a 绑定到了对象 1 上面。而a的类型就是number了。
再看一个例子

  代码:  a = 
a也绑定到了对象上面。可以这么]]></description>
      <link>http://www.netcsharp.cn/showtopic-850.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Tue, 13 May 2008 14:08:00 GMT</pubDate>
    </item>
    <item>
      <title>Python中根据类名生成类</title>
      <description><![CDATA[在python中和.net一样可以根据类名来动态生成类的实例，但是比.net更方便，下面的例子使用python2.4的idle的IDE环境， 
.py文件代码如下： 
class Employee:  
    def __init__(self,name,age,address):  
        print 'name   :',name  
        print 'age]]></description>
      <link>http://www.netcsharp.cn/showtopic-824.aspx</link>
      <category>Python</category>
      <author>star65225692</author>
      <pubDate>Thu, 08 May 2008 17:23:00 GMT</pubDate>
    </item>
    <item>
      <title>Python写的代码行数统计程序</title>
      <description><![CDATA[主要的python脚本文件LineCount.py的内容如下：
http://www.cnblogs.com/Images/OutliningIndicators/None.gifimport sys;
http://www.cnblogs.com/Images/OutliningIndicators/None.gifimport os;
http://www.cnblogs.com/Ima]]></description>
      <link>http://www.netcsharp.cn/showtopic-823.aspx</link>
      <category>Python</category>
      <author>star65225692</author>
      <pubDate>Thu, 08 May 2008 17:12:00 GMT</pubDate>
    </item>
    <item>
      <title>中文Python FAQ</title>
      <description><![CDATA[1. Python一般介绍

Python(发音:)，是一种面向对象的解释性的计算机程序设计语言，也是一种功能强大而完善的通用型语言，已经具有十多年的发展历史，成熟且稳定。Python具有脚本语言中最丰富和强大的类库，足以支持绝大多数日常应用。 


这种语言具有非常简捷而清晰的语法特点，适合完成各种高层任务，几乎可以在所有的操作系统中运行。 


目前，基于这种语言的相关技术正在]]></description>
      <link>http://www.netcsharp.cn/showtopic-822.aspx</link>
      <category>Python</category>
      <author>admin</author>
      <pubDate>Thu, 08 May 2008 17:04:00 GMT</pubDate>
    </item>
  </channel>
</rss>