How to fix utf-8 error when reading text file? - Python Discussions
Apr 2, 2024 ... I have Python 3.12 on Windows 10. I have a program to find a string in a 12MB file .dat file which was exported from Excel to be a ...
Apr 2, 2024 ... I have Python 3.12 on Windows 10. I have a program to find a string in a 12MB file .dat file which was exported from Excel to be a ...
while is_word_guessed(secret_word, letters_guessed) == True: just to see if the change from True to None would break the loop. Anyway, any help pertaining to the mentioned function call or its use within the code as a whole would be greatly appreciated!
Mar 19, 2022 ... Hello, @PythonGuy you need to input the name of the python file ( .py ) to terminal. Make helloworld.py file with this code below:.
I have a problem with saving values to file using write(), essentially the program accepts 3 numerical values then stores them as strings in a textfile labeled “scores.txt”.
Jun 5, 2019 ... Omitting encoding is a common mistake when writing portable code. ... error messages: os.strerror(code) for example; user and terminal ...
I have while j < n in the first while loop and also in the inner loop. I could not see a way to simplify the two while j < n statements. It seems that both need to exist. Is it common for such sliding window questions? Is there any good way to simplify based on the current code?
Jul 11, 2023 ... ... loops, while loops, and other basic tools. pythongrasshopper (Anthony R) July 11, 2023, 4:09pm 5. I've since updated my test code to read this:
If the code doesn’t do anything, that means it remains stuck in the while True: loop, and never hits any print statements.remember, i is a string, such as 'millennium'. This is why you need meaningful names. If you’d ever hit this bit of code Python would have thrown an error.
Jun 5, 2021 ... oli: why my excepts are not executing? It is impossible to say because no way to determine indentation in your code.
I can handle writing the function for one of these scenarios (ie. erroring and looping back if the user enters a year outside the range) but when I try and combine them im getting really confused. I tried nesting an if block in a try block in a while loop but it wasnt working.
Nov 26, 2022 ... Please post a short piece of code that shows the problem. I cannot tell from you prose what code you are running.
Aug 21, 2025 ... The spinbox will call that method when it wants to know the value should be displayed. Here's an example: import tkinter as tk class Person: def ...