vs linux python,Running python on a Windows machine vs Linux

本文讨论了学习Python但Linux技能不足者开发中大型Web应用的顾虑,指出Python在Windows上运行性能与Linux相当。开发者需关注路径处理和特定于Windows的测试,同时强调C++库与Python集成可能因平台而异。Linux被推荐为Python开发的优选,尽管Windows可用,但在性能和开发便利性方面,Linux更胜一筹。
摘要由CSDN通过智能技术生成

可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):

问题:

I am interested in learning python but my Linux skills suck. I would like to develop a medium to large scale web application using python and django but afraid the software may not work well on a windows box. Is there a performance difference in running python on Linux vs Windows? Is there anything that I should watch out for when developing the application. Also, I am aware that it is very easy integrating C++ libraries with python. Is this statement still true is the code is on a windows box?

回答1:

Don't tell anybody this, but I've run python/django on windows. It works all right and the performance hit isn't any worse than you would expect from windows. I used MySQL and it installed without a problem. I had to grope around to find out how to manage it (no good ol' sudo /etc/init.d/mysql restart but i eventually found a graphical interface to do what I needed.

回答2:

but afraid the software may not work well on a windows box.

Your software will work. The Windows OS may not work as you hope. But that's Windows, not Python.

We develop 100% on Windows. We completely test: Unit test, integration test and user acceptance test on Windows. 100%.

We deploy for production 0% on Windows, 100% on Linux.

We have a few (less than 6) differences in the unit tests that are Windows-specific.

The application has no changes. It works with Apache or not. It works with SQLite or MySQL.

回答3:

I've been working Py on both Windows and Linux. I favor Linux because of several things:

virtualenvs - once you start working with virtualenvs, there is no turning back.

SHELL - CMD is very frustrating when executing python/management commands in django. Also, you should add python.exe every time :).

ipython works better on Linux.

GeoDjango doesn't work on Vista/7 last time i checked. I spent 3 days trying to set it up. Just for comparison, i set GeoDjango-able development environment in 20 minutes in Linux.

Linux is free :)

Although there is no visible performance impact or incompatibility when working python cross-platform, the benefits of Linux for python development outweigh Windows by a lot. It's a lot more comfortable and definitely will boost your productivity.

...

IMHO Linux is the smart choice for Python development.

回答4:

Python program is very easily portable. Most of the time your code will work on any platform that have the appropriate version of python.

One point to be aware of though, is file path handling. Linux, Windows, Macs, etc uses different path schemes, so you shouldn't be handling them as strings; instead use os.path functions to join, split, etc.

There is ultimately some slight performance difference with regard to timing, threading, processing, I/O, but they're nothing to worry about.

Integrating Python and C++ is easy; the only problem is in the C++ side, i.e. you will have to recompile the C++ code.

回答5:

Shouldn't be a problem. Some people even host Python+Django on Windows.

回答6:

Which software are you affraid will not work on windows, the actual web app or your development enviroment. If you mean the IDE, then I wouldn't worry about that there are very good python IDEs for windows, as for the webapp that's another discussion all together

The statement that "it is very easy integrating C++ libs with python" is not accurate, there are many ways of doing it and they are not all easy, I have personally only tried SWIG, but there are many other alternatives (for example Boost.Python), whoever I wouldn't believe it is as easy to get up and running with some of these tools on a windows enviromeny with out something like mingw or cygwin as at least SWIG is built with *nix in mind

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值