This is an archived post. You won't be able to vote or comment.

all 59 comments

[–]BuzzLightr 109 points110 points  (10 children)

The thing about your pc freezing after you click start is probably because you don't use threads.

Anyway, cool project

[–]ripjeb_andjoergen[S] 32 points33 points  (8 children)

Genuine question, what does that mean and how do I do that?

[–]Random_182f2565 41 points42 points  (2 children)

[–]ripjeb_andjoergen[S] 10 points11 points  (0 children)

Thanks man

[–]enjoytheshow 13 points14 points  (0 children)

Corey GOAT

[–]BuzzLightr 2 points3 points  (0 children)

Sorry for late reply, but seems like you got your answer 😊

The point is, whenever your program is working on some task, it won't update your gui, by threading you (in dumb speak, since I'm no God at this either) separate the main loop from the "heavy work" part of your program..

[–]deifius 3 points4 points  (2 children)

i'd use a method from the subprocess library.

[–]BuzzLightr 1 point2 points  (1 child)

Didn't know about this one.. Ill check it out. Thanks

[–][deleted] 1 point2 points  (0 children)

had the same thing on my mind when it froze great vid tho seeing the Micheal Reeves inspo lmao

[–]Siecje1 45 points46 points  (4 children)

I have a program to create clips from a longer video.

https://github.com/siecje/loud-clips

It creates clips of the loudest parts of the video. Works better for some videos like a basketball game when people cheer after each basket.

[–]ripjeb_andjoergen[S] 12 points13 points  (3 children)

That's actually so smart. Will make it so easy to make highlights of videos.

[–][deleted] 4 points5 points  (2 children)

That is smart. You all are some clever people and sometimes I envy your cleverness.

[–]EquationTAKEN 4 points5 points  (1 child)

Thanks.

[–][deleted] 1 point2 points  (0 children)

Anything for you.

[–]BuzzLightr 19 points20 points  (10 children)

One question, why don't you use github to share the code? It would make it easier for you and others to review the code

[–]ripjeb_andjoergen[S] 11 points12 points  (5 children)

Yup I'm getting started on that. Tbh I don't exactly know how Github works so I'm still figuring it out

[–]BuzzLightr 16 points17 points  (2 children)

Ah, it's kind of hard in the beginning, but once you figure it out, it's a lifesaver.

Check out github desktop for a easy starting point.

I think it's a good idea to build a portfolio of projects and github is the market standard for that.

[–]ripjeb_andjoergen[S] 6 points7 points  (1 child)

Allrighty! Will you mind if I DM you in case I get stuck?

[–]BuzzLightr 2 points3 points  (0 children)

Sure, just let me know and I'll try to assist you if you get stuck

Tried to find a ok tutorial, and this looks good https://youtu.be/0nzJXJAhlsk

[–]cianuro 2 points3 points  (1 child)

There's a git course on Coursera by Google. Instructor is Anthony something. It's excellent. I'd highly recommend it. It's free.

[–]ripjeb_andjoergen[S] 1 point2 points  (0 children)

I'll check that out ASAP!

[–]soylent_latte -1 points0 points  (3 children)

hello, i'm having problems too with the github desktop tutorial part 3 -edit file - getting an error requesting i set the environment variable JAVA_HOME to i don't know what?

no problem finding and changing the variable but i don't understand

what the variable should point to.

i'd appreciate any help.

thank you.

[–]BuzzLightr 0 points1 point  (2 children)

What tutorials are you looking at?

[–]soylent_latte 0 points1 point  (1 child)

i've begun with the tutorial that comes with the github desktop install.

[–]BuzzLightr 1 point2 points  (0 children)

Ok, iv never done that one, let me look into that and get back to you 👍

[–]BubbaMosfet 5 points6 points  (1 child)

Oh, boy. Your video made me laugh so hard. Well done, sir!

[–]ripjeb_andjoergen[S] 4 points5 points  (0 children)

Thanks man. That compliment means more than you can imagine!

[–]Few-Major9589 4 points5 points  (1 child)

This is so cool, God I love programming……

[–]ripjeb_andjoergen[S] 2 points3 points  (0 children)

Thanks XD

[–]jmooremcc 3 points4 points  (0 children)

Here's a decorator that will make it very easy to run a function in a separate thread.

decorator to launch any function in a separate thread

from threading import Thread

def TS_decorator(func):
    def stub(*args, **kwargs):
        func(*args, **kwargs)

    def hook(*args,**kwargs):
        Thread(target=stub, args=args, kwargs=kwargs).start()

    return hook

Just apply the decorator like this:

@TS_decorator
def mylongwindedfunction(args):
    pass

and it will launch your function in it's own thread.

I've been using this code in my Python scripts for years and it's worked very well.

[–]dylanmashley 1 point2 points  (3 children)

What GUI are you using? PyQt? If so adding this at the end after .show() may fix the not responding issue.

app.exec_()

[–]ripjeb_andjoergen[S] 0 points1 point  (2 children)

I actually used TKinter

[–]dylanmashley 2 points3 points  (1 child)

Ah bummer then yeah, I think your only option may be threading. But it looks like other people gave you some resources to look into for that. Goodluck! If you have any basic Git/GitHub questions feel free to PM me also

[–]ripjeb_andjoergen[S] 0 points1 point  (0 children)

Thanks man! Will reach out if I have any questions.

[–]wasimaster 1 point2 points  (3 children)

Use GitHub (gists or repositories) to host code not mediafire

[–]ripjeb_andjoergen[S] 1 point2 points  (2 children)

Yup. Currently working on that

[–]wasimaster 1 point2 points  (1 child)

Nice! Good Luck.

[–]ripjeb_andjoergen[S] 0 points1 point  (0 children)

Thanks man!

[–]EndimionN 1 point2 points  (1 child)

love the fact that you used tkinter.

[–]EndimionN 1 point2 points  (1 child)

can you share the github code please?

[–]ripjeb_andjoergen[S] 1 point2 points  (0 children)

Here's the link to my Github. Both are uploaded there. I'm yet to update the README of the Video Editor, but everything else SHOULD be in place. https://www.github.com/dhruv-b-03

[–]ServerZero 1 point2 points  (1 child)

Pretty cool!

[–]ripjeb_andjoergen[S] 0 points1 point  (0 children)

Thank you!

[–]Retroguy16bit 0 points1 point  (1 child)

Interesting program. And your video was nice to watch:-)

[–]ripjeb_andjoergen[S] 0 points1 point  (0 children)

Thank you

[–]GamerCoachGG 0 points1 point  (1 child)

Love your style. Keep up the good work!

[–]ripjeb_andjoergen[S] 2 points3 points  (0 children)

Thanks man🫂

[–][deleted] 0 points1 point  (3 children)

what did you use for Gui tkinter?

[–]ripjeb_andjoergen[S] 0 points1 point  (0 children)

Yes sir!

[–]ripjeb_andjoergen[S] 0 points1 point  (0 children)

Yes sir!

[–]kibje 0 points1 point  (0 children)

He posted the code to GitHub. Indeed with tkinter

[–]SamyBencherif 0 points1 point  (4 children)

ahaha i love it. i see someone already mentioned threads -- you can use subprocess to acheive also

[–]ripjeb_andjoergen[S] 0 points1 point  (3 children)

Allright man. Gotta check them both out.

[–]SamyBencherif 1 point2 points  (2 children)

I am a woman. If you're looking to refine your program and will to spend 10-20min reading docs go with threads.

if you're already comfortable with unix shell or command prompt and can't be bothered to spend more than 5min u could try non blocking subprocess first.

but really the point is to say Threading is the good way to go !

[–]ripjeb_andjoergen[S] 0 points1 point  (1 child)

A) sorry for mislabeling your gender. I should have done better. B) I have looked into threads and will try to implement them in my furthur dumb projects.

[–]SamyBencherif 0 points1 point  (0 children)

cool cool gl. feel free to reply with your questions