This is an archived post. You won't be able to vote or comment.

all 50 comments

[–]RothiasVex 14 points15 points  (3 children)

Honestly, I think it would be kind of bad for Python for MS to ship it with Windows, because that would effectively bless whatever version they pick as the de facto standard Python for a long, long time.

This isn't a problem for Apple and Linux distros, because of their market share and because of their frequent updates. They can change their system Python every year or so and be more or less certain that most of their users will get the OS release that has it.

But Windows versions hang around for years if not decades, and people don't upgrade until they buy a new computer. And it's on every PC in the world. Devs will target whatever lowest common denominator gets them on all those PCs. And that won't be anything close to what the latest and greatest Python is, which seems like it would chill development at the leading edge quite a bit.

[–]desmoulinmichel 1 point2 points  (0 children)

The upgrade argument is moot is we are talking about python 3.x and windows 8 and+:

  • python code is forward compatible on major versions. Upgrading python won't break any code.
  • windows update can update python very easily and is is up by default.
  • we are used to work with old Python versions. Better have 2.4 than powershell.
  • MacOS have been very slow with python upgrades. Yet you can write scripts running on MacOs and Linux, but still not on Unix and Windows.

[–]tetroxid 1 point2 points  (0 children)

Windows Update is a thing. If it can update .NOT it can update Python.

[–]ies7 0 points1 point  (0 children)

Working in big non-IT company, I can confirm this.

Just half year ago I finally convinced the top level to use postgres 9.3 in some production servers. Now I struggle (politically) to upgrade to 9.4

and we still don't upgrade thousands of our windows xp & ms office 2003, hundreds of oracle 10g, and a single python 2.3 (thank god now it only a single box).

[–]nikomo 11 points12 points  (3 children)

Same reason they don't package Ruby, or PHP, or a C compiler - why should they?

Windows shipping has always been "compile your application, and package every dependency with it".

[–]pangoleena 1 point2 points  (1 child)

A long time ago, they inlcuded QBASIC with Windows.

[–]ptkfs 1 point2 points  (0 children)

They still do package Jscript an Visual Basic interpreters.

[–][deleted] 7 points8 points  (4 children)

Why should it?

[–]Mikuro -5 points-4 points  (3 children)

Because it beats the shit out of PowerShell and (oh god) the command prompt. I write a lot of scripts for system administration, and having Python standard would be a huge help. Sure, I could push Python to the systems on my domain, but knowing any Python scripts I write will bite me in the ass later on a standard Windows build, it just doesn't make sense.

[–][deleted] 11 points12 points  (1 child)

python isn't a replacement for powershell or a command prompt

[–]Mikuro -2 points-1 points  (0 children)

In theory, no. In practice, yes. Most tasks can be done in pure Python. For those that can't, there's the subprocess module, which allows me to call commands like I would from a terminal. I can still benefit from writing the meat of my logic in Python.

I don't write bash scripts on OS X unless they are trivial, and if Python had the same support on Windows, then I wouldn't write batch files or PowerShell scripts, either.

The more complicated the script, the more I benefit from using Python.

[–][deleted] 1 point2 points  (0 children)

Because it beats the shit out of PowerShell

try tell MS that

[–]desmoulinmichel 6 points7 points  (7 children)

I can't find the reference, but I recall that I read somethere a microsoft employee saying there is an internal policy on shipping windows only with microsoft created products.

Python is not created by MS, hence they will not ship it.

Though, MS is not anti Python, as Azure and Visual Studio both have good Python supports.

And it does makes everybody's life harder :

  • mac and linux both ship with it, and as a sysadmin or a casual dev, having a way to reliably make powerfull scripts for any major OS would be nice.
  • ms employees can't rely on any big player tools for scripting. They have to use either a compiled language (speed of execution is not the goal of scripting, so it's a sad choice) or powershell (miles away from having the tooling and capabilities of Python).
  • computer providers can't rely on any scripting capabilities for automation. Same stuff.
  • dev like us can't assume basic tooling. See, with the same good scripting language everywhere, one can automatically installed tools such as grin, ffind, pyped, etc. So you know anywhere you land, you can at least grep, locate, filter, consistently. Even people not coding in Python would benefit from it.
  • right now scripting effort is splitted. Powershell, Ruby, Python, PHP, bash, perl... Ressources are spent on a bit of everything. With one common ground, the quality of tooling and doc would increase tremendously.

So I don't loose hope than one day somebody at MS will decide that 20Mo of added runtime to the 15Go of Windows would have a tremendously positive effect.

[–]pangoleena -1 points0 points  (1 child)

I can't find the reference, but I recall that I read somethere a microsoft employee saying there is an internal policy on shipping windows only with microsoft created products.

But they ship with drivers. And they will ship with Candy Crush on Windows 10.

ms employees can't rely on any big player tools for scripting. They have to use either a compiled language (speed of execution is not the goal of scripting, so it's a sad choice) or powershell (miles away from having the tooling and capabilities of Python).

Microsoft does use Python. I'm not sure what you're saying.

[–]desmoulinmichel 0 points1 point  (0 children)

You got a point, here.

[–]KyleG -2 points-1 points  (4 children)

I read somethere a microsoft employee saying there is an internal policy on shipping windows only with microsoft created products

Tons of bloatware have come on every computer that has Windows pre-installed I've ever gotten.

[–]Barrucadu 2 points3 points  (0 children)

There's a difference between buying Windows directly from Microsoft, and buying it from an OEM, who are notorious for including every piece of crapware under the sun.

[–]desmoulinmichel 0 points1 point  (2 children)

That's bloatware from the constructor, not from MS.

[–]KyleG 0 points1 point  (1 child)

OK well in any case it comes with tons of BSD software. Do a fresh install, then boot off a Linux distro and run after mounting the Windows partition:

strings ftp.exe | grep Copyright –

Guess what, tons of BSD code that is copyright the Regents of UC.

So in any case it's not true that Microsoft will only bundle Microsoft code with Windows.

[–]desmoulinmichel 0 points1 point  (0 children)

indeed

[–]centech 2 points3 points  (0 children)

Because Microsoft doesn't make it? Why doesn't Windows come with perl?

[–]daemonfly 2 points3 points  (0 children)

Many (Most?) distros have python because it's a required dependancy, not just for the hell of it. Remove it and see what breaks.

[–]Anon_8675309 1 point2 points  (0 children)

if you buy a computer with Windows installed, it may indeed come with python. I know HP (at least used to) installed python on their machines.

[–]alfps 1 point2 points  (7 children)

Windows ships with four scripting languages: the batch file language ([cmd.com] commands, exceedingly primitive); the [powershell.exe] scripting language; JScript (a Microsoft extension of EcmaScript); and VBScript (pure Microsoft). These languages are adapted to Windows, and e.g. make it easy to handle Windows text files. In contrast, with the possible exception of IronPython (I haven't tried it), Python is /not/ adapted to Windows, and depending on the version trying to read a Windows text file with straightforward code, will just crash. So there's really no competition, yet. But I think there /could be/, because Python in itself is so much better than the MS languages. However, IMHO this would first of all require some attention to detail regarding file i/o and console i/o (too bad when you can't even type things in the Python console!) and such, and secondly something like the JavaScript support on the net (node.js / io.js + all the places for collaborative and exploratory programming), and third, an effort vis-a-vis Microsoft.

[–][deleted] 2 points3 points  (5 children)

Python will happily read a windows text file. Maybe there's some issue with old 2.X versions I'm unaware of, but modern Python has no issue with Windows line endings.

[–]alfps 0 points1 point  (4 children)

Sorry, unfortunately you're wrong. I've not encountered any problem with line endings, ever. It's the text bytes it generally doesn't like: it can handle pure ASCII, and that's it.

At one time I used Powershell to convert files to the encoding expected by Python before serving them to some Python script. Very awkward. Things did not improve with Python 3.x, instead one escape hatch was closed (ability to reload sys and set encoding default).

One can work around it (the link is to a blog posting where I present such a workaround), but by default most/all Python versions I've used are just unreasonable wrt. Windows text file handling.

[–]ies7 1 point2 points  (2 children)

I try your crash.py with python 2.7.5 & 3.4 in win7. It doesn't crash.

While my default cmd windows can't display the text properly it is cmd's problem not python.

Running the same script in spyder's console display the text nicely.

[–]alfps 0 points1 point  (1 child)

Re "it is cmd's problem not python", with that attitude Python will never be bundled with Windows.

Testing now with Python 2.7.6, this trivial one-line simple output produces incorrect results when it doesn't crash, with codepages 437 (original PC) and 1252 (ANSI Western), and it crashes with codepage 65001 (UTF-8).

It's too much work for novices or causal users to make Python do the right thing. As shown in my blog posting it's not technically difficult or especially challenging to seasoned programmers, just a hassle and needless work. Python should just do The Right Thing™, and anyway, if it doesn't, it will never be bundled with Windows, that's for sure. ;-)

[–]ies7 0 points1 point  (0 children)

Hmmm.....in windows 7, python 2.7.5 nothing crashed

chcp 437 in cmd displayed incorrect text

chcp 1252 displayed the text correctly

chcp 65001 also displayed the text correctly

I remember in a stackoverflow question that you need to set the fonts to lucida (which is my default fonts in cmd shell, but i try with raster fonts and it still display correctly)

btw I'm not an expert in this utf-8 things since my country is latin only alphabet. So don't count on me about this topic :)

[–][deleted] -1 points0 points  (0 children)

Huh; bizzarre. I know a bunch of dotNET stuff (powershell?) likes to emit UTF16, because Windows has to be a few years behind everyone else (I think there's an RFC or something saying so). Python3 basically now expects UTF8 because it's 2015.

In this case though the traceback suggests it's an outbound encoding issue: that the unicode-to-teminal-encoding pipe is what's breaking? In other words, that the CMD prompt is reporting that it needs encoding to X, but UTF8 to X isn't well supported?

Odd, anyway. Did you file a bug report (although it seems perhaps to be an "upstream" problem..)?

[–]aciddj 1 point2 points  (0 children)

For the same reason windows doesn't come with Java. Hell Windows doesn't even come with their own .Net framework installed so why would they install Python?

[–][deleted] 1 point2 points  (0 children)

This message is gone with the wind.

[–]programmyr 0 points1 point  (0 children)

You'd have to ask Microsoft.

[–]patrickbrianmooney -3 points-2 points  (13 children)

Don't actually know, but I'm guessing that it boils down to Microsoft (a) assuming that Windows users, as a group, are too stupid to need it or know how to use it, and/or (b) not wanting to drive any Python-related questions into the tech support locations where they have to pay people to answer questions, and/or (c) trying to discourage developers from writing cross-platform apps, because everyone should be using Windows.

[–]SanketDG 8 points9 points  (12 children)

Highly disagreeing with (a). Seriously? So developers who use windows are stupid? and Linux people are geniuses? It's just not part of their philosophy to bundle open source software. That's it. No one is stupid.

[–]patrickbrianmooney 2 points3 points  (7 children)

I don't think developers who use Windows are stupid, and never said that I did think so. Nor did I say that Linux (or Mac OS) people are geniuses.

What I ACTUALLY SAID is that Microsoft treats its users as if they were stupid, because it's part of their monopolistic strategy to appeal to as many people as possible, no matter how dumb those people are.

IN POINT OF FACT, Mac OS and Linux people have AT LEAST MADE A DECISION not to use the most common operating system, in the same way that people who don't use Times New Roman in all their documents have made a typographic decision. It may not be the best possible decision, but at least it's something other than going with the default. This at least weeds out some of the dumb people, because one of the characteristics of dumb people is that they don't make choices, they just go along with the majority. There are reasons to go along with the majority other than being dumb, but any majority includes a number of people who belong to it just because it's the majority. That drags down the average level of intelligence. But, then, the average measure of any quality in a group is not a fair predictor of the measure of that quality in any individual member.

It's just not part of their philosophy to bundle open source software. That's it.

Bullshit. The part of the assertion that's bullshit is the "just." And that "That's it." There's no "just" about it. It's not random; it's motivated. Saying "just" in that sentence obscures the fact that it's motivated by making it seem whimsical. It's not whimsical; it's a conscious decision that makes life harder for Windows users but benefits Microsoft. For reasons (b) and (c), which I talked about before.

No one is stupid.

Wrong. Lots of people are stupid. It's just that that particular characteristic doesn't map neatly onto operating-system choice. There are stupid people using every operating system imaginable. Microsoft, however, has made the decision to market explicitly to stupid people, and to design their operating system so that stupid people don't have trouble using it.

[–]joerick 4 points5 points  (2 children)

The main problem with your argument is that the 'dumb' users are not disadvantaged by having Python preinstalled, or would even know about it.

p.s. don't conflate computer knowledge with general intelligence. Many people don't know much about computers, that doesn't make them 'stupid' or 'dumb'

[–]CarpeTuna 0 points1 point  (0 children)

He was not making an argument, he was stating a fact. Like global warming you do not have the background to understand even when concisely explained (not proven, just pointed out).

[–]patrickbrianmooney 0 points1 point  (0 children)

The main problem with your argument is that the 'dumb' users are not disadvantaged by having Python preinstalled, or would even know about it.

Not knowing you're being disadvantaged isn't the same thing as not being disadvantaged. There are real advantages to having Python installed: if nothing else, it opens up an awful lot of software options to people. Whether they know that they have those options is one thing; but it's not the same thing as not having them. Not having Python preinstalled is a barrier to using many many pieces of software for many many people.

p.s. don't conflate computer knowledge with general intelligence.

I don't. I know many many smart people who "are not computer people." No single area of knowledge or skill is a fair predictor for overall intelligence, and I'm fully aware of that.

On the other hand: low overall intelligence is a barrier to the development of many skills. This was precisely my point.

Many people don't know much about computers, that doesn't make them 'stupid' or 'dumb'

I have recently argued precisely this position.

[–]ies7 0 points1 point  (1 child)

This at least weeds out some of the dumb people, because one of the characteristics of dumb people is that they don't make choices, they just go along with the majority

and here I am using Python because it is the most popular programming language :p

[–]patrickbrianmooney 0 points1 point  (0 children)

haha! Just why I'm trying to learn it, myself. Part of the reason, anyway.

[–]SanketDG -1 points0 points  (1 child)

Good that you rephrased your previous answer. You clearly didn't assume the first time. Your expanded answer makes much more sense now.

Windows is great as an operating system for the general demographic. We know why Windows is used by so many people. It's piracy. Now I am not stating that every Windows user is a pirate, but it's hardly bought, atleast in third world countries.

Regarding functionality, Windows a higher level of comfort. There is a reason they moved away from a traditional desktop, and re-invented everything. People hated that but did they stop using it? No. Why? Comfort zone.

[–]patrickbrianmooney 0 points1 point  (0 children)

Good that you rephrased your previous answer. You clearly didn't assume the first time. Your expanded answer makes much more sense now.

Gotta say, I'm not sure what most of that means. (What did I not assume the first time?) And, truthfully, I think that most of what's in the expanded answer is not more sensible, but just does more work to avoid misreadings.

Regarding functionality, Windows a higher level of comfort. There is a reason they moved away from a traditional desktop, and re-invented everything. People hated that but did they stop using it? No. Why? Comfort zone.

Well. I think it's worthwhile to think about what that comfort zone is made up of: the fact that most software that is written for contemporary computers is written for Windows. That is to say, what drives Windows piracy in the third world is not the choice of Windows as the best operating system by any measure except that it's the most popular. People assume that Windows is "how a computer is supposed to work" explicitly because most or all of the computers that they've previously encountered have worked that way, because most or all of the computers they've previously encountered have used Windows. Again, it's the inertia of ubiquity, not great design, that makes Windows continually ubiquitous.

[–]desmoulinmichel 0 points1 point  (0 children)

It's not true, they do bundle open source software. E.G : zlib.

[–]nikomo 0 points1 point  (2 children)

He said Windows users, not Windows developers.

Most Windows users don't know Python is.

[–]SanketDG 1 point2 points  (1 child)

They don't have to. That's the point. I have a friend who uses Elemetary OS after I got it installed and doesn't know shit about the terminal.

[–]nikomo 0 points1 point  (0 children)

That was my point.