Python Forum
Compile c method in real time
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compile c method in real time
#1
Hello,

Here is my confidence
Python3.7
Windows 10

In ma code, I use c user32.dll throw a method in c language

My problem :

When I try to run the code I have an invalid syntax error in c method

Question :

How to say python to compile in real time c code when the interpreter read it ?


Thanks for your support

Best regards and hope your new year 2019

Battant
Reply
#2
If you have a c compiler installed (such as llvm), then call it.
Python isn't a c compiler, it can't compile c code on it's own.
Reply
#3
You can use cython which does this very well. (but it's not python, start with the FAQ)
Reply
#4
Hello,

Thanks for your answers.

I have found this code :

https://stackoverflow.com/questions/2524...rom-python

Question :

How could I run it ?

Thanks for your support

Best regards

Battant
Reply
#5
The ctypes module doesn't compile C code. It is a foreign function interface which allows python code to call C library functions with some effort from the programmer on the python side. Start with the official documentation of module ctypes, then read online tutorials.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Non-blocking real-time plotting slow_rider 5 3,453 Jan-07-2023, 09:47 PM
Last Post: woooee
  Real time database satyanarayana 3 1,623 Feb-16-2022, 01:37 PM
Last Post: buran
  Real time data satyanarayana 3 20,215 Feb-16-2022, 07:46 AM
Last Post: satyanarayana
  Real time Detection and Display Gilush 0 1,763 Feb-05-2022, 08:28 PM
Last Post: Gilush
  Real-Time output of server script on a client script. throwaway34 2 2,010 Oct-03-2021, 09:37 AM
Last Post: ibreeden
  Real Time Audio Processing with Python Sound-Device not working Slartybartfast 2 3,881 Mar-14-2021, 07:20 PM
Last Post: Slartybartfast
Question I can't get my real-time chart with Python (Help!) Bastian_ElProfe 1 2,189 Jan-20-2021, 01:34 PM
Last Post: wostan
  Real Time signal processing tagalog 2 2,601 Dec-12-2020, 05:23 AM
Last Post: tagalog
  Real-time processing tagalog 5 3,063 Oct-06-2020, 03:45 PM
Last Post: tagalog
  Real time MIDI with python eythoralex 1 3,397 May-19-2020, 07:17 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020