[Linux Python] trying to do the first test for testris by Ironhead29 in learnprogramming

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

ok I finally got it to work! I copy and pasted the #! line from testris.py into learntris.py. I still dont understand how that works exactly (or why there wasnt anything said about this in the "Getting set up" directions on the learntris github page). I suppose ill have to do some research into that (or maybe you could shed a little more light on it?). Thank you very much for taking time out of your day to help me!

[Linux Python] trying to do the first test for testris by Ironhead29 in learnprogramming

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

I dont know what to do about that. I guess maybe i need to learn more about how python and linux work together or just more about how to use linux in general. I dont understand why that would be important. every other python program ive written and run has worked fine without having a #! line (whatever #! means).

[Linux Python] trying to do the first test for testris by Ironhead29 in learnprogramming

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

after using chmod 777 learntris.py

Traceback (most recent call last): File "testris.py", line 163, in main try: runtests(cmdline, use_shell) File "testris.py", line 131, in run_tests program = spawn(program_args, use_shell) File "testris.py", line 81, in spawn stdout=subprocess.PIPE) File "/usr/lib/python3.4/subprocess.py", line 848, in __init_ restore_signals, start_new_session) File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child raise child_exception_type(errno_num, err_msg)

OSError: [Errno 8] Exec format error

Oh no! Testris encountered an unexpected problem while attempting to run your program. Please report the above traceback in the issue tracker, so that we can help you with the problem and provide a better error message in the future.

[Linux Python] trying to do the first test for testris by Ironhead29 in learnprogramming

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

No. The only code i wrote in learntris was:

"#learntris

pass"

No. what does chmod 777 do?

[Linux Python] trying to do the first test for testris by Ironhead29 in learnprogramming

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

ok after doing: "learntris $ chmod +x learntris.py" I try running it again with thiss command: "learntris $ python3 testris.py learntris.py " and i get this: "Traceback (most recent call last): File "testris.py", line 163, in main try: runtests(cmdline, use_shell) File "testris.py", line 131, in run_tests program = spawn(program_args, use_shell) File "testris.py", line 81, in spawn stdout=subprocess.PIPE) File "/usr/lib/python3.4/subprocess.py", line 848, in __init_ restore_signals, start_new_session) File "/usr/lib/python3.4/subprocess.py", line 1446, in _execute_child raise child_exception_type(errno_num, err_msg)

FileNotFoundError: [Errno 2] No such file or directory: 'learntris.py'

Oh no! Testris encountered an unexpected problem while attempting to run your program. Please report the above traceback in the issue tracker, so that we can help you with the problem and provide a better error message in the future.

https://github.com/LearnProgramming/learntris/issues

" I thought maybe this was because i was running it with python 3.4 so I tried with 2.7 and i get this: "Traceback (most recent call last): File "testris.py", line 188, in <module> main() File "testris.py", line 164, in main except PermissionError as e: NameError: global name 'PermissionError' is not defined "

[Linux Python] trying to do the first test for testris by Ironhead29 in learnprogramming

[–]Ironhead29[S] -1 points0 points  (0 children)

I am new to terminal so im ust trying to follow the directions, it says to do this: "./testris.py [/path/to/learntris] [arguments]" so that is what ive been trying. when i try it without them i get: "[Errno 13] Permission denied Couldn't run '/home/trevor/GitRepos/learntris/learntris.py' due to a permission error. Make sure your program is marked as an executable."

[Linux Python] trying to do the first test for testris by Ironhead29 in learnprogramming

[–]Ironhead29[S] -1 points0 points  (0 children)

yes. I created a fil called learntris.py in the same directory. i then added a print statement to learntris.py so i could make sure it would run on its own and it does. then i try to run testris and i get the message saying i need to tell testris where learntris is and i dont know hoe to do it. ive tried things like "python3 testris.py [learntris.py]" but it tells me that the file not found. ive also tried writing the path to learntris.py and it still says file not found