美好的事可不可以发生在我身上? ------
博客首页
摘要:
#说白了str是为了利用print(函数名)输出格式的时候可以显示这__str__里边儿的内容,用__repr__纯粹就是程序员在调试程序的时候不愿意多费时间去手打那个print()而想出来的函数。真的绝(闲) (注:代码抄自博主 行尸走肉) class Person(object): def __
阅读全文
posted @ 2021-12-25 17:41
Leshol
阅读(48)
推荐(0)
摘要:
def fun3(sex): def wrap_fun(fun): def func1(): if sex == 'woman': print('你不仅可以上班,你还可以生娃!') else: print('你还是老实上班吧,暂时还生不了娃!') return return func1 return
阅读全文
posted @ 2021-12-25 09:27
Leshol
阅读(40)
推荐(0)
style="position: fixed; left: 0px; top: 0px; z-index: 2147483647; pointer-events: none;">
var a_idx = 0;
jQuery(document).ready(function ($) {undefined
$("body").click(function (e) {undefined
var a = new Array(
"❤富强❤", "❤民主❤", "❤和谐❤", "❤文明❤",
"❤自由❤", "❤平等❤", "❤公正❤", "❤法治❤",
"❤爱国❤", "❤敬业❤", "❤诚信❤", "❤友善❤",
);
var $i = $("").text(a[a_idx]);
a_idx = (a_idx + 1) % a.length;
var x = e.pageX,
y = e.pageY;
$i.css({undefined
"z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
"top": y - 20,
"left": x,
"position": "absolute",
"font-weight": "bold",
"color": "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
});
$("body").append($i);
$i.animate({undefined
"top": y - 180,
"opacity": 0
}, 1500,
function () {undefined
$i.remove();
});
});
});
(function ($) {undefined
$.fn.snow = function (options) {undefined
var $flake = $('
documentHeight = $(document).height(),
documentWidth = $(document).width(),
defaults = {undefined
minSize: 10,
maxSize: 20,
newOn: 1000,
flakeColor: "#AFDAEF" /* 此处可以定义雪花颜色,若要白色可以改为#FFFFFF */
},
options = $.extend({}, defaults, options);
var interval = setInterval(function () {undefined
var startPositionLeft = Math.random() * documentWidth - 100,
startOpacity = 0.5 + Math.random(),
sizeFlake = options.minSize + Math.random() * options.maxSize,
endPositionTop = documentHeight - 200,
endPositionLeft = startPositionLeft - 500 + Math.random() * 500,
durationFall = documentHeight * 10 + Math.random() * 5000;
$flake.clone().appendTo('body').css({undefined
left: startPositionLeft,
opacity: startOpacity,
'font-size': sizeFlake,
color: options.flakeColor
}).animate({undefined
top: endPositionTop,
left: endPositionLeft,
opacity: 0.2
}, durationFall, 'linear', function () {undefined
$(this).remove()
});
}, options.newOn);
};
})(jQuery);
$(function () {undefined
$.fn.snow({undefined
minSize: 5, /* 定义雪花最小尺寸 */
maxSize: 50,/* 定义雪花最大尺寸 */
newOn: 300 /* 定义密集程度,数字越小越密集 */
});
});