try
block should be around open. Not around prompt.
while True: prompt = input("\n Hello to Sudoku valitator," "\n \n Please type in the path to your file and press 'Enter': ") try: sudoku = open(prompt, 'r').readlines() except FileNotFoundError: print("Wrong file or file path") else: break
Related Posts:
- Understanding the main method of python [duplicate]
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- PermissionError: [Errno 13] in Python
- Error in Python script “Expected 2D array, got 1D array instead:”?
- ‘str’ object has no attribute ‘decode’. Python 3 error?
- python 3.x ImportError: No module named ‘cStringIO’
- How to draw a line with matplotlib?
- Good way to encapsulate Integer.parseInt()
- Best way to convert string to bytes in Python 3?
- How to get rid of the “No bootable medium found!” error in Virtual Box? [closed]
- PermissionError: [Errno 13] Permission denied
- What is setup.py?
- ‘git’ is not recognized as an internal or external command
- Relative imports in Python 3
- Is there a ‘foreach’ function in Python 3?
- ‘str’ object has no attribute ‘decode’. Python 3 error?
- How to find all the indexes of a recurring item in a list?
- Unable to initialize device PRN in Python
- How to write trycatch in R
- How do you use subprocess.check_output() in Python?
- how to use proxy on youtube-dl?
- (Help) TypeError: ‘str’ object cannot be interpreted as an integer
- Why KeyError: 0
- LINQ equivalent of foreach for IEnumerable
- How to do vlookup and fill down (like in Excel) in R?
- Get ZeroDivisionError: float division in python
- Using “super” in C++
- What is the difference between application server and web server?
- PHP – Failed to open stream : No such file or directory
- How to extract the substring between two markers?
- “for line in…” results in UnicodeDecodeError: ‘utf-8’ codec can’t decode byte
- Code-first vs Model/Database-first
- How to resolve git’s “not something we can merge” error
- How do I format a string using a dictionary in python-3.x?
- Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings
- Python map object is not subscriptable
- Android – Package Name convention
- How to execute an oracle stored procedure?
- .pyw files in python program
- How do I time a method’s execution in Java?
- -bash: export: `=’: not a valid identifier
- Error “The goal you specified requires a project to execute but there is no POM in this directory” after executing maven command
- Multiple try codes in one block
- Error in glm() in R
- What is a good Hash Function?
- Excel Filters – show only relevant values in the filter
- Conda command is not recognized on Windows 10
- How to transparent Unity3D custom shader?
- Converting string to integer VB.NET
- ImportError: No module named ‘django.core.urlresolvers’
- Python 3: Multiply a vector by a matrix without NumPy
- How to fix “Can’t find a default Python” error
- TypeError: ‘newline’ is an invalid keyword argument for this function
- Remove node_modules from git in vscode
- Import py file in another directory in Jupyter notebook
- How do you change session timeout in IIS 8.5?
- Differentiate between function overloading and function overriding
- How to embed image or picture in jupyter notebook, either from a local machine or from a web resource?
- How to print variable in sml?
- “E: Unable to locate package python3-pip”
- Good way to encapsulate Integer.parseInt()
- How to disable an Android button?
- How to set initial value and auto increment in MySQL?
- Chrome Broweser: csi.gstatic.com keeps loading
- How do you convert an entire directory with ffmpeg?
- Accessing dict_keys element by index in Python3
- What is the proof of of (N–1) + (N–2) + (N–3) + … + 1= N*(N–1)/2
- Merge posts plugin? [closed]
- How can I prevent the WordPress Importer from munging double-newline paragraph breaks to a single newline?
- Slow WP Site, theme.php not caching? Up to 25 second load time! [closed]
- A Compare And Distinction Essay Define To Beat Writer’s Block
- 27 Outstanding Faculty Essay Examples
- The Way To Write An Essay Outline In Four Steps
- How to hide subfolder of static pages in WordPress using htaccess
- How do I deal with a compromised server?
- Something is burning in the server room; how can I quickly identify what it is?
- Finding out what user Apache is running as?
- Do systemd unit files have to be reloaded when modified?
- What is a glue record?
- How do I convert a .cer certificate to .pem?
- Run Oracle SQL script and exit from sqlplus.exe via command prompt
- Show full process name in top
- How do you do load testing and capacity planning for web sites?
- What is a good SSH server to use on Windows? [closed]
- In systemd, what’s the difference between After= and Requires=?
- Windows Server restart / shutdown history
- How do I set the global PATH environment variable on OS X?
- nmap find all alive hostnames and IPs in LAN
- Should CNAME Be Used For Subdomains?
- How do I create user accounts from the Terminal in Mac OS X 10.5?
- How to get a .pem file from ssh key pair?
- How to inspect remote SMTP server’s TLS certificate?
- Choosing between meaningful and meaningless hostnames [closed]
- logrotating files in a directories and its subdirectories
- Multiple TXT fields for same subdomain
- How to restart Nginx on Mac OS X?
- Do SPF Records For Primary Domain apply to subdomains?
- Why is the response on localhost so slow?
- apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName