Python Forum
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DLL printf not working
#1
I have just installed python 3.6 (32-bit), eclipse, and PyDev. I am going through the Gray Hat Python book (which uses 2.5) and cannot get the dll call for printf to work properly. I have tried to find a solution to no avail.

The code is as follows. It will only print the first character of the output string to the console.

from ctypes import *

msvcrt = cdll.msvcrt
msvcrt.printf

message_string = "Hello World!\n"
msvcrt.printf("Testing: %s", message_string)

Output:
T
Reply


Messages In This Thread
DLL printf not working - by mperemsky - Jan-02-2017, 05:13 AM
RE: DLL printf not working - by Larz60+ - Jan-02-2017, 05:21 AM
RE: DLL printf not working - by mperemsky - Jan-02-2017, 05:37 AM
RE: DLL printf not working - by Larz60+ - Jan-02-2017, 03:57 PM

Forum Jump:

User Panel Messages

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