Compiles Python code with no error but giving out no output

username: programmingflea
cooked: <p>Am running Python 3.8.10 in a 32-bit Windows 7 computer with only 2GB memory and no video card (not even an NVIDIA) - it’s a two decade old netbook…<br>
Tried running the following code:</p>
<p>import numpy as np<br>
from scipy import ndimage</p>
<p>def predict_next_string(database):</p>
<h1><a name="split-the-database-into-a-list-of-strings-1" class="anchor" href="#split-the-database-into-a-list-of-strings-1"></a>Split the database into a list of strings</h1>
<p>strings = np.array(database.split(‘\n’))</p>
<p><span class="hashtag-raw">#last_two_strings</span> = ndimage.laplace(strings.astype(bool), mode=‘constant’)</p>
<h1><a name="check-if-there-are-at-least-two-strings-2" class="anchor" href="#check-if-there-are-at-least-two-strings-2"></a>Check if there are at least two strings</h1>
<p>if len(last_two_strings) &lt; 2:<br>
print (“Not enough strings in the database,”)<br>
return</p>
<h1><a name="get-the-second-to-the-last-string-in-the-list-3" class="anchor" href="#get-the-second-to-the-last-string-in-the-list-3"></a>Get the second-to-the-last string in the list</h1>
<p>last_string = last_two_strings[-1]</p>
<h1><a name="split-the-last-string-into-a-list-of-integers-4" class="anchor" href="#split-the-last-string-into-a-list-of-integers-4"></a>Split the last string into a list of integers</h1>
<p>last_string_numbers = [int(x) for x in last_string.split()]</p>
<h1><a name="increment-each-number-by-one-and-return-the-resulting-string-5" class="anchor" href="#increment-each-number-by-one-and-return-the-resulting-string-5"></a>Increment each number by one and return the resulting string</h1>
<p>predicted_string = ’ '.join([str(x + 1) for x in last_string_numbers])</p>
<p>print(“The predicted next string is”, predicted_string)</p>
<p>database = “”“5 3 4 5 1 2<br>
1 3 1 5 0 4<br>
2 3 0 5 1 2<br>
0 5 4 0 5 2<br>
1 1 0 5 2 4<br>
4 1 4 3 0 0<br>
4 3 3 3 2 3<br>
2 3 3 1 4 1<br>
4 2 3 3 1 1<br>
2 3 1 4 4 2<br>
0 2 3 4 2 2<br>
3 4 5 4 5 1<br>
2 4 3 1 0 2<br>
2 1 2 2 0 5<br>
4 4 1 0 1 3<br>
2 2 5 4 0 2<br>
3 2 2 2 4 3<br>
4 1 3 3 3 2<br>
5 3 3 1 3 5<br>
1 0 2 2 5 3<br>
1 3 3 5 0 2<br>
2 3 4 1 1 0<br>
0 0 4 2 4 1<br>
4 3 2 4 1 3<br>
3 4 4 1 1 4<br>
1 2 4 1 5 4<br>
5 5 4 2 0 5<br>
5 4 1 4 5 5<br>
4 4 4 2 2 0<br>
1 3 1 2 0 1<br>
1 2 4 4 5 5<br>
3 2 1 4 5 5<br>
5 1 5 2 5 4<br>
1 2 4 1 5 2<br>
5 5 4 2 0 5<br>
5 4 1 4 5 5<br>
4 4 4 2 2 0<br>
1 3 1 2 0 1<br>
1 2 4 4 5 5<br>
3 2 1 4 5 5<br>
5 1 5 2 5 4<br>
0 1 5 5 5 4<br>
3 3 1 5 3 5<br>
“””</p>
<p>It is meant to predict the next string of 6 numbers from 0 to 5.</p>
<p>There are no errors when I compiled it - but for some reason, it’s not giving out an output.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/7/2/722efb36dc5a451db5f1c68ecfcad7f71001c93b.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/722efb36dc5a451db5f1c68ecfcad7f71001c93b" title="source code output_03202023"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/7/2/722efb36dc5a451db5f1c68ecfcad7f71001c93b_2_690x133.jpeg" alt="source code output_03202023" data-base62-sha1="gi75uDnBqdDvLN4WgpslwzEEbMf" width="690" height="133" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/7/2/722efb36dc5a451db5f1c68ecfcad7f71001c93b_2_690x133.jpeg, https://discuss.pytorch.org/uploads/default/original/3X/7/2/722efb36dc5a451db5f1c68ecfcad7f71001c93b.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/7/2/722efb36dc5a451db5f1c68ecfcad7f71001c93b.jpeg 2x" data-dominant-color="F2F2F2"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">source code output_03202023</span><span class="informations">787×152 47.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>What could be wrong with the code?</p>

username: ptrblck
cooked: <p>You might want to run the script from your terminal to get a better error message and to see if e.g. you are running out of memory or if another error is raised.<br>
Your code also doesn’t seem to use PyTorch at all, as it’s also unsupported on 32bit systems (or rather the binaries are not built for it).</p>