Skip to content
Advertisement

Tag: console

How to print a standard circle in the console window?

I am trying to print an arbitrary math function through a callback function, the execute() function will iterate over all integer coordinates (x,y), if the callback returns true then canvas[x][y] = ‘*’. But my implementation only works when printing straight lines, always fails to print hollow circles The following two pictures are the printed x shape and the wrong ring

Execute code line by line interactively in console inside `with` block

When testing things interactively in a console, sometimes I use with statements. However, because they increase indentation, the prompt changes from >>> to … and the execution stops until I return to the lowest indentation. It makes sense for function definitions, because the code isn’t actually executed inside the function definition. But then there are loops (first iteration could be

How to add a console to a tkinter window

I want a way to add a console to a tkinter window or redirect the output of the eval or exec functions to the maybe a uneditable text widget in tkinter. Also I want it so the code does not have to be saved first to get executed, I want it to be executed nevertheless. I have already viewed a

How to read history in ptpython console?

I’ve been trying to figure out how to get save and read in the history of my Python commands in a ptpython console, but haven’t been able to do so. All of my efforts have so far been variations of this answer. However, I still am not able to read in my history. I would simply like to be able

Writing Arabic in Pycharm console

In PyCharm I have no problem in printing Arabic in the console, but the problem that I can’t write in Arabic. Instead it is written as weird symbols. How can I fix it? Answer It’s likely that you’re using some weird encoding, try to change your file encoding to UTF-8 or UTF-16: more info: https://blog.jetbrains.com/idea/2013/03/use-the-utf-8-luke-file-encodings-in-intellij-idea/   If that doesn’t work

Live-output / stream from Python subprocess

I am using Python and it’s subprocess library to check output from calls using strace, something in the matter of: However, this only gives me the output after the called subprocess already finished, which is very limiting for my use-case. I need a kind of “stream” or live-output from the process, so I need to read the output while the

Advertisement