sudo lsof -i:1080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sslocal 1795 root4u IPv4 16233 0t0 TCP localhost:socks (LISTEN)
sslocal 1795 root5u IPv4 16234 0t0 UDP localhost:socks
An app was listening on localhost:1080,it is ready for curl's so
sudo lsof -i:1080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sslocal 1795 root4u IPv4 16233 0t0 TCP localhost:socks
(LISTEN)
sslocal 1795 root5u IPv4 16234 0t0 UDP localhost:socks
An app was listening on localhost:1080,it is ready for curl's soc
import pandas as pd
rng = pd.date_range("20150101","20150620",freq="D")
for day in rng:
x = pd.to_datetime(day)
y = x.timetuple().tm_wday
if(y == 0) :print(x.strftime("%Y%m%d"))
I have selected all the monday form "20150101" till "20150620",how to make
it more simple?
--
https://mail.p
>>> "ok" or "not ok"
'ok'
>>> "ok" and "not ok"
'not ok'
>>>
why "ok" or "not ok" output "ok" , "ok" and "not ok" output "not ok" ?
--
https://mail.python.org/mailman/listinfo/python-list
>>> x=['','x1','x2','x3',' ']
>>> x
['', 'x1', 'x2', 'x3', ' ']
>>> [print("ok") for it in x if it.strip() !=""]
ok
ok
ok
[None, None, None]
i understand there are three 'ok' in the output,but why i have the output
of [None, None, None]
--
https://mail.python.org/mailman/listinfo/python-list
>>> x=["a","b",["c","d"],"e"]
>>> y=x[2]
>>> y
['c', 'd']
>>> x.insert(2,y[0])
>>> x
['a', 'b', 'c', ['c', 'd'], 'e']
>>> x.insert(3,y[1])
>>> x
['a', 'b', 'c', 'd', ['c', 'd'], 'e']
>>> del x[4]
>>> x
['a', 'b', 'c', 'd', 'e']
>>>
maybe there is a more smart way to do.
--
https://mail.python.org/
problem solved.if you enter python by python(command line),the problem
can't be solved.if you enter python by cmd ,and input python,no problem
happen.
2014-04-10 11:05 GMT+08:00 length power :
> i tried this way ,and post it in stackoverflow,please see:
> maybe it is the best answer.
oredirect=1#comment35087732_22977409
2014-04-10 10:27 GMT+08:00 MRAB :
> On 2014-04-10 02:54, length power wrote:
>
>> I am in win7 +python3.3.
>>
>> import os
>> os.system("chcp 936")
>> fh=open("test.ch <http://test.ch&
I am in win7 +python3.3.
import os
os.system("chcp 936")
fh=open("test.ch","w",encoding="utf-8")
fh.write("你")
fh.close()
os.system("chcp 65001")
fh=open("test.ch","r",encoding="utf-8").read()
print(fh)
Äã
>>> print(fh.encode("utf-8"))
b'\xe4\xbd\xa0'
range(0,2)]
>>> [words.append(words.pop(2)) for i in range(0,2)]
[None, None]
2014-04-09 18:46 GMT+08:00 Peter Otten <__pete...@web.de>:
> length power wrote:
>
> > word=["x1","x2","x3","x4","x5"]
> > w=w
word=["x1","x2","x3","x4","x5"]
w=word[-2:]
del word[-2:]
word.insert(2,w)
word
['x1', 'x2', ['x4', 'x5'], 'x3']
what i want to get is
['x1', 'x2', 'x4', 'x5', 'x3']
how can i insert them ?
--
https://mail.python.org/mailman/listinfo/python-list
x='name,sex,birthday\n\nx1,male,1948/05/28\n\nx2,female,1952/03/27
\n\nx3,female,1994/12/09'
x.replace("\n\n","\n").splitlines()
is there more simple way to replace `x.replace("\n\n","\n").splitlines()` ?
--
https://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo