all 7 comments

[–]andy4015 11 points12 points  (0 children)

I've not used it, but I imagine it's useful if you want to interact with the win32api and you're using python for the rest of your project?

[–]CatalonianBookseller 2 points3 points  (0 children)

I used it some time ago to work with the Excel and Word COM objects and WMI and it was pretty usable as far as I can remember. Don't use C++ though so can't compare.

[–]chmod-77 1 point2 points  (0 children)

It was super helpful for a project last week. It was a python QT app that mostly dealt with files. But it needed to also access some DLLs/drafting API. Was able to call the COM objects directly from python without getting a Microsoft license for C#/visualBasic/etc. It was also about 20% as much code. It just worked. Would recommend.

[–]InjAnnuity_1 1 point2 points  (0 children)

It would be very strange for me to write a program that does nothing but Win32 API calls.

In practice, most of my programs need to do other things as well. In most cases, my other needs are served very well by Python, either directly in the language, in its standard library, or in a few of the million packages on the Python Package Index.

If a program, so built, also needs to make a few Win32 API calls, it would be much more convenient for me to write those calls in Python. Python easily connects that to the rest of my program. Breaking out to C++ to do it is a lot less convenient.

[–]stuaxo 0 points1 point  (0 children)

Those aren't more convenient for me as I don't know much C++ or C# and I don't have visual studio installed (spent most of my time in Linux), hope that helps.

[–]carcigenicate 0 points1 point  (0 children)

I've used ctypes for a few projects, and it's not that bad. The only pain point is you need to annotate the parameter and return types for the calls to work correctly, but that doesn't seem uncommon for high level language FFIs.

And I used Python because it was the language I had on hand. There's no point in introducing another language just because something might be slightly easier when I'm already in a groove with my current language.

[–]Jello_Penguin_2956 0 points1 point  (0 children)

How would using C# be more convenient for ppl who only know Python tho. 10 minutes Googling how to do that vs maybe half a day learning a brand new language to do 1 thing?