萤火虫的错误:
missing ) after condition
[Break on this error] else if (($(this).parent...nt().hasClass('plaing')==true) ) {
Run Code Online (Sandbox Code Playgroud)
代码:
$(".myButtonPlay").live('click',function(){
if ($(this).parent().parent().hasClass('current')==false){
console.log($(this).children().attr('src'));
var media=$(this).parent().parent().attr('media');
var id=$(this).parent().parent().attr('id');
$(this).parent().parent().addClass('plaing');
$(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif')
play_media(media, id);
}
else if (($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==true) ) {
$(this).parent().parent().removeClass('plaing');
$('#mediaPlayer').attr('player').pause();
$(this).find('img').attr('src','http://localhost:8000/silver/images/btn_pause.gif');
}
else if ( ($(this).parent().parent().hasClass('current')==true) $$ ($(this).parent().parent().hasClass('plaing')==false) ){
$(this).find('img').attr('src','http://localhost:8000/silver/images/btn_paly.gif');
$(this).parent().parent().addClass('plaing');
$('#mediaPlayer').attr('player').play();
}
});
Run Code Online (Sandbox Code Playgroud)
问题出在哪儿?看起来错误是在第二个if声明的条件....
在模块中,我使用以下__init__方法定义了一个类:
class RMLoader(object):
def __init__(self):
self.now=datetime.datetime.now()
Run Code Online (Sandbox Code Playgroud)
然后我在控制台中导入该模块:
>>> from video.remmedia.loader import RMLoader
>>> loader=RMLoader()
>>> loader.now
datetime.datetime(2010, 11, 4, 17, 40, 36, 523000)
Run Code Online (Sandbox Code Playgroud)
问题是为什么它不给我标准的日期时间对象?
但是当我打印它时,它就像标准的datetime对象一样:
>>> print loader.now
2010-11-04 17:40:36.523000
Run Code Online (Sandbox Code Playgroud)
但是我不能在我需要datetime对象的函数中使用它...
如何像标准日期时间一样使用该属性?
如何找到symols之后的所有内容#TR= 以及[ ]使用re模块的内部.例如#TR=[ dfgg dfgddfg dgfgf dgdgdg dfgfg ]
例:
l = [1,2,3,4,5,6,7,8,9,0]
for i in l:
print i,l
l.remove(i)
Run Code Online (Sandbox Code Playgroud)
返回:
1 [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
3 [2, 3, 4, 5, 6, 7, 8, 9, 0]
5 [2, 4, 5, 6, 7, 8, 9, 0]
7 [2, 4, 6, 7, 8, 9, 0]
9 [2, 4, 6, 8, 9, 0]
Run Code Online (Sandbox Code Playgroud)
那为什么只有5个旋转?我希望它转10次.有人可以一步一步向我解释吗?
我需要编写生成器,它产生所有可能的8个符号字符串.从像这样的符号数组:
leters = ['1','2','3','4','5','6','7','8','9','0','q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m']
Run Code Online (Sandbox Code Playgroud)
骨架看起来像这样:
def generator():
"""
here algorithm
"""
yield string
Run Code Online (Sandbox Code Playgroud)
假设要返回这样的列表 ['00000001','00000002','00000003', ......'mmmmmmmm']