这是 I\xe2\x80\x99m 使用的原材料:
\n\nFirst. \nThis is the second line. \nThe third. \nRun Code Online (Sandbox Code Playgroud)\n\n我想在文本中插入“在4个字符后面插入一些内容”,使其成为
\n\nFirsinsert something behind 4 charactert. \nThisinsert something behind 4 character is the second line. \nThe insert something behind 4 characterthird. \nRun Code Online (Sandbox Code Playgroud)\n\n:%s/^.\\{4}/insert something behind 4 character/g \nRun Code Online (Sandbox Code Playgroud)\n\n该substitute命令不插入文本。如何在每行的第四个字符后面插入这个字符串?
我想在gvim for windows中删除文件中的空白行(不是来自cygwin的vim).
:g/^$/d # delete all blank lines correctly
:%s/^$//g #can not delete all blank lines
Run Code Online (Sandbox Code Playgroud)
这是一个如何表达行尾的问题,
我已经用命令详细检查了我的文件%!xxd,
我发现在每一行的末尾有一个0d0a,
当行的结尾由特殊字符表示时$,
它是否包含该0D0A?
表达the end of line命令g和 s的概念是不同的?
:%s/^$\n//g #delete all blank lines correctly
Run Code Online (Sandbox Code Playgroud)
它混淆了我^$将包含特殊字符\r\n ,也许^$在s 命令中不包含特殊字符\r\n,但^$在g 命令中包含特殊字符\r\n.哪个位置有特殊性能 $指向?在... \r\n之前或之后\r\n.
>>> x=[("x1","x2","x3"),("x1","x2"),("x2","x3"),("x3","x4")]
>>> x
[('x1', 'x2', 'x3'), ('x1', 'x2'), ('x2', 'x3'), ('x3', 'x4')]
Run Code Online (Sandbox Code Playgroud)
我想删除列表中的元组 - x,如果len(x[id])==3,len(x[0]==3)那么它将被删除,[('x1', 'x2'), ('x2', 'x3'), ('x3', 'x4')]是我想要的,我该如何编写代码?
[del element if len(element[id]==3) for id,element in enumerate(x)]
invalid syntax.
Run Code Online (Sandbox Code Playgroud) 在我的 DigitalOcean droplet 中,我以这种方式安装了我的 python3:
sudo apt-get install make gcc
wget https://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz
tar xf Python-3.4.0.tgz -C /usr/local/src/
cd /usr/local/src/Python-3.4.0/
./configure --prefix=/usr/local/python3.4
make
make install
ln -s /usr/local/python3.4/bin/python3.4 /usr/bin/python3
Run Code Online (Sandbox Code Playgroud)
当我将名为 down.py 的 python 文件上传到带有 putty 的位置时:
/usr/local/python3.4/lib/python3.4/down.py
Run Code Online (Sandbox Code Playgroud)
为什么不能用命令导入模块:
import down
Run Code Online (Sandbox Code Playgroud)
或者
import down.py
Run Code Online (Sandbox Code Playgroud)
或者
import /usr/local/python3.4/lib/python3.4/down.py ?
Run Code Online (Sandbox Code Playgroud) >>> numpy.sin(range(11))
array([ 0. , 0.84147098, 0.90929743, 0.14112001, -0.7568025
-0.95892427, -0.2794155 , 0.6569866 , 0.98935825, 0.4121184
-0.54402111])
>>> numpy.array(range(11))*2
array([ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20])
>>> str(numpy.array(range(11))... )
'[ 0 1 2 3 4 5 6 7 8 9 10]'
Run Code Online (Sandbox Code Playgroud)
我怎样才能得到 ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] 与numpy.sin(range(11)) 或 numpy.array(range(11))*2 等 python 标量的概念?
我可以通过以下方式做到这一点:
>>> s=[]
>>> [s.append(str(i)) for i in range(11)]
>>> s
['0', '1', '2', '3', '4', …Run Code Online (Sandbox Code Playgroud) def fac(n):
if n==1 or n==2 or n==3:
print "i am calling fac(",n,")"
return n
else:
print "i am calling fac(",n,")"
x=fac(n-1)+fac(n-2)+fac(n-3)
return x
Run Code Online (Sandbox Code Playgroud)
fac(6)的输出是:
fac(6)
i am calling fac( 6 )
i am calling fac( 5 )
i am calling fac( 4 )
i am calling fac( 3 )
i am calling fac( 2 )
i am calling fac( 1 )
i am calling fac( 3 )
i am calling fac( 2 )
i am calling fac( 4 ) …Run Code Online (Sandbox Code Playgroud) 我想用CSS在同一行上制作两个div.
body {
margin: 0px;
padding: 0px;
}
div {
border: 1px solid black;
font-size: 30px;
}
#wrapper {
width: 900px;
margin: 0px auto;
}
#header {
width: 100%;
height: 100px;
background: red;
}
#main {
width: 100%;
height: 100px;
background: blue;
}
#login_left {
width: 50%;
height: 100px;
background: blue;
float: left;
}
#login_right {
width: 50%;
height: 100px;
background: yellow;
float: left;
}
#footer {
width: 100%;
height: 50px;
background: white;
}Run Code Online (Sandbox Code Playgroud)
<div id="wrapper">
<div id="header">this is the …Run Code Online (Sandbox Code Playgroud)在Battlestar Galactica这里
http://kickasstorrentsan.com/usearch/Battlestar%20Galactica/
可以用泛滥来下载.
可以验证磁铁是:
magnet:?xt=urn:btih:2D2CAE6AC83800490327547053597BAFF6701C2F&dn=battlestar+galactica+season+1+s01+1080p+bluray+x265+hevc+aac+5+1+joy+utr&tr=udp%3A%2F%2Ftracker.publicbt.com%2Fannounce&tr=udp%3A%2F%2Fglotorrents.pw%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce
Run Code Online (Sandbox Code Playgroud)
1. $ url变量是磁铁的正确地址.
2.aria2c命令可以正确执行.
3. aria2c $url已beeen约一hour.Why没有执行的,可以dowlonaded?
<input size="-1" value="Search" type="submit">
Run Code Online (Sandbox Code Playgroud)
size =" - 1"在输入元素中的含义是什么?
这可以在这里看到http://www.postfix.org/.
au FileType php call PHPFuncList()
function PHPFuncList()
set dictionary-=/etc/vim/php_funclist.txt dictionary+=/etc/vim/php_funclist.txt
set complete-=k complete+=k
endfunction
Run Code Online (Sandbox Code Playgroud)
对于上面的 PHPFunctionList,函数体中的两行让我很困惑。
set dictionary-=/etc/vim/php_funclist.txt dictionary+=/etc/vim/php_funclist.txt
set complete-=k complete+=k
Run Code Online (Sandbox Code Playgroud)
对于这两行,首先-=将其删除,然后+=再次添加。
为什么不能只+=在其中写两行?
set dictionary+=/etc/vim/php_funclist.txt
set complete+=k
Run Code Online (Sandbox Code Playgroud)
它们之间有什么区别吗?
:h set-=指出,当该选项是标志列表时,{value}必须完全在选项中显示。一一移除标志以避免出现问题。
避免哪个问题?
python ×4
vim ×3
html ×2
bash ×1
completion ×1
css ×1
idiomatic ×1
import ×1
input ×1
list ×1
magnet-uri ×1
magnetometer ×1
numpy ×1
python-2.7 ×1
recursion ×1
regex ×1
scalar ×1