Better Python Integration in Windows: Shebangs and Version Selectors

I’ve written several times on efforts to make Python better on Windows. I also have an outstanding request to the Windows 10 team to get Python built directly into Windows 10 (please upvote it!). In this post, I’ll show you some very simple techniques to put Python on Windows relatively on par with Python on OS X and Linux.

On OS X and Linux, we can use a special kind of comment at the top of our script called a shebang.

#!/usr/bin/env python3
# normal python code here...

Continue reading

Shipping Python with Windows 10

Python is awesome but Python on Windows always feels like the red-headed step child. With Window 10’s UserVoice campaign, you can help me change that! Let’s start here:

Please vote for this request on UserVoice:

Ship Python 3 and Python 2 with Windows 10

Ubuntu and OS X include the Python runtimes by default. Please Include the 64-bit version of Python 3 and Python 2 with Windows.

I believe many developers choose OS X and Linux over Windows because these OSes are more open source and CLI friendly. You have done a lot of fix the CLI experience in Windows 10. Please make Python development better on Windows by including it out of the box.

Need more inspiration? Watch this video about the future of Python (hint: it involves Windows)

Boot to VHD Screencast

WARNING: This is some advanced stuff. It’s not that hard, but you can break things that are hard to fix. So, there is no warranty express or implied. Windows 7 or Windows 2008 Server R2 are required.

Have you heard of the new feature in Windows 7 and Server 2008 R2 called Boot to VHD? It is amazing! But it’s one of those concepts that people hear about and think “hmm, interesting.” But when people see it in action it’s “OMG, I must have this!”

I recently had that experience myself and enough people asked me about it that I decided to do a quick (15 min) screencast how to setup a native boot to virtual hard drives.

If you want a great overview and step-by-step instructions, check out Scott Hanselman’s blog post:

Less Virtual, More Machine – Windows 7 and the magic of Boot to VHD

If you want to see boot to VHD in action, then check out the video here:

Gmail New Mail Notifications for Windows 7

[Update: Renamed this tool from Gmailer to Gmail 7 due to pre-exiting product name conflicts]

I’ve been using Windows 7 as my sole operating system since Beta 1 in January. I’m completely loving it and I was pleased to see how many apps worked seamlessly on it. One that didn’t and I really miss is Gmail Notifier. No matter how I try, I always get this:

It’s insane to me that $130B company can’t provide any more than this outdated tool for this job, but I digress…

I’ve looked and looked for a replacement and they are either no longer online, are crappy applications, and so on. Finally I decided to take matters into my own hands. Introducing a clean, simple, unobtrusive, and free Gmail notification application that works on Windows 7Gmail 7:

Continue reading

System.Transactions and Windows Vista NTFS (Updated)

I’ve been playing with my fresh copy of Vista Ultimate – which I am surprised to find that I absolutely love.

Being a big fan of System.Transactions, I naturally wanted to use it with Vista’s TxF (Transactional NTFS) file system. But unlike the data libraries, the file APIs don’t auto-enlist in the transaction. In fact, there are only COM / PInvoke APIs currently.

There is a nice article about how to work with these APIs in the MSDN article: “NTFS: Enhance Your Apps With File System Transactions”. But I was unimpressed with the managed wrapper they created there. In particular, I don’t like that the lifetime of the file stream is not forced to be part of a client initiated transaction scope. So I built my own transactional file stream in C#. With this TxFileStream class, you can write succinct code like this:
Continue reading