#๐ Hi, if u can, give me feedback and suggestions about my new script on github
38 messages ยท Page 1 of 1 (latest)
@sweet fulcrum
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
import os
import argparse
def create_folders(base_path, folder_names):
"""Create folders inside the specified directory"""
for name in folder_names:
path = os.path.join(base_path, name)
os.makedirs(path, exist_ok=True)
print(f"๐ Created folder: {path}")
def rename_folders(base_path, rename_map):
"""Rename folders based on a mapping {old_name: new_name}"""
for old_name, new_name in rename_map.items():
old_path = os.path.join(base_path, old_name)
new_path = os.path.join(base_path, new_name)
if os.path.exists(old_path):
os.rename(old_path, new_path)
print(f"โ๏ธ Renamed: {old_name} โ {new_name}")
else:
print(f"โ ๏ธ Folder not found: {old_name}")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Automation tool for creating and renaming folders")
parser.add_argument("--base", type=str, default=".", help="Base path (default: current directory)")
parser.add_argument("--create", nargs="*", help="Folder names to create")
parser.add_argument("--rename", nargs="*", help="Rename folders in the format old:new")
args = parser.parse_args()
if args.create:
create_folders(args.base, args.create)
if args.rename:
rename_map = {}
for pair in args.rename:
if ":" in pair:
old, new = pair.split(":", 1)
rename_map[old] = new
rename_folders(args.base, rename_m
i think i was helpful
goodluck helpers
not too bad llm model, I'd say gpt3.5+
i just copied it from his git bruh
yes i saw, nw
so he is uisng chatgpt ?
Doesn't it look like it to you
i am a begginer lol
do you already write clean code with docstrings and use emojis in your print statements?
who use emojis in code
AI.
So it's cool and all @sweet fulcrum but I see absolutely no real life use case.
who want to rename folders lol
Also if you're a beginner, I recommend you start by coding your own "scripts"
:warning: The owner of this post is no longer in the server.
๐ฅ
We all sin, just don't ask a discord server to review your prompting skills :/
Emojis are always a give-away. No self-respecting programmer would use emojis for a terminal application (slight exaggeration obviously).
Short single-file-projects are also always a give-away.
Usually there are more obvious tells, like comments saying smth like:
# alternatively you need to replace X with Y
or smth like that, which immediately shows you that it was written by a LLM.
That being said, this code is SO incredibly short, that there really isn't a 100% way to tell it.
Also in general how the GH account looked like: 4 days old, only a single repo, no actual build manager for the program, just very sloppy overall.
Fun fact: OP just deleted his only repo 2 minutes ago
@tight prawn also code with comments just over several blocks of the code that explains what each block of code does in a quite unnatural way
sure, some people, especially beginners does this too, but AI just does it in a certain way (writing the text in the comments in a way) that you learn to recognize after a while
you can check what it looks like by just using AI a little bit yourself and ask it to solve whole problems for you that you describe, like "write a python script that does x" and you'll probably see what i mean
another tell tail is that AI uses overly long and descriptive function names much of the time, while good function naming is good programming practice AI just over-does it a lot of the time
typically when people progress you write less comments and more real documentation as docstrings, more self-documenting code by using good and clear variable names and function names (without them being whole sentences almost like AI can do quite often)
comments in code is fine, but they shouldn't be documenting how you are doing something in code (unless there some really advanced and compact code snippet that is hard to read that you haven't put into a function of it's own with good naming) because then you have two things to update, both the code and the comment, otherwise the comments will be out of sync with the code after a while, which does more harm then good
something that is very good to use comments for is to explain choices you made if it's not the obvious one, like why you implemented something in a certain way, or something that is of critical importance to someone (or future you) that they think of when for the implementation, like if some section of code shouldn't be optimized because it needs to run in constant time due to security implications (but even this might be better to externalize into a well named function and write docstrings for it that explains this)
this is in stark contrast to what AI usually does with comments in the code
Bro you wrote all of that for me thankssss
i though it was a good pivot to introduce good programming practices in general and compare it to what AI often does when it writes full scripts for someone that prompts it for a solution
i almost ran out of characters for one message (since i don't care much for nitro) ๐
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.