Python portable, linux & windows

ぐ巨炮叔叔 提交于 2019-12-18 13:33:21

问题


I am using linux at home but at school we use windows 7. I want to have python installed on my usb to that I can use it for both windows and linux (ubuntu 13.04). Is there a way that I can install python on my usb so that both win and linux computers can use it? I am more interest in python 2.7. I have Wine installed on my linux machine. It might no be ideal but could I use portable python and run it under wine?


回答1:


You can install two python's. Download Anaconda from http://continuum.io/ website for linux and windows. Install them (on win and lin machines) and then create two environments on your USB using the conda package manager:

# Windows
conda create -p E:\pywin python all other packages you want
# Linux
conda create -p /mnt/usb/pylin python all other packages you want

Then use the pywin environment on windows and pylin on linux.

# Windows
D:\pywin\python.exe your_script.py
# Linux
/mnt/usb/pylin/bin/python your_script.py

With conda you will be able to maintain the same packages in both environments so you'll have everything you need on both systems...

Or you can install the Anaconda directly to the USB, but that will require more space...




回答2:


You could always try a browser based solution with the files hosted in .txt files on Google Drive or Dropbox. Skulpt.com syncs with GitHub too, so you can work that way.



来源:https://stackoverflow.com/questions/19170669/python-portable-linux-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!