How to use pythonnet - 3 common examples

To help you get started, we’ve selected a few pythonnet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fkarb / pythonnet_old / pythonnet / demo / helloform.py View on Github external
def main():
    form = HelloApp()
    print "form created"
    app = WinForms.Application
    print "app referenced"
    app.Run(form)
github pythonnet / pythonnet / pythonnet / setupmono.py View on Github external
retcode = process.poll()
    if retcode:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
        raise CalledProcessError(retcode, cmd, output=output)
    return output


if __name__ == "__main__":
    setup(name="pythonnet",
          ext_modules=[
            Extension("clr", sources=[])
          ],
          cmdclass = {
            "build_ext" : PythonNET_BuildExt
          }
github pythonnet / pythonnet / pythonnet / setupmono.py View on Github external
def build_extension(self, ext):
        """
        Builds the .pyd file using msbuild or xbuild.
        """
        if ext.name != "clr":
            return super(PythonNET_BuildExt, self).build_extension(ext)

        dest_file = self.get_ext_fullpath(ext.name)
        dest_dir = os.path.dirname(dest_file)
        if not os.path.exists(dest_dir):
            os.makedirs(dest_dir)

        defines = [
            "PYTHON%d%s" % (sys.version_info[:2]),
            "UCS2" if sys.maxunicode < 0x10FFFF else "UCS4",
        ]

        if CONFIG == "Debug":
            defines.extend(["DEBUG", "TRACE"])

        cmd = [
            _xbuild,

pythonnet

.NET and Mono integration for Python

MIT
Latest version published 13 days ago

Package Health Score

91 / 100
Full package analysis

Similar packages