V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
endoffight
V2EX  ›  Python

分享一个 bypy 的使用经历

  •  
  •   endoffight ·
    phpgao · 2014-07-28 15:28:22 +08:00 · 32712 次点击
    这是一个创建于 3567 天前的主题,其中的信息可能已经有所发展或是发生改变。

    记一次bypy的使用

    无意间发现了bypy一个python写得百度网盘的linux客户端

    工具实在难得,记录一下,说不定以后能用上!

    文档

    使用一个软件前,仔细查看文档是必须的,文档链接

    文档里讲了一些用法和安装前的准备

    下载

    使用之前现在本地clone一份吧

    cd ~
        mkdir bdyun
        cd bdyun
        git clone https://github.com/houtianze/bypy.git
    

    不出意外的话,应该已经下载好了(废话)。

    注意

    需要注意的都写在文档里!

    中文支持

    想要支持中文,你要把系统的区域编码设置为UTF-8。

    设置一下

    su
    vi /etc/sysconfig/i18n
    

    修改原来的内容为

    LANG="zh_CN.UTF-8"
    SYSFONT=latarcyrheb-sun16
    

    python需要Requests库

    检查一下

    python
    >>> import requests
    ImportError: No module named requests
    

    好呀!悲剧了,没有安装过。。。那就找找吧

    easy_install
    bash: easy_install: command not found
    

    又悲剧了,没有安装easy_install,好麻烦!那就安吧,先看一看python版本

    python -V
    Python 2.6
    

    我去!好原始啊。赶紧先升级Python吧。到官网看看,那就2.7.8吧

    wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
    tar -xvf Python-2.7.8.tar.xz.tar
    cd Python-2.7.8
    ./configure
    make
    su
    make install
    

    安装好了再看一看python版本,2.7.8,妥妥的!下面赶紧下载easy_install,先去官网看看,发现

    Most Linux distributions come with wget.

    Download ez_setup.py and run it using the target Python version. The
    script will download the appropriate version and install it for you:

    > wget https://bootstrap.pypa.io/ez_setup.py -O - | python

    那就用它啦!

    执行一下wget https://bootstrap.pypa.io/ez_setup.py -O - | python,果然目录多了个setuptools-5.4.1.zip文件,解压看看

    unzip setuptools-5.4.1.zip
    bash: unzip: command not found
    

    我去,赶紧补上yum install zip unzip -y,安装解压再执行上面的命令,解压成功

    看到ez_setup.py,执行以下命令

    python ez_setup.py
    

    开始安装,如果出现finish,说明安装成功!

    终于可以开始正题了:

    easy_install requests
    

    成功!

    使用

    完成以上安装,cd至之前的clone的目录下,运行下面的命令开始初始化

    ./bypy list
    

    首先他会要求你访问一个网址,需要你授权,授权后复制code给程序,如果没有报错,就可以看到你的同步目录了,你可以在网盘的我的应用数据文件夹里找到bypy文件夹,他就是应用目录了。

    如果你迫不及待的要测试,那就试试直接把当前目录上传至百度网盘

    ./bypy upload
    

    如果你想看到上传进度,请加入-v选项

    ./bypy -v upload
    

    剩下的就不用说了吧,话说国外服务器上传的速度不太给力啊!

    6 条回复    2014-11-06 17:32:15 +08:00
    jzhone
        1
    jzhone  
       2014-07-28 16:25:15 +08:00   ❤️ 1
    lz 可以试试 bcloud
    endoffight
        2
    endoffight  
    OP
       2014-07-28 16:42:07 +08:00   ❤️ 1
    @jzhone 这个没有桌面能用吗?
    xmbaozi
        3
    xmbaozi  
       2014-08-07 23:49:59 +08:00
    美国vps到百度速度很坑
    endoffight
        4
    endoffight  
    OP
       2014-08-30 08:03:27 +08:00
    @xmbaozi 速度还行,我的是1G带宽
    standin000
        5
    standin000  
       2014-10-10 21:01:18 +08:00
    顶下这个~
    Charle
        6
    Charle  
       2014-11-06 17:32:15 +08:00
    现在是不是被墙啦~
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2338 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 12:27 · PVG 20:27 · LAX 05:27 · JFK 08:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.