随笔分类 -  python

上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 48 下一页
摘要:server client 阅读全文
posted @ 2019-03-13 16:28 anobscureretreat 阅读(278) 评论(0) 推荐(0)
摘要:发布者 订阅者: 阅读全文
posted @ 2019-03-13 15:53 anobscureretreat 阅读(186) 评论(0) 推荐(0)
摘要:# -*- coding: UTF-8 -*- import gevent from gevent import socket from gevent import event rev=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) rev.bind(('',53)) ip=[] cur=0 def preload(): f... 阅读全文
posted @ 2019-03-12 17:45 anobscureretreat 阅读(363) 评论(0) 推荐(0)
摘要:from win32com import client import time import random from lxml import etree dirver = client.DispatchEx("InternetExplorer.Application") dirver.Navigate('http://sbj.saic.gov.cn/sbcx/') dirver.Visibl... 阅读全文
posted @ 2019-03-12 17:42 anobscureretreat 阅读(2484) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python #coding=utf-8 import rospy from std_msgs.msg import String i=0 def talker(): global i pub = rospy.Publisher('bp_nav_goal',String, queue_size=10) rospy.init_node('... 阅读全文
posted @ 2019-03-12 17:36 anobscureretreat 阅读(460) 评论(0) 推荐(0)
摘要:Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the thr 阅读全文
posted @ 2019-03-12 16:57 anobscureretreat 阅读(128) 评论(0) 推荐(0)
摘要:class Solution(object): def threeSum(self, nums): res = [] nums.sort() for i in xrange(len(nums)-2): if i > 0 and nums[i] == nums[i-1]: conti... 阅读全文
posted @ 2019-03-12 16:52 anobscureretreat 阅读(286) 评论(0) 推荐(0)
摘要:note:All given inputs are in lowercase letters a-z. 阅读全文
posted @ 2019-03-12 10:29 anobscureretreat 阅读(148) 评论(0) 推荐(0)
摘要:class Solution(object): def romanToInt(self, s): """ :type s: str :rtype: int """ lista={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000} Valu... 阅读全文
posted @ 2019-03-10 19:50 anobscureretreat 阅读(169) 评论(0) 推荐(0)
摘要:class Solution(object): def intToRoman(self, num): """ :type num: int :rtype: str """ if num == 0: return "" if num >= 1000: ... 阅读全文
posted @ 2019-03-10 19:40 anobscureretreat 阅读(245) 评论(0) 推荐(0)
摘要:def solution(num): if(0<num<=5): if(num<4): return (num)*"I" else: return (5-num)*"I"+"V" elif(5<num<=10): return "V"+(num-5)*"I" elif(10... 阅读全文
posted @ 2019-03-10 19:36 anobscureretreat 阅读(134) 评论(0) 推荐(0)
摘要:class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """ s=str(x) if(s==s[::-1]): return True els... 阅读全文
posted @ 2019-03-10 18:07 anobscureretreat 阅读(104) 评论(0) 推荐(0)
摘要:def solution(s): s=s.strip() if(s): l=len(s) first_n=-1 b_n=-1 last_n=-1 f_n=-1 for i in range(l): if(s[i].isdigit()): ... 阅读全文
posted @ 2019-03-09 23:01 anobscureretreat 阅读(164) 评论(0) 推荐(0)
摘要:def get_f_l(s_length,s,list_all,last_d): max_l=0 first_d=0 last_d=0 for i in range(len(list_all)): if((i+1)==len(list_all)): break for j in range(i+1,len... 阅读全文
posted @ 2019-03-07 23:49 anobscureretreat 阅读(204) 评论(0) 推荐(0)
摘要:class Solution(object): def get_f_l(self,s_length,s,list_all,last_d): max_l=0 first_d=0 last_d=0 for i in range(len(list_all)): if((i+1)==len(list_al... 阅读全文
posted @ 2019-03-07 23:48 anobscureretreat 阅读(105) 评论(0) 推荐(0)
摘要:list_all=[] oper_s="abcdaaaa" i_num=0 while(True): x=oper_s.find("a",i_num) print(x) if(not x==-1): i_num=x+1 list_all.append(x) else: break print(list_... 阅读全文
posted @ 2019-03-07 23:04 anobscureretreat 阅读(653) 评论(0) 推荐(0)
摘要:class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ p=abs(x) rev=int(str(p)[::-1]) if(x(pow(2,31)-1)): ... 阅读全文
posted @ 2019-03-07 13:37 anobscureretreat 阅读(197) 评论(0) 推荐(0)
摘要:def solution(s): max_len=0 f=0 l=0 s_x=set(s) for i in s_x: first_d=s.find(i) last_d=s.rfind(i) if(first_d==last_d): pass else: ... 阅读全文
posted @ 2019-03-05 22:08 anobscureretreat 阅读(195) 评论(0) 推荐(0)
摘要:print('{},{}'.format('chuhao',20)) 阅读全文
posted @ 2019-03-04 16:23 anobscureretreat 阅读(167) 评论(0) 推荐(0)
摘要:转为string类型 阅读全文
posted @ 2019-03-04 16:14 anobscureretreat 阅读(842) 评论(0) 推荐(0)

上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 48 下一页