Ask coding questions

← Back to all posts
/bin/sh: file.py Permissions Denied
BraylanBB121 (42)

Ok, I hope this is the last question that I have to ask that is in relation with those 2 other ones before it. This one is a little different though. So, I tried linking the other file by doing print(os.popen('/home/runner/Chatroom/file.py').read()) but that outputs a new error to me in the console, it says /bin/sh: 1: /home/runner/Chatroom/function.py: Permission denie d I do not know what this means. But it looks like an improvement, given that it says permission denied, so maybe replit now recognizes the file?

Comments
hotnewtop
malvoliothegood (851)

I was inspired by your program so I forked and edited it. I think your version is overcomplicated. Mine is a bit simpler. Check it out: https://repl.it/@malvoliothegood/Chatroom

BraylanBB121 (42)

How did you get the chat() function to run without it being defined before it? That is the whole problem. That is why I need 2 different Python files. @malvoliothegood

malvoliothegood (851)

@BraylanBB121 You will see that the setup function is called at the bottom of the code window. The chatters names are obtained along with the name of the one who is to go first. Then there is some basic error checking to see if: a) the two names are the same as that would be confusing, b) the name entered as the one that is to go first is one of the two names previously entered. Once these checks are made the chat function is called with the chatters names (in a list), plus the name of the chatter who is to go first passed in as arguments. The chat function then uses these values to generate a back and forwards conversion between the chatters. I will comment the code so that you can understand what is happening.

CodeLongAndPros (1589)

Push C-S-s and enter

chmod +r +w +x file.py
BraylanBB121 (42)

What do you mean? Can you give me an example? @CodeLongAndPros

CodeLongAndPros (1589)

@BraylanBB121 Repl.it's servers/VM's run Linux. You can do os.system("chmod +rwx -v foo")
to set foo's permissions to
read
write
and execute.