Python: multiprocessing assertionError

Categories: Development NotesPython; Tagged with: ; @ March 22nd, 2016 23:32

Issue:  There’s an AssertionError when I try to test  mutliprocessing features using lettuce 0.2.22 / nosetests and python 2.7.10 error details:

multiprocessing\ AssertionError: main
File "", line 1, in 
File "C:\Python27\Lib\multiprocessing\", line 380, in main
  File "C:\Python27\Lib\multiprocessing\", line 488, in prepare
    assert main_name not in sys.modules, main_name
AssertionError: __main__

upgrade to python 2.7.11 becuase this is a fixed bug:; or
use a wrapper (.py file name should be not in sys.modules, main_name):

__requires__ = 'lettuce==0.2.20'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
        load_entry_point('lettuce==0.2.20', 'console_scripts', 'lettuce')()

Command Line Tool to Backup Local Files to Dropbox

Categories: Python; Tagged with: ; @ February 21st, 2016 16:32

main features

  • upload local file to dropbox
  • verify remote file after upload job completed
  • clear local / remote backup files to save space

how to use it

how it works

rabbit-backup uses dropbox api to upload local file to; // that’s why we need a dropbox access token.

Youtube Command Line Tool: download all videos by user / playlist 批量下载Youtube视频

Categories: Python; Tagged with: ; @ February 21st, 2016 13:50


  •  download all videos by user id 下载指定用户的所有视频
  • download all videos by playlist id 下载指定播放列表的所有视频
  • skip the previously downloaded files 跳过已下载视频


  1. pip install rabbityoutube
  2. set google api key
  3. ready to use: -u ChromeDevelopers /tmp/test/

for more details:

Python: start and connect to a sftp server using paramiko

Categories: Python; Tagged with: ; @ February 20th, 2016 22:24


  1. start a sftp server using python
  2. connect to the sftp server and list files


Docker python hello world project

Categories: LinuxPython; Tagged with: ; @ January 26th, 2016 23:12

create a Dockerfile 
this image will install python and start a SimpleHTTPServer:

FROM ubuntu
ENV DEBIAN_FRONTEND noninteractive
CMD ["bash"]

RUN apt-get update
RUN apt-get install -y python

CMD python -m SimpleHTTPServer 8000

Build project
docker build -t myapp:latest .
run docker image
docker run -P myapp
-P for port forwarding:  Publish all exposed ports to random ports
check the web page
find port by:
docker ps -l

This project can be found here:

Older Posts

// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.