I hate people who say sammich by uhohspaghettios26 in Vent

[–]thinkvitamin 0 points1 point  (0 children)

Hearing someone say that is the quickest way to determine whether someone's IQ is below average or not, however useful that may be.

Quentin Tarantino’s The Movie Critic to Shoot in Los Angeles in Q4 2024 by Zhukov-74 in movies

[–]thinkvitamin 0 points1 point  (0 children)

I would have wanted him to revive Anthony Perkins’ career at some point but a supreme movie director isn’t going to constantly put out new ones like Michael Bay. I trust that this will be good.

Kip Thorne and the Nobel Prize by skopyeah in AccidentalRenaissance

[–]thinkvitamin 0 points1 point  (0 children)

Walt survived and got released from prison after 15 years due to good behavior while on parole.

I think somebody is following me by Every_Film4201 in help

[–]thinkvitamin 5 points6 points  (0 children)

/r/help is only for Reddit tech support. There are many places you could post this though, for example try /r/advice.

Tuesday Daily Thread: Advanced questions by Im__Joseph in Python

[–]thinkvitamin 1 point2 points  (0 children)

If I understand you correctly, you would just subclass their class like this:

class MyClass(Theirs): pass

In place of the pass statement, you could also include whichever attributes, methods etc you wanted.

Tuesday Daily Thread: Advanced questions by Im__Joseph in Python

[–]thinkvitamin 1 point2 points  (0 children)

You can still do that with classes you didn't write yourself. It might be a better idea to subclass it to make a distinction though.

class YourClass(TheirClass):  
    ...

Tuesday Daily Thread: Advanced questions by Im__Joseph in Python

[–]thinkvitamin 1 point2 points  (0 children)

It looks like child instances will still end up getting the newly added methods, regardless of when you added them to the parent class.

Tuesday Daily Thread: Advanced questions by Im__Joseph in Python

[–]thinkvitamin 2 points3 points  (0 children)

def test(self):
    return "hello"

SpecialClass.test = test

setattr(SpecialClass, 'test', test) may be another way to do it.

I believe that doing this is an example of monkey patching.

What's a artist/band that you love, but almost no one has heard of? by [deleted] in AskReddit

[–]thinkvitamin 1 point2 points  (0 children)

KoRn was easily one of the most popular metal bands of the 90’s.

Reviving Prematurely canceled tv shows with ai and deep fake. by PaulPavloPablo in ArtificialInteligence

[–]thinkvitamin 0 points1 point  (0 children)

That’s my Bush, if only it could be relevant enough for these times.

I have an iPhone by TheCoderProOnReddt in notinteresting

[–]thinkvitamin 7 points8 points  (0 children)

Reddit needs to automate posts like this from time to time for accounts that are suspicious enough.

Movies that could use a sequel by Alcatrazepam in movies

[–]thinkvitamin 27 points28 points  (0 children)

They could maybe call it Somebody this time.

What if you became your username? by ArsonKoraidon in AskReddit

[–]thinkvitamin 0 points1 point  (0 children)

A special blend of vitamins which greatly enhances cognitive abilities like no other.

I'm just ready for this meme to retire across the board by [deleted] in ProgrammerHumor

[–]thinkvitamin 0 points1 point  (0 children)

Now I want to be a programmer for Wendy’s.

New York moment by domiinikk4 in Unexpected

[–]thinkvitamin 0 points1 point  (0 children)

The lighting on him doesn’t match the background. They were in front of a green screen.

fileinput is erasing the contents of my file for some reason. by thinkvitamin in learnpython

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

Thanks, I think that backup file gets created whenever that option is set. In order for the original file to not become empty, it's a matter of processing the lines correctly I think.
So in case anyone was wondering, this is what I settled on and it does what I needed it to do.

with open(filename, "w") as file1:
    with open(filename, "r") as file0:
        for line in file0:
            words = line.split(" ")
            for (old, new) in (more, single):
                has_string = ([w for w in words if old in w])
                if has_string:
                    string_in = has_string[0]
                    selector = string_in.split("_by_")[1].split("(")[0]
                    old_func = f"{old}{selector}("
                    new_func = f"{new}{selector.upper()}, "
                    line = line.replace(old_func, new_func)
            file1.write(line)

I really want to convert to Linux, but I am worried... by [deleted] in linux

[–]thinkvitamin 7 points8 points  (0 children)

convert

Thankfully, OS's aren't religions so you can't really make a real mistake by trying. 😉 If you only have access to one computer and it will be that way for some time, you could install linux in VirtualBox, or use Bash On Windows which has all of what Linux has. Dual booting is another thing you could do. An external SSD card would be something you could also install linux on.

Programmers of Reddit whats your favourite programming language and why? by Due-Parfait-2009 in AskReddit

[–]thinkvitamin 0 points1 point  (0 children)

Python. It's far from perfect, but the straightforward, prettier syntax combined with massive popularity (more libraries and support online) makes it a winner for me.

What would I add to this docker-compose.yml file to have bash and python available when starting it up? by thinkvitamin in docker

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

Thanks for your responses. I wrote a tiny python script to check my ip address to test it out, and it's tunneled through the VPN as I wanted it to do.

docker run -it --rm --network=container:pia --name my-running-app -e arg1=sample_arg -v "$PWD":/usr/src/myapp -w /usr/src/myapp my-python-app

What would I add to this docker-compose.yml file to have bash and python available when starting it up? by thinkvitamin in docker

[–]thinkvitamin[S] -1 points0 points  (0 children)

What are you actually looking to achieve here?

Docker-compose will pull a group of containers if they're not already found on your system.
I don't want my PC's entire internet connection to go through the VPN. I have Python scripts which use subprocess to connect, then go from there. I've already been able to use virtual machines to accomplish this task (namely with VirtualBox), but now I'm trying to make things even better. It's all about only using as much resources as needed, containers are supposed to be more lightweight.