-4

today i needed to make a small program. i think i made it but i can't execute even for testing. exec command throws "file not found" error, "software run" from right-click menu in file manager hangs for a few minutes and disappears. and at the end when i tried to open "properties" for second time system thrown me error : there was an error while getting the shared information failed to execute child process "net" (no such file or directory) and i can't close this error window, what's happening? have i made program incorrectly, system doesn't have this library or what? PS : my program (this i made) was offline program,for executing commands and modifying files, so why system have internet crash? here you have code for this file : https://drive.google.com/file/d/1X1Yf4zn2C0mstOHfesnrP9maOijD3bML/view?usp=sharing (yes, i'm n00b and yes i might made mistake somewhere, idk where) here you have screenshot of about half of errors: link

EDIT: after installing old verson of python i got this error i think that i just made a buuug:

File "recovery.py", line 9

{

^

IndentationError: expected an indented block`

edit after few days:

today i tried to reinstall everything what's python/python-related. i reinstalled python 3.8 without no many problems (from wget and tarball because in ubuntu 21.04 it isn't in official repos and no unofficial was working). then reinstalled PIP.

but...

python was stored in python3 file, not python 3.8 , which is required for PIP, is it possible to solve or i need to rewrite all python (or system) on PC?

10
  • Try running it from a terminal, in the directory containing your program (recovery.py) . python recovery.py You should see any errors displayed in the terminal. May 9 at 13:39
  • i tried with exec but... "file not fouuund..." May 9 at 13:42
  • did you type exec python recovery.py ? I suggest you just try python recovery.py. the exec command will terminate your terminal session when the program completes/fails to run. May 9 at 13:50
  • 1
    OK, looking at your screenshots your python script is located in Desktop so, please try this: open a new terminal, type cd Desktop then python recovery.py. May 9 at 14:12
  • huh. system didn't even found python... here you have screenshot: ibb.co/LrS3F9k May 9 at 16:20
2

A couple things. Looking at your python file, you seem to be trying to use curly braces {} to denote blocks of code. Python works by using indentation. so

void foo(){
    puts("foo");
}

becomes

def foo():
    print("foo")

Also, you can't run your python script just like that, you need to either add a hashbang (probably #!/usr/bin/python) to the start of the file and using ./recovery.py, or simply running python recovery.py from your terminal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.