摘要:
修改/etc/fstab, /etc/rc.d/rc.sysinit, /etc/rc.local等系统启动文件时误操作就会造成linux无法进入,有rescue盘可以容易修复.下述方法适合于没有rescue盘时修复系统.grub菜单中选择linux,按e,e,进入编辑模式,kernel (hd0,... 阅读全文
摘要:
类型转换 int(x [,base ]) 整数 long(x [,base ]) 长整数 float(x ) 浮点数 complex(real [,imag ]) 复数 str(x ) 字符串 repr(x ) 表达式字符串 eval(str ) 用来计算在字符串中的有效Python表达式,并返回一 阅读全文
摘要:
I.Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexi... 阅读全文
摘要:
1.以前的方法如果是要获得程序运行的当前目录所在位置,那么可以使用os模块的os.getcwd()函数。如果是要获得当前执行的脚本的所在目录位置,那么需要使用sys模块的sys.path[0]变量或者sys.argv[0]来获得。实际上sys.path是Python会去寻找模块的搜索路径列表,sys... 阅读全文
摘要:
1. /home/lvtest/test/test.py from datetime import datetimenow=datetime.now()f=open('test.log','a')f.write('%s '%now)f.close()2. edit/etc/rc.local wit... 阅读全文
摘要:
Moduleoptparse from optparse import OptionParser def opt(): usage = "usage: %prog [options] arg" parser = OptionParser(usage=usage) entries ... 阅读全文
摘要:
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a... 阅读全文
摘要:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
摘要:
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Tags:Link... 阅读全文
摘要:
Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ... 阅读全文