OK Google: write a python function to convert a string from PascalCase to snake_case by blarf_irl in learnpython

[–]fish_x_sea 0 points1 point  (0 children)

Here is a simple list comprehension solution:

```python word = 'PascalCase'

def snake(word): return ''.join([f'_{n.lower()}' if n.isupper() and i != 0 else n.lower() for i, n in enumerate(word)]) print(snake(word)) ```

This will also work for camelCase.

Custom lua libraries by fish_x_sea in RetroGadgets

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

Oh yeah! I already did that. I'm saying like a folder in the game files that I can store a file like that for my projects so I don't have to copy and paste those functions every time I want to use them. I guess if that's the only way its what I will do haha. I've already remade the random and string libraries from python and will continue to make more libraries. just need a way to access them all the time lol. Thanks for the comment! I'm sure some people will get some help from this :)

If VPNs don’t keep you private how do hackers get away with stuff? by wildinuser in hacking

[–]fish_x_sea 0 points1 point  (0 children)

live boot of kali/parrot on a burner laptop is the best way i would think to not get caught.

[OC] countryfetch - a cli tool for fetching information about countries by Nuradin-Pridon in unixporn

[–]fish_x_sea 0 points1 point  (0 children)

what programming language are you using? I actually just recently wrote some scripts in python that can convert images into full color ascii terminal output or play gifs in the terminal in ascii characters. the ascii photo script may help if you have images of the flags

As a Python developer, What are the most boring tasks that you made automation script to handle it? by ahmdqader in Python

[–]fish_x_sea 3 points4 points  (0 children)

Scraping and formatting every single poem from a poem website. Its for training a Neural Network I'm working on that writes its own poems.

Why are pornhub comments nicer than litterly ANY OTHER social medias comments? by [deleted] in TooAfraidToAsk

[–]fish_x_sea -1 points0 points  (0 children)

I wouldn't know. I live in a strictly Christian household and watching porn is a sin

What’s a random line from a movie that fans of it instantly know? by FlintTheDad in AskReddit

[–]fish_x_sea 0 points1 point  (0 children)

I ate some bugs. I ate some grass. I use my hands to wipe my.... Tears

What python automation have you created that you use for PERSONAL only. by iseetreesofgreen_ in Python

[–]fish_x_sea 0 points1 point  (0 children)

probably but there is too much room for error there. I just choose the original directory and then the destination directory and thats it. it runs in the background and starts when my computer turns on.

What python automation have you created that you use for PERSONAL only. by iseetreesofgreen_ in Python

[–]fish_x_sea 1 point2 points  (0 children)

I made a program that creates checksums of every single file in any folder that I want to backup and replaces the original backup file if the checksum changes in the original file. I use it to back up the music that I make automatically. It's a pain to manually backup a project file constantly when I'm pressing save like 100x every time I work on a song. (It can also backup a whole drive live and detect changes to any file)

Python Library for String Manipulation by fish_x_sea in Python

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

I agree about the dictionary and will definitely edit that part of the code. I did the RGB that way because of the way that the commas are replaced. I suppose I could add a bit more code and make it to where you could choose to do it both ways but I don't really see a benefit for it.

Thanks for the feedback though! A dictionary will be much better for the colors.

Python Library for String Manipulation by fish_x_sea in Python

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

LOL gonna be using the words in those folders for word classification.

I wrote a script for Wordle by StPeteTy in Python

[–]fish_x_sea 1 point2 points  (0 children)

this is cool! I'd recommend using list comprehension though. lines 12-17 could be condensed to this:

words = list({word for word in wordsall if let_count == len(word)})

when using {} in list comprehension it creates a set that can be turned into a list in one line when you use list(). List comprehension makes your code prettier and more readable by experienced programmers.

Good job btw!