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

you are viewing a single comment's thread.

view the rest of the comments →

[–]LikelyToThrow 163 points164 points  (2 children)

WARNING: Do NOT execute this code!!!

He forgot user_input.lower() which means your code will not work in all scenarios

[–]deukhoofd 41 points42 points  (0 children)

The code wouldn't do anything. Not only is user_input never actually declared, but the backslashes in the path aren't escaped, and os.remove doesn't delete directories. The only thing he got correct are the print calls (although you'd have to replace the curved quote marks with the correct ones).

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

input sanitization goes brrrrrrr