Python Forum
Does stack overflow exist in python ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does stack overflow exist in python ?
#1
Hi all. I am working on a file using many matrixes. So I have problems with the interpreter. It seems broken. Is that "stack overflow". If it is "stack overflow", what shall I do to make it disappear ?

my code here
Reply
#2
I don't know if it's a stack overflow. You need to post exactly what the interpreter is telling you (or doing), or I can't explain what it is telling you (or doing).
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
There is no long time I started my PC. I tried another file with less matrixes and fortunately it works well. It is strange that Mark Lutz does not refer to "stack overflow". Tell me please if it really exists in an interpreter, as it exists in a compiler of C++. Thanks
Reply
#4
I kept all the matrixes. I only changed positions of matrixes in the file. Now every thing works well. Here is the new code:...
#file9.py
from pprint import pprint

print("MULTIPLICATION TABLE")
def pause():
   input("Press ENTER to continue")


M = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
print("New values in the matrix")
for i in range(len(M)):
   for j in range(len(M)):
       M[i][j] = i * j

pprint(M)
pause()
print("This multiplication_table 'N' is a matrix beginning by a 1")
N = []
for x in range(1, 10):
   new_row = []
   for y in range(1, 10):
       new_row.append(x * y)
   N.append(new_row)
pprint(N)


pause()
print("\nNow a display of the same, row by row")
for row in N[0:]:  # begin by item 0
   print(row[0:])  # begin by item 0

pause()
print("The following 'P' is a matrix")
P = [[x * y for y in range(1, 10)] for x in range(1, 10)]
pprint(P)

pause()
print("\nNow action between the 2 matrixes 'M', beginning with a 0, and 'N' with a 1 ")
print([M[row][col] * N[row][col] for row in range(5) for col in range(5)])
print("second action")
print([[M[row][col] * N[row][col] for row in range(5)] for col in range(5)])


pause()
print("New 'P'  in a square")
for i in range(len(P)):
   for j in range(len(P)):
       if len(str(P[i][j])) == 1:
           P[i][j] = " " + str(P[i][j])
       else:
           P[i][j] = str(P[i][j])
for x in range(len(P)):
   print(P[x])

exit()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UndefinedEnvironmentName: 'extra' does not exist in evaluation environment EarthAndMoon 3 1,678 Oct-09-2023, 05:38 PM
Last Post: snippsat
  check if a file exist on the internet and get the size kucingkembar 6 1,756 Apr-16-2022, 05:09 PM
Last Post: kucingkembar
  SQLALCHEMY - Column doesn't exist jamesaarr 9 7,524 Nov-04-2021, 09:20 AM
Last Post: ndc85430
  pathlib destpath.exists() true even file does not exist NaN 9 4,652 Dec-01-2020, 12:43 PM
Last Post: NaN
  Syntax not exist noorpy 1 1,996 Nov-14-2019, 09:23 AM
Last Post: perfringo
  Shutil attempts to copy directories that don't exist ConsoleGeek 5 4,521 Oct-29-2019, 09:26 PM
Last Post: Gribouillis
  get value if it's exist [python] senait 1 1,754 Aug-21-2019, 06:47 AM
Last Post: buran
  Python says module doesn't exist... I say it does! EricMichel 2 3,076 May-14-2019, 03:26 AM
Last Post: EricMichel
  How to recognize, what functions are filled in of the Python interpreter stack? AlekseyPython 3 2,680 Mar-13-2019, 12:14 PM
Last Post: AlekseyPython
  pathlib: resolving a path that does not exist Skaperen 6 5,474 Sep-08-2018, 12:25 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020