我想用argparse打开文件进行阅读.在cmd中,它必须如下所示:my_program.py/filepath
这是我的尝试:
parser = argparse.ArgumentParser()
parser.add_argument('file', type = file)
args = parser.parse_args()
Run Code Online (Sandbox Code Playgroud) yarn install v0.21.3
[1/4] Resolving packages...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://github.com/igorklopov/node-resolve.git: tunneling socket could not be established, cause=write EPROTO 140399640340352:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794:\n".
Run Code Online (Sandbox Code Playgroud)
首先我认为这可能是代理问题所以我添加了我的公司代理设置:
yarn …Run Code Online (Sandbox Code Playgroud) 如何使按钮位于div的底部并同时位于它的中心?
这是我的代码:http: //jsfiddle.net/3QguR/1/
HTML
<div class='Center' align='center'>
<button class='btn-bot'>button-bottom</button>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.Center{
width:200px;
height:200px;
background:#0088cc;
margin:auto;
padding:0%;
position: relative;
top: 0; left: 0; bottom: 0; right: 0;
border-radius:5%;
}
.btn-bot{
position: absolute;
bottom: 0;
}
Run Code Online (Sandbox Code Playgroud) 我想有两条不同的设计路线:
路由文件
devise_for :users, path: '', path_names: { sign_in: 'login', sign_out: 'logout' }
namespace :api, defaults: { format: :json } do
devise_for :users,
path: '',
defaults: { format: :json },
path_names: {
sign_in: 'login',
sign_out: 'logout',
},
controllers: { sessions: 'api/sessions' }
end
Run Code Online (Sandbox Code Playgroud)
铁路路线| 会话会话
new_user_session GET /login(.:format) devise/sessions#new
user_session POST /login(.:format) devise/sessions#create
destroy_user_session DELETE /logout(.:format) devise/sessions#destroy
new_api_user_session GET /api/login(.:format) api/sessions#new {:format=>:json}
api_user_session POST /api/login(.:format) api/sessions#create {:format=>:json}
destroy_api_user_session DELETE /api/logout(.:format) …Run Code Online (Sandbox Code Playgroud)