楼主: 牛尾巴
6594 86

【独家发布】【kindle】Python核心编程(第2版)   [推广有奖]

泰斗

38%

还不是VIP/贵宾

-

TA的文库  其他...

最新e书

2018新书

2017新书

威望
8
论坛币
628880 个
通用积分
56892.4593
学术水平
12683 点
热心指数
12959 点
信用等级
12448 点
经验
568600 点
帖子
9173
精华
66
在线时间
13139 小时
注册时间
2008-2-13
最后登录
2024-4-23

特级学术勋章 特级热心勋章 特级信用勋章 高级学术勋章 高级热心勋章 高级信用勋章

相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
如果喜欢该文档,欢迎订阅【kindle电子书】文库,https://bbs.pinggu.org/forum.php?mod=collection&action=view&ctid=3186

图书名称:Python核心编程(第2版)

作者:丘恩 (Wesley J.Chun) (作者), 宋吉广 (译者)

出版社:
人民邮电出版社
页数:654
出版时间:2016
                     
语言:中文

格式:mobi
内容简介:
《Python核心编程(第2版)》是经典的Python指导书,在首版的基础上进行了全面升级。全书分为两个部分:第1部分占据了大约三分之二的篇幅,阐释这门语言的“核心”内容,包括基本的概念和语句、语法和风格、Python对象、数字类型、序列类型、映射和集合类型、条件和循环、文件和输入/输出、错误和异常、函数和函数式编程、模块、面向对象编程、执行环境等内容:第2部分则提供了各种高级主题来展示可以使用Python做些什么,包括正则表达式、网络编程、网络客户端编程、多线程编程、图形用户界面编程、Web编程、数据库编程、扩展Python和一些其他材料。《Python核心编程(第2版)》适合Python初学者,以及已经入门但想继续学习和提高自身Python技巧的程序员。

回复免费:

本帖隐藏的内容

Python核心编程(第2版).mobi (30.24 MB)



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:python核心编程 python Kindle kind IND Alberto action

已有 1 人评分经验 论坛币 收起 理由
Nicolle + 100 + 100 精彩帖子

总评分: 经验 + 100  论坛币 + 100   查看全部评分

本帖被以下文库推荐

沙发
ryuuzt 发表于 2016-8-16 16:37:21 |只看作者 |坛友微信交流群
  1. from operator import add, sub
  2. from random import randint, choice

  3. ops = {'+': add, '-': sub}
  4. MAXTRIES = 2

  5. def doprob():
  6.     op = choice('+-')
  7.     nums = [ randint(1,10) for i in range(2) ]
  8.     nums.sort(reverse=True)
  9.     ans = ops[op](*nums)
  10.     pr = '%d %s %s = ' % (nums[0], op, nums[1])
  11.     oops = 0
  12.     while True:
  13.         try:
  14.             if int(raw_input(pr)) == ans:
  15.                 print 'correct'
  16.                 break
  17.             if oops == MAXTRIES:
  18.                 print 'sorry... the answer is\n%s%d' % (pr, ans)
  19.             else:
  20.                 print 'incorrect... try again'
  21.                 oops += 1
  22.         except (KeyboardInterrupt,
  23.                 EOFError, ValueError):
  24.             print 'invalid input... try again'

  25. def main():
  26.     while True:
  27.         doprob()
  28.         try:
  29.             opt = raw_input('Again? [y] ').lower()
  30.             if opt and opt[0] == 'n':
  31.                 break
  32.         except (KeyboardInterrupt, EOFError):
  33.             break

  34. if __name__ == '__main__':
  35.     main()
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 精彩帖子

总评分: 论坛币 + 20   查看全部评分

使用道具

藤椅
benji427 在职认证  发表于 2016-8-16 16:37:30 |只看作者 |坛友微信交流群
  1. #!/usr/bin/env python

  2. from urllib import urlretrieve

  3. def firstNonBlank(lines):
  4.     for eachLine in lines:
  5.         if not eachLine.strip():
  6.             continue
  7.         else:
  8.             return eachLine

  9. def firstLast(webpage):
  10.     f = open(webpage)
  11.     lines = f.readlines()
  12.     f.close()
  13.     print firstNonBlank(lines),
  14.     lines.reverse()
  15.     print firstNonBlank(lines),

  16. def download(url='http://www',
  17.             process=firstLast):
  18.     try:
  19.         retval = urlretrieve(url)[0]
  20.     except IOError:
  21.         retval = None
  22.     if retval:                # do some processing
  23.         process(retval)

  24. if __name__ == '__main__':
  25.     download()
复制代码

已有 1 人评分论坛币 收起 理由
Nicolle + 20 精彩帖子

总评分: 论坛币 + 20   查看全部评分

使用道具

板凳
gavinsxd 发表于 2016-8-16 17:15:08 |只看作者 |坛友微信交流群
  1. #!/usr/bin/env python

  2. def convert(func, seq):
  3.         'conv. sequence of numbers to same type'
  4.         return [func(eachNum) for eachNum in seq]

  5. myseq = (123, 45.67, -6.2e8, 999999999L)
  6. print convert(int, myseq)
  7. print convert(long, myseq)
  8. print convert(float, myseq)
复制代码

使用道具

报纸
ddinghzau 发表于 2016-8-16 17:51:04 |只看作者 |坛友微信交流群
  1. lass HotelRoomCalc:
  2.     'Hotel room rate calculator'
  3.    
  4.     def __init__(self, rt, sales=0.085, rm=0.1):
  5.         '''HotelRoolCalc default arguments:
  6.         sales tax == 8.5% and room tax == 10%'''
  7.         self.salesTax = sales
  8.         self.roomTax = rm
  9.         self.roomRate = rt

  10.     def calcTotal(self, days=1):
  11.         'Calculate total; default to daily rate'
  12.         daily = round((self.roomRate * \
  13.             (1 + self.roomTax + self.salesTax)), 2)
  14.         return float(days) * daily
复制代码

使用道具

地板
ccwwccww 发表于 2016-8-16 21:15:19 |只看作者 |坛友微信交流群
  1. #!/usr/bin/env python

  2. class MoneyFmt(object):
  3.     def __init__(self, value=0.0):                # constructor
  4.         self.value = float(value)

  5.     def update(self, value=None):                # allow updates
  6.         ###
  7.         ### (a) complete this function
  8.         ###

  9.     def __repr__(self):                                # display as a float
  10.         return `self.value`

  11.     def __str__(self):                                # formatted display
  12.         val = ''

  13.         ###
  14.         ### (b) complete this function... do NOT
  15.         ###     forget about negative numbers too!!
  16.         ###

  17.         return val

  18.     def __nonzero__(self):                        # boolean test
  19.         ###
  20.         ### (c) find and fix the bug
  21.         ###

  22.         return int(self.value)
  23. Contact GitHub API Training Shop Blog About
  24. © 2016 GitHub, Inc. Terms Privacy Security Status Help
复制代码

使用道具

7
lalot 发表于 2016-8-16 21:20:34 |只看作者 |坛友微信交流群
  1. #!/usr/bin/env python

  2. dashes = '\n' + '-' * 50
  3. exec_dict = {

  4. 'f': """                        # for loop
  5. for %s in %s:
  6.     print %s
  7. """,

  8. 's': """                        # sequence while loop
  9. %s = 0
  10. %s = %s
  11. while %s < len(%s):
  12.     print %s[%s]
  13.     %s = %s + 1
  14. """,

  15. 'n': """                        # counting while loop
  16. %s = %d
  17. while %s < %d:
  18.     print %s
  19.     %s = %s + %d
  20. """
  21. }

  22. def main():

  23.     ltype = raw_input('Loop type? (For/While) ')
  24.     dtype = raw_input('Data type? (Number/Sequence) ')

  25.     if dtype == 'n':
  26.         start = input('Starting value? ')
  27.         stop = input('Ending value (non-inclusive)? ')
  28.         step = input('Stepping value? ')
  29.         seq = str(range(start, stop, step))

  30.     else:
  31.         seq = raw_input('Enter sequence: ')

  32.     var = raw_input('Iterative variable name? ')

  33.     if ltype == 'f':
  34.         exec_str = exec_dict['f'] % (var, seq, var)

  35.     elif ltype == 'w':
  36.         if dtype == 's':
  37.             svar = raw_input('Enter sequence name? ')
  38.             exec_str = exec_dict['s'] % \
  39.                 (var, svar, seq, var, svar, svar, var, var, var)

  40.         elif dtype == 'n':
  41.             exec_str = exec_dict['n'] % \
  42.                 (var, start, var, stop, var, var, var, step)

  43.     print dashes
  44.     print 'The custom-generated code for you is:' + dashes
  45.     print exec_str + dashes
  46.     print 'Test execution of the code:' + dashes
  47.     exec exec_str
  48.     print dashes

  49. if __name__ == '__main__':
  50.     main()
复制代码

使用道具

8
neuroexplorer 发表于 2016-8-16 21:53:46 |只看作者 |坛友微信交流群
  1. #!/usr/bin/env python

  2. from socket import *

  3. HOST = 'localhost'
  4. PORT = 21567
  5. BUFSIZ = 1024
  6. ADDR = (HOST, PORT)

  7. tcpCliSock = socket(AF_INET, SOCK_STREAM)
  8. tcpCliSock.connect(ADDR)

  9. while True:
  10.     data = raw_input('> ')
  11.     if not data:
  12.         break
  13.     tcpCliSock.send(data)
  14.     data = tcpCliSock.recv(BUFSIZ)
  15.     if not data:
  16.         break
  17.     print data

  18. tcpCliSock.close()
复制代码

使用道具

9
albertwishedu 发表于 2016-8-16 22:36:50 |只看作者 |坛友微信交流群
  1. #!/usr/bin/env python

  2. from socket import *

  3. HOST = 'localhost'
  4. PORT = 21567
  5. BUFSIZ = 1024
  6. ADDR = (HOST, PORT)

  7. while True:
  8.     tcpCliSock = socket(AF_INET, SOCK_STREAM)
  9.     tcpCliSock.connect(ADDR)
  10.     data = raw_input('> ')
  11.     if not data:
  12.         break
  13.     tcpCliSock.send('%s\r\n' % data)
  14.     data = tcpCliSock.recv(BUFSIZ)
  15.     if not data:
  16.         break
  17.     print data.strip()
  18.     tcpCliSock.close()
复制代码

使用道具

10
HappyAndy_Lo 发表于 2016-8-16 22:37:23 |只看作者 |坛友微信交流群
  1. #!/usr/bin/env python

  2. from twisted.internet import protocol, reactor

  3. HOST = 'localhost'
  4. PORT = 21567

  5. class TSClntProtocol(protocol.Protocol):
  6.     def sendData(self):
  7.         data = raw_input('> ')
  8.         if data:
  9.             print '...sending %s...' % data
  10.             self.transport.write(data)
  11.         else:
  12.             self.transport.loseConnection()

  13.     def connectionMade(self):
  14.         self.sendData()

  15.     def dataReceived(self, data):
  16.         print data
  17.         self.sendData()

  18. class TSClntFactory(protocol.ClientFactory):
  19.     protocol = TSClntProtocol
  20.     clientConnectionLost = clientConnectionFailed = \
  21.         lambda self, connector, reason: reactor.stop()

  22. reactor.connectTCP(HOST, PORT, TSClntFactory())
  23. reactor.run()
复制代码

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-25 14:29