question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pycharm truncates the output line -> needs to enable Emulate terminal

See original GitHub issue

Hi, I’m running my code pretty similarly to the base methodology, but seem to lack an output ETA or any sort of runtime statistics other than the completion, which while not critical, would be a nice addition. There’s no duration/eta checker showing in my output.

My output looks like: Running CRAFT Detection |█████████▌ | ▆▄▂ 346/1466

And the code chunk running it looks like

    bartitle = 'Running CRAFT Detection'
    with alive_bar(len(results), force_tty=True, title=bartitle) as bar:
        for i in results:
            if '.jpg' not in i:
                continue
            count_k += 1
            i = res_path + i
            img = cv2.imread(i)
            if (img.shape[0] > 1600 or img.shape[1] > 1600):
                print(i, "is too big to be put into model currently. Skipping","Shape is", img.shape)
                oversized.write(i)
                time.sleep(0.05)
                bar()
                continue
            bounds = annotate_image(reader,i)
            if(bounds!= [[]]):
                output_dict[i] = {}
                output_dict[i]["bbox"] = bounds
            time.sleep(0.05)
            bar()

I’m curious what I’m missing here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
macksjeremycommented, Jun 29, 2022

That’s what I thought too… I went to investigate it, and found it!! Just running an alive-progress script in Pycharm was not fluid at all, sluggish and slow, but on top of it, it was TRUNCATING the line!

It is an easy fix: image

I did know about that option, which I always turn on nowadays, but I’d never noticed that it truncates the line when turned off too… And since the terminal gets sluggish as hell on top of it, I don’t know why JetBrains made this option at all…

This works, thanks for the help. Wondering why PyCharm works like that as a default. Definitely a closed issue. Now my loading bar is very pretty 😃

0reactions
rsalmeicommented, Jul 3, 2022

Awesome, glad to help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Run" console does not print everything - cuts long string after ...
I can recreate this problem by just using print() on a string with 24k characters. PyCharm "Run" will cut it after ~12k chars....
Read more >
No "Emulate terminal in output console" option in PyCharm for ...
I'm running PyCharm 2019.3 on Windows 10. In order to have PyCharm behave well with progress bars (tqdm, in my case), I found...
Read more >
Emulate terminal in output console doesn't support \n only \r\n ...
The latest update made the "Emulate terminal" only support window's \r\n and not linux's \n. for i in range(0, 5): print(f"line {i}"). Python...
Read more >
Output in Debug console truncated : PY-53807 - YouTrack
PY-53983 Debug console cuts off / truncates output ... but I can't find way to disable it and use console in debugger same...
Read more >
Broken output if "Emulate terminal in output console" option is ...
Broken output if "Emulate terminal in output console" option is enabled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found