上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页
摘要: !!此处会产生的错误!! 阅读全文
posted @ 2016-09-15 12:03 Frankiee 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1. CTRL+ALT+T 可以将命令模式打开 2. 有可能没办法进行yum ,它会告诉你操作的方法 3. 有些操作需要获得root的权限才可以,我们得进入root状态 --> sudo passwd ...会提示为root配置一个新的密码,记住!!! 再 su 输入密码后就可以进入root下 4. ubuntu不能使用yum,安装需要使用dpkg 使用方法: --> (如果... 阅读全文
posted @ 2016-09-13 16:59 Frankiee 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 分两种 1. 在VMware中安装,则与Centos的安装类似 2. 在VirtualBox里安装 --> 1. 先“新建” 一个虚拟电脑 2. 根据需求编辑虚拟电脑的信息 (具体的大小、内存等等都需要根据当时的需求) 3. 编辑好后,再对具体的数值进行设置 --〉对准虚拟机右键 --〉设置 -- 〉 将启动顺序选择 光驱、硬盘 在“存... 阅读全文
posted @ 2016-09-13 16:54 Frankiee 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 此处会出现的错误!!!! 阅读全文
posted @ 2016-09-13 13:20 Frankiee 阅读(2987) 评论(0) 推荐(0) 编辑
摘要: [root@localhost test1]# vim 19.py //add #!/usr/bin/python macaddr = '00:0C:29:D1:6F:E9' prefix_mac = macaddr[:-3] last_two = macaddr[-2:] plus_one = int(last_two, 16) + 1 new_last_two = hex(plus_one... 阅读全文
posted @ 2016-09-05 19:28 Frankiee 阅读(6017) 评论(0) 推荐(0) 编辑
摘要: [root@localhost test1]# vim 18.py //add #!/usr/bin/python with open('/proc/meminfo') as ll: for line in ll: if line.startswith('MemTotal'): total = line.split()[1] co... 阅读全文
posted @ 2016-09-05 18:53 Frankiee 阅读(223) 评论(0) 推荐(0) 编辑
摘要: /* 使用while循环遍历文件*/ [root@localhost test1]# vim 17.py //add #!/usr/bin/python ll = open('/tmp/1.txt') while True: line = ll.readline() if not line: break print line, [root@localh... 阅读全文
posted @ 2016-09-05 16:19 Frankiee 阅读(1553) 评论(0) 推荐(0) 编辑
摘要: /* while 是在有条件控制的情况下 进行的循环 */ [root@localhost test1]# vim 13.py //ADD #!/usr/bin/python n = 0 while True: if n == 10: break print n, 'hello' n += 1 [root@localhost test1]# pytho... 阅读全文
posted @ 2016-09-05 15:30 Frankiee 阅读(265) 评论(0) 推荐(0) 编辑
摘要: /* for...else 语句,当for循环正常结束后,才会执行else语句。 */ eg1: [root@localhost test1]# vim 11.py //ADD #!/usr/bin/python for i in xrange(10): print i else: print 'main end' [root@localhost test1]# pytho... 阅读全文
posted @ 2016-09-05 14:47 Frankiee 阅读(319) 评论(0) 推荐(0) 编辑
摘要: In [2]: list1 = [1,2,3,4] In [3]: for i in list1: ...: print i ...: 1 2 3 4 In [4]: for i in list1: print i, ...: 1 2 3 4 //range(头,尾,走多少步取值) In [7]: range(0,10) Out[7]: [0, 1, 2... 阅读全文
posted @ 2016-09-05 09:12 Frankiee 阅读(178) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页