Ask coding questions

← Back to all posts
What is wrong with this piece.
TJVoid (0)

I am trying to figure out what is wrong with this code? When I press run, it says sh: 1: my_user: not found, can anyone help me?

Comments
hotnewtop
RYANTADIPARTHI (6010)

it seems to be working.

Andy_4sberg (52)

You should have

if os.path.exists(my_user_input):
    return my_user_input
else:
    return 'Incorrect file path'

so the users don't abuse it to execute any command

This would go in the 'my_user()' function

IcynDevz (765)

Replace os.system('my_user') by my_user()