码迷,mamicode.com
首页 >  
搜索关键字:try    ( 12995个结果
linux下python使用tab补齐
1、创建文件:vi/root/.pystartup,代码如下:importsys importreadline importrlcompleter importatexit importos readline.parse_and_bind(‘tab:complete‘) histfile=os.path.join(os.environ[‘HOME‘],‘.pythonhistory‘) try: readline.read_history_file(histfile) exceptIO..
分类:编程语言   时间:2014-08-28 09:49:39    阅读次数:192
Unreachable catch block for IOException. This exception is never thrown from the try statement body
Unreachable catch block for IOException. This exception is never thrown from the try statement body不可到达的 catch 块异常。try 中的语句,永远不会引发此异常2 quick fixes available2 快速修复可用点击其中一个,可以解决这个问题。...
分类:其他好文   时间:2014-08-27 16:43:48    阅读次数:249
获取python的异常信息1
代码为:if __name__ == '__main__': try: cc = 10/0 except: import sys,traceback print 'begin' print ''.join(traceback.format_exception(*sys.exc_info())) p....
分类:编程语言   时间:2014-08-27 14:27:08    阅读次数:188
hbase memstorelab
关于MemStore的补充在通过HStore.add向store中加入?一个kv时,首先把数据写入到memstore中。这一点没有什么说明;publiclongadd(finalKeyValue kv) {lock.readLock().lock();try{returnthis.memstore....
分类:其他好文   时间:2014-08-27 12:50:57    阅读次数:235
python 通过threading多线程ssh
#!/usr/bin/envpython#coding=utf-8importparamikoimporttime,datetime,threadingdefssh(ip,user,passwd,command):ssh=paramiko.SSHClient()ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())try:ssh.connect(ip,port=16333,username=user,password=passwd)exceptpar..
分类:编程语言   时间:2014-08-26 19:54:27    阅读次数:237
python 将unix文件转成dos文件
#!/usr/bin/python#-*-encoding:UTF-8-*-importsysiflen(sys.argv)<2:print(‘Usage:pythonsys.argv[0]FileName‘)sys.exit(1)else:print(‘\nunix2dos.pyexecutionsuccessfully!\n‘)File=sys.argv[1]fileobj=open(File,‘rU‘)try:allfile=fileobj.read()finally:fileobj.close()
分类:编程语言   时间:2014-08-26 19:53:57    阅读次数:305
仅hibernate操作
publicvoidtestSave1(){ Sessionsession=null; Transactiontx=null; try{ session=HibernateUtils.getSession(); tx=session.beginTransaction(); User1user=newUser1(); user.setName("李四"); user.setPassword("123"); user.setCreateTime(newDate()); user.setExpireTime(..
分类:系统相关   时间:2014-08-26 17:39:37    阅读次数:197
检测80端口是否开启
publicstaticvoidport_check(stringip){booltcpListen=false;booludpListen=false;//设定端口状态标识位stringip_str=ip;System.Net.IPAddressmyIpAddress=IPAddress.Parse(ip_str);System.Net.IPEndPointmyIpEndPoint=newIPEndPoint(myIpAddress,80);try{System.Net.Sockets.T..
分类:其他好文   时间:2014-08-26 17:36:16    阅读次数:595
java,大数据批量插入、更新
public void exec(Connection conn){ try { conn.setAutoCommit(false); Long beginTime = System.currentTimeMillis(); //构造预处理statement Prepare...
分类:编程语言   时间:2014-08-26 15:06:36    阅读次数:425
URAL 1409 Two Gangsters
A + B + 1 1 import java.util.Scanner; 2 3 public class P1409 4 { 5 public static void main(String args[]) 6 { 7 try (Scanner cin = ne...
分类:其他好文   时间:2014-08-26 09:48:46    阅读次数:197
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!