r/programming • u/speckz • Jun 07 '19
Win10 is going to start including Python 3.7
https://blog.adafruit.com/2019/06/04/new-guide-python-is-in-the-latest-build-of-windows-10-adafruitlearningsystem-python-adafruit-win10-windows-adafruit/98
u/SuperRoach Jun 07 '19
Hey, the stock python is more up to date with windows than ubuntu now..
45
23
u/tracernz Jun 07 '19
Ubuntu has never had latest packages. That's rolling release distros like Arch, Fedora Rawhide etc.
5
u/__gareth__ Jun 08 '19
You should never use the system distribution of Python (or Ruby), it is included to support the functioning of the OS, such as
apt-get.1
u/SuperRoach Jun 08 '19
Should it be accessible to the user at all if we should never use it then?
1
1
Jun 08 '19
Why would you use the stock Python installation for development? You're just going to pollute the global package repo. Use virtualenvs instead.
4
u/lanzaio Jun 08 '19
You're missing the use case for the majority of python users - it's a scripting language. Most python users don't use it as a full programming language and they just write
#!/usr/bin/env python3scripts.2
u/SuperRoach Jun 08 '19
Why not? for someone who wants to jump in and code right away, instead of doing that you are throwing a book at them with a bunch of barriers. That gets in the way of Pythons "one true way" ethos a bit I feel. But can see why they go for the versions they do, I just don't like the difficulty it is in onboarding new users who havn't had this conversation yet.
1
u/lanzaio Jun 08 '19
That's by design. Ubuntu isn't a rolling release distribution. It's a stability based distribution.
10
46
Jun 07 '19
For a second there I thought that said Python 2.7! "Nooooo!"
23
Jun 07 '19
It is very exciting to come to the comment section and see everyone‘s internal thought process laid out to the second.
0
0
26
Jun 07 '19
So Windows is going to be including Python in its store, and OS X is dropping Python entirely.
38
u/aldonius Jun 07 '19
The Mac users upthread are celebrating, because soon they won't have to worry about the outdated system installation.
-14
Jun 07 '19
If they didn't want to worry about it, they didn't have to use it. The problem if for people who did use it or made applications that relied on Python 2.7 being installed.
21
u/rtbrsp Jun 07 '19
It is not nearly this simple. The stock Python installation was previously relied on by utilities such as LLDB. Even prefixing your
PATHwith a different installation such as/usr/local/bin/pythoncaused issues with LLDB.3
Jun 07 '19
Lmao. I didn’t want to use it and yet I still had to worry about it. Whenever I do a clean install on my Mac I have to think “what did I do last time that didn’t leave it in a mess”.
Still causes the odd hiccup from time to time. Thank god they’re ditching default install. Just make it easy to install the latest version at that time, like windows is doing.
5
-25
Jun 07 '19
That's because Mac is for braindead "professionals".
12
u/EnfantTragic Jun 07 '19
Nah, developing on Mac is a way better experience than Windows, at least for someone coming from Linux programming
8
Jun 08 '19
That's one of the things I envy about Mac devs. Unix command line is best command line.
Before going to college and doing way more development, I never thought that I'd be such a fan of *nix
7
5
u/_EndOfTheLine Jun 08 '19
I dunno, I develop on a Mac and seeing the strides WSL has been making in such a short time has me wondering how long that will be the case.
3
u/EnfantTragic Jun 08 '19
I love WSL, so if it can match the Mac command line, then it would be amazing
7
1
u/Antrikshy Jun 07 '19
Well, at least it's better than Windows for development unless you develop stuff for Windows.
25
u/Science-Compliance Jun 07 '19
What I'd really like to see is Microsoft writing software that makes it easy to turn Python scripts into Windows executable files. I was pulling my freaking hair out trying to get some third-party modules to do what I wanted them to do and still don't have an application (granted, I didn't persist with that effort because it was "nice to have" but not necessary for the time being).
21
u/istarian Jun 07 '19
If you want Windows executables why not just use .NET?
1
u/tracernz Jun 07 '19
There's still no way to write a cross-platform desktop app in .NET AFAIK?
7
u/pb7280 Jun 07 '19
Xamarin has support for macOS now and I believe Linux is in beta (also WPF, UWP, Android, and iOS)
1
2
u/YM_Industries Jun 08 '19
Does Avalonia meet your definition?
1
u/tracernz Jun 08 '19
If/when it becomes production ready, it looks good.
1
u/YM_Industries Jun 08 '19
I think Avalonia is production-ready, I've used it in an (admittedly very simple) production app.
If you're happy to wait a bit longer, WPF Core should be good. Should hit General Availability in September.
3
u/tracernz Jun 08 '19
Says on the GitHub readme that it's only beta quality. WPF Core should indeed be good on Windows, but sadly not cross platform.
2
u/YM_Industries Jun 08 '19
Wow, I was misinformed. I thought WPF Core would be cross-platform. That's disappointing.
Looks like Avalonia is still the best option then. I just wish the documentation was better.
2
u/istarian Jun 07 '19
Depends on your definition of cross platform?
I haven't done it but there is Mono in addition to .NET under Wine. .NET wouldn't be a native application per se, regardless
4
u/tracernz Jun 07 '19
I had somewhat forgotten about Mono, and it looks like Gtk# could do it. Given that .NET Framework is dead I expect .NET Core will be getting a lot of improvement in this area soon.
1
u/1RedOne Jun 08 '19
There won't be for the foreseeable future, wpf and WinForms both depend on Windows handles, it would be a metric boatload of effort to make it happen.
Avalonia is a project trying to do just this.
1
u/pknopf Jun 08 '19
1
u/tracernz Jun 08 '19
That works, although with Qt I'd rather go first-party and write the wrapper app in C++.
0
Jun 07 '19
[deleted]
9
u/istarian Jun 07 '19
???
0
0
Jun 07 '19
[deleted]
5
u/atomic1fire Jun 07 '19
Which is funnier because you can use .net with powershell to make little scripts too.
Granted Powershell core's scripts might not be as useful outside of windows, you can do some somewhat entertaining things from windows powershell just by using .net and the COM api. For instance building a GUI in Windows Forms.
In fact anything that can be accessed from COM, or .net, can be manipulated from powershell. Personally I think it's a lot of extra effort for a script, but you can do it.
1
6
u/radol Jun 07 '19
Yeah, some time ago I though that if python is so popular, making exe for it would be as easy as for example autohotkey script. So after many bumps I managed to make .exe for small python tool (which used pandas) to quickly analyze large amount of input data, and whole app directory turned out to be like 120mb. Few weeks later I did same tool using c# (utilizing linq) and targeting .net 3.5 so nobody needs to install anything even on outdated systems, and whole app was like 500 kb
1
u/Science-Compliance Jun 07 '19
I'm going to have to look into .net at some point. I did get a couple simple command line applications to work with pyinstaller, but the application in question had a tkinter GUI that wouldn't render with 3 separate tools I used (pyinstaller, py2exe, and cx_Freeze). cx_Freeze wouldn't even pip install with Python 3.7, and I had to downgrade to Python 3.6 to get it to install (still didn't work, though). I, too, expected it to be a piece of cake given Python's popularity.
3
u/ArkyBeagle Jun 08 '19
This is a critical reason I still use Tcl.
3
u/schlenk Jun 08 '19
tclkit is great for that, but Python actually copied a lot of the features in pyinstaller (still no vfs support, and much bigger runtime), but it usually works.
2
u/George_Rockwell Jun 08 '19
py2exe has worked well for me
1
u/Science-Compliance Jun 08 '19
What version of Python are you running?
2
u/George_Rockwell Jun 08 '19
At the time of me using py2exe, it was python 2.7. might be out of date now, but it worked well at the time for what I needed to get done.
2
u/Science-Compliance Jun 08 '19
Yeah, I don't think it works very well if at all with Python 3, which is what I'm using (3.7). Unfortunately, the differences between 2 and 3 are big enough where a downgrade is not really feasible.
4
36
u/tracernz Jun 07 '19
This is great news. One more nail in the Python 2 coffin, and one less hoop to guide Windows users through.
7
u/upofadown Jun 07 '19
I suppose that any language made easily available other than Py2 is a nail in that particular coffin.
6
u/imhotap Jun 07 '19
Could someone knowledgable in the Windows world tell me if WSL (Win subsystem for Linux for running Ubuntu programs) is now installable on any Windows machine, or still just works with Win Pro? There seems to be a Creators Update or so, but I can't figure it out. Asking for a friend who wants to release a nodejs app (mostly for Linux and Mac, but would be helpful to know if it could run on Win without Docker so people don't get a bad experience).
13
3
u/EnfantTragic Jun 07 '19 edited Jun 08 '19
You can do it on the Home edition. What you will miss from the Pro edition is Hyper-V, which is an inbuilt way to run virtual machines. Docker for Windows relies on it, but you can do without using Oracle VM and Kitematic
5
u/MaxGhost Jun 08 '19
But with WSL2 you'll be able to run docker! Coming soon.
2
u/Herm_af Jun 08 '19
So excited. Docker, manipulating Linux files from Windows, and much much faster. That and terminal are going to be awesome. I was dual booting but that in itself is a pain. I did like developing in Linux though. This is huge
1
3
u/nsomnac Jun 08 '19
This may have changed since Windows 10, however HP had ActiveState Python installed on every consumer computer they sold since Windows XP. It wasn’t linked to the Path, but it was there to support their system recovery.
Source: I designed and implemented an early CI/CD system for building and testing their OEM PC disk images.
2
2
5
u/StatusDecline Jun 07 '19
Could someone ELI5 the relationship between an OS and a programming language? OSes are written in a language (Ex: iOS in Objective-C), so what does it mean to include a language in an OS? Does the OS have a translator into the native language before the compiler?
36
u/killerstorm Jun 07 '19
so what does it mean to include a language in an OS?
From operating system's point of view Python is simply a program like anything else. So it just includes one more program (or allows you to install it easily).
17
u/Objective_Mine Jun 07 '19
I don't know how much of an ELI5 you want, but...
Python is generally an interpreted language rather than being compiled into native code (such as the OS itself would have been), so in order to run programs written in Python, you need to have a Python interpreter. In addition to the interpreter, the Python platform is considered to consist of the Python standard library that includes common functionality that can be expected to be available to programs written in Python, and possibly some other tools.
Including Python in the OS would mean including those components, which would allow you to run programs written in Python, and to write your own. You could do that anyway by downloading and installing the Python platform for Windows but after it's included with the OS, you can run and develop Python programs without having to do that.
The Python interpreter is a program that executes Python code on the go. It's not a translator to another programming language such as C which would then be compiled to native code. (Native code means executable code that can run directly on the computer hardware. A programming language used for the OS itself, e.g. C, could be considered "native" to the operating system in some sense but it's not called native code. The C code compiled into executable form would be called native code.)
Other languages such as C, C++ and Objective-C are compiled languages. Code written e.g. in C would be compiled into native code that can then be run directly on the hardware. "Including" a language like that in an OS would probably mean including a compiler needed for developing new programs.
A compiler would not be needed for running a program written in C, such as the operating system itself, because it has already been compiled when it ships. Thus, an operating system written in C may or may not ship with a C compiler. You might still need to have the corresponding standard library available even at runtime, though.
4
u/iLumion Jun 07 '19
Correct me if I’m wrong but don’t interpreted languages get translated on the go? For example python compiles very quickly to .pyc and that file is interpreted which translates itself to machine code on the go?
4
u/Feynt Jun 07 '19
Yes, Python compiles your source seamlessly to .pyc files when you attempt to run your program, so the initial run of the program is slightly slower to get going (very, very slightly). The .pyc files are bytecode which is very easy to interpret in comparison to monkey pawed variable, function, and class names in plain English. This compile step happens any time the associated .py file is changed. For most libraries, that's never, but any program you're actively working on will have its source files recompiled with each change.
4
u/TheSkiGeek Jun 07 '19
Depends on the details of the interpreter.
Java, for example, is "compiled" to JVM bytecode, which is then "interpreted" in some way (possibly JIT compilation to native code).
If you go far enough down, even "machine code" is "interpreted" in some cases. Both Intel and AMD slice x86 instructions up into "micro-ops" that get potentially reordered and scheduled onto hyperthreads, and do stuff like register renaming on the fly.
1
u/Objective_Mine Jun 08 '19
Yeah, thanks for the additions. I didn't know how to keep it ELI5, and, to be honest, I wasn't quite sure if Python actually gets JIT compiled (maybe on Jython?), so I stuck to the basic cases.
5
u/Thiras Jun 07 '19
There is no relationship apart from the fact that an OS is written in a (compiled) programming language.
Programming languages are split into two VERY broad categories, compiled and interpreted. Compiled languages go through a compiler to transform source code (the text) into a program (1's and 0's) that are run by your computer directly. Interpreted languages are run by an interpreter (itself a compiled program), which reads lines of text from the code and performs the operations specified by the code.
Python is the second category, and this story relates to the interpreter for python, not any particular python code.
7
u/wlllb Jun 07 '19
I would say, rather, that a compiler takes the source code and simply maps it to a lower level representation which could be, but is not exclusive to, machine code.
javacis a compiler that outputs JVM bytecode for example, and then you could also argue that the JVM itself is an interpreter operating off that bytecode3
Jun 07 '19
By including it they just mean the Python interpreter would be installed as default, the way it had been on OS X for years. It doesn't really have anything to do with the OS itself;
HOWEVER, there is a caveat. If an OS is including the Python interpreter by default, then developers can assume that it is installed on a system running that OS and make programs and applications that assume that as well. So you could make use of the interpreter. OS X removing Python may very well break legacy applications that rely on Python.
0
u/billsil Jun 07 '19
By including it they just mean the Python interpreter would be installed as default,
No it won't. It will be available in the Windows Store for free. It will not be maintained by Microsoft and instead the PSF.
the way it had been on OS X for years
Not as of the next version.
3
Jun 07 '19
No it won't. It will be available in the Windows Store for free. It will not be maintained by Microsoft and instead the PSF.
Yes, I know, hence would be and they mean.
Not as of the next version.
had been
2
u/Ilmanfordinner Jun 07 '19
Imagine you want to write your own operating system for your computer. You have a few options on how to do so:
You take out the hard drive, attach it to a machine that can write bytes to it one by one. The issue is how do you decide what bytes to write? Well, there's this manual that the people who designed the hardware made that tells which bits correspond to which commands on the computer. So you go through the difficult process of breaking down your operating system into very simple commands that the computer can understand directly and then write the entire thing to the hard drive. People did this when computers were simpler and the alternative process did not exist. This is called coding in Assembly.
You already have a working computer so you think for a moment "Hmmmm, I'm going to be reading from the hard drive a lot of times. The Assembly code for reading a file on my machine is very long and writing it by hand would suck. How about instead I make a program that substitutes something like
mem[addr] = file.read(filename)for that long bit of Assembly that reads a file and stores it in the memory at address." Great, but what if you do the same for other useful things? What if you do it for everything? Well, eventually you're going to have so many of these "commands" that you've made up and given meaning to that it kinda resembles a language. So the main thing that differentiates between the languages is what "commands" they have and how broad they are.In any case, what you need to remember here is that OSes are either written manually using Assembly or using a programming language on another computer such that that computer can understand it. In other words that language is installed on the computer. Hence, this discussion on bundling Python with Windows.
(Note: this is super simplified)
1
u/iLumion Jun 07 '19
In short and very very simplistic and basic:
All programming languages compile down to machine code in some way. The machine can read the code and act on it. So basically every OS should be able to process every language given they have the supporting tools.
To take iOS as an example: iOS has been mostly written in C or C++. The apps however can be written in objective C, swift or C. But, there are some frameworks which allow you to write code in an entirely different language (Xamarin for example) which compiles down to native machine code so iOS can understand it. Even though Xamarin uses C#, a Microsoft language.
Keep in mind that this is very basic. Don’t take this to seriously. If you want to know more this should at least give you a simple base to research further upon. As not all languages are compiled etc.
1
u/bumblebritches57 Jun 07 '19
No, C, C++, and Objective-C are al compiled into machine code.
there is no intrepreter nessicary, in fact MacOS and Windows don't even include compilers out of the box.
1
u/Feynt Jun 07 '19
An operating system (OS) is a program itself which has been made to control access to the various components of the system it's installed on. RAM partitioning, disk fragmentation, video card access, everything. It's partly security (no accessing RAM some other program has assigned to it, so no reading someone's password for example), and party sanity (no you can't open the serial port, someone else is using it. One at a time, no touching!). As with all things man made, there exists loopholes and oversights for all the puzzles here (which is why viruses can do both of those things) using exploits that some otherwise brilliant person didn't realise would be a thing. Obviously, the above is a gross simplification, but moving on...
Programming languages in general have little direct relation to an OS in particular. C++ works the same on macOS, Windows, Linux, FreeBSD, DOS, and so on. At least at a basic level (variables, for loops, etc.). Where things get dicey is if you want to execute the program, you need to compile it to match the operating system it's being run on (C++, Assembly, etc.) or have an interpreter to run the code you typed (Java, Python, etc.).
Firstly compiling, you would need a collection of the special rules and interfaces that the OS is providing to interact with all of the system (the libraries). The compiler turns all of your plain text words into a collection of bytes which mean something to the computer when the OS begins execution. Your compiled program has an OS agreed upon start location, and when loaded into memory and run through, will perform certain actions on the hardware to achieve a result.
Interpreted languages (like Python in this case) ditch the need to compile your code against a set of OS specific libraries by compiling the code to more portable formats (most commonly a bytecode format, which is supposedly a step or two removed from actual machine code). Instead, the interpreter itself needs to be compiled to run against these libraries. This has the advantage that you can write code once and then reuse that code across multiple computers regardless of the OS (as long as an interpreter exists). So code you write on Windows will in theory work on Linux or macOS just the same.
Either way, when a program runs on an OS, it's interfacing with it instead of directly with the hardware itself. Actually writing an OS requires super low level programming (done in compiled languages, often Assembly). Often a means of writing this program is necessary and accomplished from an outside source. But an OS is just a fancy program that lets other programs interact with it. The before times of the Apple IIc or even the Vic20 basically had you sitting at the most basic of OSes, ones which basically only made it possible to write programs that had this bare access to the computer without needing more basic tools such as magnetic tape writers.
The reason this whole Python thing is such a big deal is because many developers work across a few different operating systems, and doing Python programming on one to affect all of them makes life a lot simpler. Instead of having to recompile your program on each OS, as you would with say, Photoshop or Word, you can write it once (Microsoft hopes dearly that you choose its expensive OS instead of macOS or Linux) and then distribute to the others straight away.
1
u/khoyo Jun 07 '19
They are not talking about including the language* in the Windows kernel, just bundling it like they do for eg. Word, Excel, Internet Explorer, etc, in the general product.
* And by the language, we mean the compiler/interpreter.
-4
u/inarush0 Jun 07 '19
This just means windows 10 will come with python 3.7 installed, so you don’t have to install it from python.org
24
u/xerios Jun 07 '19
That's not what it says. It says that typing "python" or "python3" in command line will open up the microsoft store window to install it.
I'm on the latest insider build and that's pretty much what it does. Having it pre-installed would've been nicer but this is fine nevertheless.
2
u/billsil Jun 07 '19
I disagree that it would be nicer. That would mess up my install of Python. I'm a big kid; I can manage it myself.
-1
u/AngularBeginner Jun 07 '19
Awesome... More trash in the PATH variable.
1
u/stewsters Jun 07 '19
Yeah, that doesn't sound incredibly useful if its only python. Might just want to update the message that it gives you if the command is not found. In Ubuntu, if I type a command that doesnt exist it will suggest similar commands from the repo, not perfect but a lot more general.
~$ pdthon Command 'pdthon' not found, did you mean: command 'python' from deb python3 command 'python' from deb python command 'python' from deb python-minimal Try: sudo apt install <deb name>1
Jun 07 '19
Who doesn't love a PATH configurations?? That's clearly the future! /s
-15
Jun 07 '19
[removed] — view removed comment
-18
u/Anti-The-Worst-Bot Jun 07 '19
You really are the worst bot.
As user MoSqueezin once said:
BAd bot
I'm a human being too, And this action was performed manually. /s
1
u/ovrdrv3 Jun 07 '19
Has anyone installed WSL on win 10 similar to this article?
https://itsfoss.com/install-bash-on-windows/
How was the experience? Thanks
2
u/Herm_af Jun 08 '19
It's pretty slow for npm install and such and you can't run docker (easily )
Also just adds little quirks that are annoying.
However when wsl 2.0 comes out ill use it for everything.
1
1
u/Tarbogman Jun 07 '19
Haven't read all the comments here, but still I wonder how well pygame will cooperate with this?
1
1
1
-8
u/AwesomeBantha Jun 07 '19
I see this as an absolute win!
3
u/monkey-go-code Jun 07 '19
When is this meme going to die
0
u/twisted-teaspoon Jun 07 '19
Presumably that is impossible because as soon as it does, some meme-using pleb will use it to celebrate its death.
-6
-26
u/lambda-panda Jun 07 '19
Does the world need Microsoft anymore?
22
u/KevinCarbonara Jun 07 '19
For the past decade they've been far outpacing their competitors. C# makes me wonder if the world needs Java anymore
13
u/topcat5665 Jun 07 '19
And in the past few years I feel they've become a much better company with the open source stuff they are doing, e.g .net core and the like.
-1
u/lambda-panda Jun 08 '19
I feel they've become a much better company with the open source stuff they are doing
That is only because they feel like they are loosing relevance. It is an act. The first phase of EEE. I am surprised that people still falling for it...
1
7
Jun 07 '19
Java devs finally got
varlike last year or something lolI've done some small personal andriod apps in Java and my god. Doing basic shit in C#/.NET that takes like 3 lines is like an entire fuckin class in Java with 40+lines.
5
u/KevinCarbonara Jun 07 '19
Java still has no auto properties. We have to choose between either writing our get/set functions manually (or letting the IDE generate them automatically), clogging up our code, or we can rely on a third party plugin called Lombok to generate them automagically, leaving our classes clean, but the rest of our code cluttered with references to getId() functions that, by all appearances, don't exist.
Of course, the big one is Linq. Java got Streams, but it is nowhere near as elegant as Linq. Which is surprising, because they had a great example to learn from. I think Java developers legitimately want their development to be lengthy and over-verbose, maybe it gives them job security.
5
Jun 07 '19
plus Visual Studio just is an amazing IDE with no real competitor IMO.
Either you choose Eclipse or IntelliJ IDEA... and both are laggy shits. Maybe its changed, but that was my experience years ago.
3
u/Answermancer Jun 07 '19
IntelliJ is actually pretty great these days, but hilariously I think it's biggest downside is that it's written in and runs on Java.
-1
-4
763
u/Philippe23 Jun 07 '19
The title is highly misleading. In reality, "[...] every install of Windows starting with the May 2019 update will include python and python3 commands that take you directly to the Python store page."
So python's just available from the store, it's not pre-installed and ready for use on all Win10 machines....