偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Python字典在linux系統(tǒng)下的相關介紹

開發(fā) 后端
Python字典在使用的時候我們有不少需要注意的地方。當然我們在的使用的時候只要注意源代碼的編寫就能更好的使用這個語言。

Python字典的用處非常大,在長時間的使用中我們就會發(fā)現(xiàn),他具有廣泛的應用范圍,超強的適應能力。下面我們就來看看昨天在網(wǎng)上找了個能在linux跑的字典程序,分享一下。Python字典其實是一個很好使的語言。

  1. #!/usr/bin/python  
  2. f=open(‘wordlist’, ‘w’)  
  3. def xselections(items, n):  
  4. if n==0: yield []  
  5. else:  
  6. for i in xrange(len(items)):  
  7. for ss in xselections(items, n-1):  
  8. yield [items[i]]+ss  
  9. Numbers = 48 – 57  
  10. Capital = 65 – 90  
  11. Lower = 97 – 122  
  12. numb = range(48,58)  
  13. cap = range(65,91)  
  14. low = range(97,123)  
  15. choice = 0 
  16. while int(choice) not in range(1,8):  
  17. choice = raw_input(”’  
  18. 1) Numbers  
  19. 2) Capital Letters  
  20. 3) Lowercase Letters  
  21. 4) Numbers + Capital Letters  
  22. 5) Numbers + Lowercase Letters  
  23. 6) Numbers + Capital Letters + Lowercase Letters  
  24. 7) Capital Letters + Lowercase Letters  
  25. : ”’)  
  26. choice = int(choice)  
  27. poss = []  
  28. if choice == 1:  
  29. poss += numb  
  30. elif choice == 2:  
  31. poss += cap  
  32. elif choice == 3:  
  33. poss += low  
  34. elif choice == 4:  
  35. poss += numb  
  36. poss += cap  
  37. elif choice == 5:  
  38. poss += numb  
  39. poss += low  
  40. elif choice == 6:  
  41. poss += numb  
  42. poss += cap  
  43. poss += low  
  44. elif choice == 7:  
  45. poss += cap  
  46. poss += low  
  47. bigList = []  
  48. for i in poss:  
  49. bigList.append(str(chr(i)))  
  50. MIN = raw_input(“What is the min size of the 
    word? “)  
  51. MIN = int(MIN)  
  52. MAX = raw_input(“What is the max size of 
    the word? “)  
  53. MAX = int(MAX)  
  54. for i in range(MIN,MAX+1):  
  55. for s in xselections(bigList,i): f.write(”.
    join(s) + ‘\n’) 

 

以上就是對Python字典的詳細介紹。

【編輯推薦】

  1. Python編程語言總體性能優(yōu)點評測
  2. Python編程語言具有相當高的適應能力
  3. Python文本亂碼發(fā)生時的解決方案
  4. Python字符串替換如何才能進行字符的拆分
  5. Python編程版面在應用過程中的功能介紹
責任編輯:張浩 來源: CSDN
相關推薦

2010-02-02 15:13:42

Linux ARM

2009-06-23 18:09:22

2010-03-11 16:50:27

Python應用

2010-07-13 08:19:10

Linux聊天工具

2010-06-10 17:08:38

2010-03-19 12:49:20

Python編程

2010-03-10 13:42:44

Python腳本

2015-08-25 09:35:17

LinuxRAID

2011-01-07 09:25:35

LinuxDHCP服務器

2009-06-25 08:53:03

Linux操作系統(tǒng)

2010-03-19 11:04:20

python模塊

2010-03-25 10:13:03

Python代碼

2010-06-29 15:51:22

Linux SNMP協(xié)

2011-09-09 18:16:18

WindowsLinux

2009-11-06 10:05:18

Linux系統(tǒng)環(huán)境GFS

2022-01-26 06:59:46

SFTP操作系統(tǒng)加密算法

2012-02-06 09:49:40

2009-08-27 10:23:52

2010-03-19 18:36:39

python開發(fā)環(huán)境

2010-03-25 16:51:12

Python程序
點贊
收藏

51CTO技術棧公眾號