# Python, foreign functions and Steam

DevFeed: [Python, foreign functions and Steam](<https://devfeed.tech/articles/python-foreign-functions-and-steam-29371.md>)

Original publisher: [Read original article](<https://arturdryomov.dev/posts/python-foreign-functions-and-steam/>)

Author: Artur Dryomov

Published: 2023-08-01T00:00:00Z

Content type: tutorial

Language: en

Sources: [Artur Dryomov](<https://devfeed.tech/sources/artur-dryomov.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [SDKs](<https://devfeed.tech/topics/sdks.md>), [C](<https://devfeed.tech/topics/c.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Steam Deck](<https://devfeed.tech/topics/steam-deck.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [linux](<https://devfeed.tech/tags/linux.md>), [macos](<https://devfeed.tech/tags/macos.md>), [python](<https://devfeed.tech/tags/python.md>), [sdk](<https://devfeed.tech/tags/sdk.md>), [steam-deck](<https://devfeed.tech/tags/steam-deck.md>)

## AI overview

A tutorial on calling foreign C functions from dynamic libraries in Python, using the Steamworks SDK as an example. It covers linking dynamic libraries, declaring C function signatures, and interacting with Steamworks interfaces from Python.

## Source excerpt

Language ecosystems are not perfect. Sometimes resulting executables are performant but the syntax is horrible, sometimes there is a nice package manager but standard functions are scarce to a fault -- it's all about the compromise. Python is nice to use but the performance might be not great. The latter causes such tools as NumPy to emerge. How does it work? Well, it uses C calls -- essentially borrowing performance improvements from the C ecosystem. In this article, I'll show how to use foreign C functions from dynamic libraries in Python. Calls will be done to the Steamworks SDK which games use to communicate with Steam.