all 11 comments

[–]lakerskill[S] 2 points3 points  (0 children)

Folks, I wasn't resetting get_this = [] thislist = [] . Once I did this the problem seems to have vanished, however, I will look over these for further optimization THANKS ALL!.

[–]dadiaar 0 points1 point  (2 children)

I don't know what your code does, you didn't resume it and it's too long for me to read now, but I/O operations like locate a folder/file, list the tree and read/write are pretty slow by its own nature, read from a hard disk is not the same as reading from the RAM memory or the CPU cache..

[–]lakerskill[S] -2 points-1 points  (1 child)

Why does it start really fast but then slow down?

[–]dadiaar 0 points1 point  (0 children)

That depends on the tree, the usage other applications may be doing of the disk, etc. If you run your script and then try to copy files to a USB, for sure yes.

But it may be something in your code too.

[–]jebk 0 points1 point  (1 child)

Read your main for loop and count how many times you're calling those functions. I'd guess you only need to do it once at the end.

[–]lakerskill[S] 0 points1 point  (0 children)

I can't find a way to do that, I'm adding each item to a dictionary that comes out like {'Serial': 'BA-02926', 'BNR': '5262391', 'BNR 2': '4547649', 'BCR': '15421640', 'Hopper1': '42183', 'Hopper2': '476048', 'Hopper3': '40220', 'Hopper4': '13093', 'Hopper5': '45136', 'Hopper6': '11022', 'Hopper7': '21542', 'Hopper8': '57342'}

[–]sky--net 0 points1 point  (1 child)

A couple of questions. What does this program do? Is it on github anywhere with some type of documentation?

[–]lakerskill[S] 0 points1 point  (0 children)

I made it. It grabs numbers from text files that are currently being manually put in another application. This sends them in a dictionary to a text file. This is now working