Print("Found " + str(total_number_of_matches) + " Matches in Database") After that it will fail on running the actual shortcut file's content.ĭef find_search_term_and_total_number_of_matches_if_any(self, search_term):Ĭ.execute("SELECT count(*) FROM KTRmini_table WHERE discription LIKE ?", (search_term,)) This is when the file is being executed(Modules are executed when they get imported). So in the process of importing Python somehow resolves the source file's path and import the file. When you don't use the -mįlag, the file you named is run as just a script. ![]() Package for you, then run it as a script. When you use the -m command-line flag, Python will import a module or If you use -m option, Python can execute the original source file but after that it will give you the same error.As said here: When you type, python something, it doesn't matter what file extension it has, interpreter reads the content, compile the content to create pyc file and then interpret that pyc file. It will inspect the content of that file which is showed by type command. Then OS will execute the referenced file by the specified app which is python.exe in your case.īut Python cannot treat it like a regular Python module. (It is not a readable text file though)Īs you see it has necessary information to redirect you when you double click on it. In windows command prompt you can use type command which displays the contents of a text file. Slider.tk.config(sliderlength=sliderlength)Īlthough whenever you double click to run that shortcut, it will redirect you to the original Python file, that shortcut file itself is not a module. Sliderlength = slider.tk.winfo_height() * percent Percent = min(app.height/boxs.tk.winfo_height(), 1.0) Slider.tk.config(to=event.tk_.winfo_height()) Print("Thanks for Playing Rock, Paper, Scissors") Print("Rock smashes scissors! You lose.") Print("Both players selected " + choice1 + ". " )Ĭhoice2 = input(name2 + ": enter 'r' for rock, 'p' for paper, 's' for scissors: ") Print("Great choice! Now - cover your answer and ask " + name2 + " to choose. Print("Hello " + name1 + " and " + name2 + "!")Ĭhoice1 = input(name1 + ": enter 'r' for rock, 'p' for paper, and 's' for scissors: ") Name2 = input("Player 2: What's your name? ") Name1 = input("Player 1: What's your name? ")
0 Comments
Leave a Reply. |