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

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

Closed
macksjeremy opened this issue Jun 27, 2022 · 8 comments
Closed

Comments

@macksjeremy
Copy link

macksjeremy commented Jun 27, 2022

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.

@TheTechRobo
Copy link
Contributor

Is your terminal wide enough to fit it?

Also, please wrap your code in backticks like this:

```
def generate_random_number():
    return 4
```

@macksjeremy
Copy link
Author

image

As far as I can tell it should be. I'm using a very recent version of pycharm, with plenty of room.

Is your terminal wide enough to fit it?

Also, please wrap your code in backticks like this:

def generate_random_number():
return 4

@rsalmei rsalmei changed the title No ETA Pycharm truncating the output line Jun 28, 2022
@rsalmei
Copy link
Owner

rsalmei commented Jun 28, 2022

Hi, it seems your pycharm is really truncating the line.
In your latest screenshot we can clearly see the monitor is there:
image
It should be [0%], and the other widgets like elapsed time and ETA should be right next to it...

Anyway, I'm not sure what could be causing it. How is your terminal config?

@TheTechRobo
Copy link
Contributor

Does pycharm not expose its terminal size, or maybe force it to 80?

@rsalmei
Copy link
Owner

rsalmei commented 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...

@rsalmei rsalmei closed this as completed Jun 29, 2022
@rsalmei rsalmei changed the title Pycharm truncating the output line Pycharm truncates the output line -> needs to enable Emulate terminal Jun 29, 2022
@macksjeremy
Copy link
Author

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 :)

@rsalmei
Copy link
Owner

rsalmei commented Jul 3, 2022

Awesome, glad to help!

@Alexander-Serov
Copy link

I have had a similar problem in the pycharm Terminal (not console) and this issue made me realize it wasn't a problem with alive-progress, thanks!

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

4 participants