Disable the Pygame console Output [duplicate]

本小妞迷上赌 提交于 2019-12-02 11:19:27

问题


Possible Duplicate:
How to suppress console output in Python?

Currently I am using pygame to read joystick input and I have the following issue that I need to solve.

When calling functions in the joystick module such as get_axis() or get_button() the function prints out lines such as SDL_JoystickGetButton value:0: I need to disable the output of these lines to the console.

I have found the following question/answer on stackoverflow which is what I'm looking for...

How to suppress console output in Python?

But this post does not supply enough information. Because if I have to turn off DEBUG, I would like to know the steps on how to do that. So far I have downloaded the pygame source and went into joystick.c and commented out the lines that print to the console, and then I ran the setup.py, but the joystick functions still print out to the console. Also I am using Python 2.6 and pygame 1.9.1.


回答1:


This thread should resolve this: printf statements 1.9.1

I had this same issue except when running under PyScripter it causes a huge memory leak in PyScripter itself. So it was eating up all my memory on my machine. Nasty interaction.



来源:https://stackoverflow.com/questions/7012444/disable-the-pygame-console-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!