Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How to make ptpython output like python? #543

Open
Freed-Wu opened this issue Jul 19, 2023 · 1 comment
Open

[question] How to make ptpython output like python? #543

Freed-Wu opened this issue Jul 19, 2023 · 1 comment

Comments

@Freed-Wu
Copy link

ptpython only output when it exit:

$ ptpython
In [1]: from ctypes import CDLL
In [2]: libc = CDLL('libc.so.6')
In [3]: libc.printf(b"hello")
5
In [4]: # press <C-D> to exit
hello

For python

$ python
Python 3.10.12 (main, Jun  6 2023, 22:43:10) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import CDLL
>>> libc = CDLL('libc.so.6')
>>> libc.printf(b'hello')
5
hello>>>

Why they are different? How to make them same? TIA!

@Freed-Wu
Copy link
Author

Freed-Wu commented Oct 8, 2023

As a completion, this problem only happens on printf(), not puts().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant