Python Server Side Script Inconsistency

Hello All,

I am running python 2.7 on Ubuntu 12.04 via a Linode 3072. While the software is written correctly, there seems to be an issue unrelated to the writing of the software the affects the output of the code. For example, in an attempts to debug a script, I will print to screen various variables within a loop. While the variable should only be printed once, on some iterations with will print the variable n number of times. This is not a software issue but perhaps a memory issue? I am looking for help in figuring out this error and how to begin troubleshooting.

Thanks,

Aaron

1 Reply

It's incredibly unlikely that you're experiencing a memory issue. Xen is far more memory-intensive than almost any Python script you could write, so you'd almost certainly be experiencing serious OS-level issues if the memory was bad.

Debugging Python is quite easy thanks to the pdb module: https://docs.python.org/2/library/pdb.html

Step through your script line-by-line with pdb until you reach the bad ouput code, then dump a stack trace to see what's going on.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct