Skip to content

Instantly share code, notes, and snippets.

View Zheaoli's full-sized avatar
🇯🇵
Travel In Japan

Nadeshiko Manju Zheaoli

🇯🇵
Travel In Japan
View GitHub Profile
a
import requests
response=resquests.post("sss",json=data)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Zheaoli
Zheaoli / interview.py
Last active July 20, 2017 07:36
经典面试题解析
class Foo():
def __init__(self):
self._temp_list=[]
def __getattr__(self,name):
self._temp_list.append(name)
return self
def __str__(self):
return " ".join(self._temp_list)
# 这道题这样几个知识点
# 首先看题,print(Foo().think.different) 调用完后一次性输出 think different
@Zheaoli
Zheaoli / solve.py
Last active September 9, 2017 18:48
class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
tempList=nums1+nums2
tempList=sorted(tempList)
if len(tempList) % 2==0:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import codecs
import random
import string
from hashlib import md5
from multiprocessing import Pool
PROCESSES = 10
LENGTH = 8192*5+777
@Zheaoli
Zheaoli / code.py
Last active September 22, 2017 03:32
class TestABC(object):
def __call__(self,a):
def inner_method(b):
return a+b
return inner_method
add=TestABC()
def groupBy(func):
def inner(data):
assert isinstance(data,list)
temp_dict={}
for value in data:
if func(value) not in temp_dict:
temp_dict[func(value)]=[value]
else:
temp_dict[func(value)].append(value)
return temp_dict
@Zheaoli
Zheaoli / tail_call.py
Created December 6, 2017 15:46
tail_call.py
from ast import *
from inspect import getsource
class TailCall(NodeTransformer):
def visit_Return(self, node):
temp_return = node.value
if temp_return.__class__ == Call:
func = temp_return.func
func_args = temp_return.args
# -*- coding: utf-8 -*-
try:
import wxpy
except Exception as e:
import pip
pip.main(["install", "wxpy"])
import wxpy
bot = wxpy.Bot(console_qr=True)