Skip to content

An example Python extension on Windows for my personal reference.

License

Notifications You must be signed in to change notification settings

yottaawesome/python-win-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A simple Win32 extension for Python

Introduction

This is a just a quick-and-dirty example of a simple Python native extension on Windows for my personal reference. The lessons learned here will be used for my Python Onyx32 extension. It is mostly based on documentation from Microsoft.

Using this repo

To run this repo, you'll need:

  • Install VS Community 2019 with "Desktop Development with C++" and "Python development" workloads.
    • With the Python workload, you'll need miniconda (for creating a virtual environment), Python native development tools, and a Python 3 64-bit environment.
    • Make note of where VS installs your Python environment (on my machine, VS installed Python into A:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64).
  • Set the build to x64 and configuration to Release when opening the Solution.
  • Create an x64 Python 3 environment named env in VS under PythonExtension project > Python Environments.
  • In the superfast project's properties, you'll also need to:
    • Update VC++ Directories > Include Directories to the location of your Python installation's (as per above) include folder.
    • Update Linker > Additional Library Directories to the location of your Python installation's lib folder.

Useful resources

About

An example Python extension on Windows for my personal reference.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published