<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Ciao di nuovo.</p>
<p><br>
</p>
<p>Ho questo codice:</p>
<p><br>
</p>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;"><div><span style="color: #9cdcfe;">fn</span><span style="color: #d4d4d4;"> = </span><span style="color: #dcdcaa;">input</span><span style="color: #d4d4d4;">(</span><span style="color: #ce9178;">"filename.ext to prepare? > "</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #c586c0;">try</span><span style="color: #d4d4d4;">:</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">f</span><span style="color: #d4d4d4;">=</span><span style="color: #dcdcaa;">open</span><span style="color: #d4d4d4;">(</span><span style="color: #9cdcfe;">fn</span><span style="color: #d4d4d4;">, </span><span style="color: #ce9178;">"rt"</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">rig</span><span style="color: #d4d4d4;"> = </span><span style="color: #9cdcfe;">f</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">readlines</span><span style="color: #d4d4d4;">()</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">f</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">close</span><span style="color: #d4d4d4;">()</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #dcdcaa;">print</span><span style="color: #d4d4d4;">(</span><span style="color: #569cd6;">f</span><span style="color: #ce9178;">"File: </span><span style="color: #569cd6;">{</span><span style="color: #9cdcfe;">fn</span><span style="color: #569cd6;">}</span><span style="color: #ce9178;"> found, with </span><span style="color: #569cd6;">{</span><span style="color: #dcdcaa;">len</span><span style="color: #d4d4d4;">(</span><span style="color: #9cdcfe;">rig</span><span style="color: #d4d4d4;">)</span><span style="color: #569cd6;">}</span><span style="color: #ce9178;"> lines of text."</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #c586c0;">except</span><span style="color: #d4d4d4;">:</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #dcdcaa;">print</span><span style="color: #d4d4d4;">(</span><span style="color: #569cd6;">f</span><span style="color: #ce9178;">"Sorry, file: </span><span style="color: #569cd6;">{</span><span style="color: #9cdcfe;">fn</span><span style="color: #569cd6;">}</span><span style="color: #ce9178;"> not found.</span><span style="color: #d7ba7d;">\n</span><span style="color: #ce9178;">Relaunch the App and try with another filename."</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #d4d4d4;"> </span><span style="color: #4ec9b0;">sys</span><span style="color: #d4d4d4;">.</span><span style="color: #dcdcaa;">exit</span><span style="color: #d4d4d4;">()</span></div>
Il file è certamente presente nella cartella dello script, ne sono ASSOLUTAMENTE certo. Eppure, non trova il file che gli chiedo.</div>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;">Magari ne trova altri, ma quello che mi interessa, solleva l'eccezione e termina lo script. Quali ragioni possono esserci</div>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;">Si tratta di tutti file di testo.</div>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;">Il nome digitato è corretto.</div>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;">
</div>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;">Gabry</div>
<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 10px;line-height: 14px;white-space: pre;">
</div>
<pre class="moz-signature" cols="72">--
--... ...-- -.. . .. --.. ....- .- .--. ..- - ..- . .
Sent from TB on Windows 10, Genus Bononiae's computer.</pre>
</body>
</html>