Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to set python2 as my default? Post 303035090 by Circuits on Tuesday 14th of May 2019 01:40:27 PM
Old 05-14-2019
For anyone in the future who might have stumbled upon this thread:

The easiest way to switch between Python 3 and Python 2:
Code:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 5

Code:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 4

The above will make Python3 the default. Then, to switch to python2:
Code:
 sudo update-alternatives --set python /usr/bin/python2

To switch back to python3:
Code:
sudo update-alternatives --set python /usr/bin/python3

These 3 Users Gave Thanks to Circuits For This Post:
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to set server's ip address, router, network mask and set if it is an internal or external ip?

Hello, I need to write a program which sets server's ip address, router, network mask. Program also should set if it is an internal or external ip. Maybe someone can help me ? Any information from u is very useful :b: I stopped at .. :( #!/bin/sh A=`hostname -i` echo "server ip address is $A"... (4 Replies)
Discussion started by: zagaruika
4 Replies

2. Shell Programming and Scripting

set Net:SSH:Expect timeout and set it again.

SSHing into a machine can take a few seconds, but after I'm in, the commands return quickly. I was wondering if the timeout setting can be changed once I'm logged into the machine. Does anyone know if this can be set on the fly? The problem here is, if I have to set timeout = 10, it'll take 10... (1 Reply)
Discussion started by: mrwatkin
1 Replies

3. UNIX and Linux Applications

[Urgent]Problem on setting up the apache2.2.6 and mod_wsgi3.2 and python2.5.4

Hi everyone, So far, I have done all the steps (including creating django.wsgi in the project). The step left is to turn on the httpd, but error put exit in this very last step. :( <user> #: ./apachetrl start httpd: Syntax error on line 450 of /usr/local/apache2/conf/httpd.conf: Cannot... (1 Reply)
Discussion started by: AlexCheung
1 Replies

4. Web Development

[Urgent]Problem on setting up the apache2.2.6 and mod_wsgi3.2 and python2.5.4

Hi everyone, So far, I have done all the steps (including creating django.wsgi in the project). The step left is to turn on the httpd, but error put exit in this very last step.:( <user> #: ./apachetrl start httpd: Syntax error on line 450 of /usr/local/apache2/conf/httpd.conf: Cannot load... (1 Reply)
Discussion started by: AlexCheung
1 Replies

5. Shell Programming and Scripting

python2.3 to python2.6

Hi All i have a script written in python2.3 but it no longer works for python2.6 is there an easier way to check what needs to be changed (1 Reply)
Discussion started by: ab52
1 Replies

6. Solaris

LC_ALL & LANG are set OK, but others couldn't set locale correctly.

Hi, I have a Solaris (SunOS 5.10) installed, by default with the en_AU.UTF-8 locale. I want to change it to en_US.UTF-8 With AU, I have no issues whatsoever, so I installed the language package and now locale -a shows "en_US.UTF-8". Problem is even with LC_ALL set in etc/default/init, the... (2 Replies)
Discussion started by: asdfg
2 Replies

7. Shell Programming and Scripting

Help needed with shell script to search and replace a set of strings among the set of files

Hi, I am looking for a shell script which serves the below purpose. Please find below the algorithm for the same and any help on this would be highly appreciated. 1)set of strings need to be replaced among set of files(directory may contain different types of files) 2)It should search for... (10 Replies)
Discussion started by: Amulya
10 Replies
PYTHON-COVERAGE(1)					      General Commands Manual						PYTHON-COVERAGE(1)

NAME
python-coverage - measure code coverage of Python program execution SYNOPSIS
python-coverage -x module.py [ARG...] python-coverage -e python-coverage -r [-m] python-coverage -a [file...] DESCRIPTION
python-coverage executes a Python program and measures which of its statements are executed and which are not. It stores the information in the file .coverage in the current working directory. OPTIONS
-e Erase the .coverage file. -x Execute a Python module, giving it the remaining command line arguments. -r Produce a coverage report. -m With -r, show the line numbers that were missed by the execution. -a Annotate source files. For each source file foo, produce foo,cover, with executed lines prefixed by ">" and non-executed by "!". --help Produce a help summary. It might be more helpful than this manual page. AUTHOR
The python-coverage command is a one-line Python script which calls the coverage.py Python module to do all the work. The module was rigi- nally developed by Gareth Rees, and is now developed by Ned Batchelder. The module's home page is http://www.nedbatchelder.com/code/modules/coverage.html. This manual page was cobbled together by Lars Wirzenius for Debian, by copy-pasting from the help texts from the module. PYTHON-COVERAGE(1)
All times are GMT -4. The time now is 09:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy