top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How we can check which python version been used to write script/tool?

+1 vote
259 views
How we can check which python version been used to write script/tool?
posted Oct 30, 2015 by Amit Kumar Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Try something like

>>> import sys
>>> print (sys.version) 
answer Oct 30, 2015 by Salil Agrawal
Similar Questions
0 votes

How can write a python script which will execute some perl scripts in a gui and shouldn't be post processed....?

+1 vote
0 votes

I'm trying to write a python script that writes some content to a file root through sudo, but it's not working at all. I am using:

 channel = 'stable'
 config_file = '/opt/ldg/etc/channel.conf'
 command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_file]
 p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 out, _ = p.communicate()

But it seems as if this isn't doing anything.

I just want to write the contents of the variable channel to the file /opt/ldg/etc/channel.conf. But whatever I try just doesn't work. Can anyone offer any pointers?

...