Skip to content
Advertisement

Tag: python-2.7

Issue with installing Python 2.7.8 alongside 2.7.5 on RHEL 7.2

I have an Amazon EC2 instance with Red Hat Linux 7.2 installed. It comes with Python 2.7.5 installed system wide. I’ve compiled an alternative installation of Python 2.7.8 (which is what I use in another environment that I’m trying to replicate). I will use this to create a virtualenv to launch my Django application. But invoking python2.7 always takes me

G++ cannot resolve paths when called from subprocess

I am writing a small python script to for automatic student homework evaluation. I have a skeleton, where submitted homework is unzipped into a temporary folder and my script is called with path to the temporary folder as an argument. My script first copies over some extra files I need and then tries to compile c++ code roughly like this:

Root autentication on a Python program

I have the root password saved in a variable. How I can give the root authorization at my program? This can be an example: Answer It is impossible to do it in the way you try. Your program is already started under some non-root user and you cannot change it inside this program. You can spawn other process which will

Summing columns in a text file

I have a data file that looks like this: and so on……till TOPIC:topic_2000. The first line is the topic and it’s weight. That is, I have the words in that specific topic and their respective weights. Now, I want to sum up the second column of each topic and check what value it gives. That is, I want to get

Advertisement