This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestABC(object): | |
def __call__(self,a): | |
def inner_method(b): | |
return a+b | |
return inner_method | |
add=TestABC() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
try: | |
import wxpy | |
except Exception as e: | |
import pip | |
pip.main(["install", "wxpy"]) | |
import wxpy | |
bot = wxpy.Bot(console_qr=True) |
OlderNewer