2017-02-13 25 views
-1

Ich habe Python 3.3 auf meinem Rechner installiert, aber da mag ich ein Programm verwenden, die 2.6 Python erfordert nur, wie kann ich von Python 3.3 zu Python 2.6Von Python 3.3 Python 2.6

Ich bewege tun verwende Ubuntu.

Antwort

0

Verwenden python statt python3

# Python2 
$ python 
Python 2.7.10 (default, Jul 30 2016, 18:31:42) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> 

# Python3 
$ python3 
Python 3.5.2 (default, Nov 7 2016, 17:25:58) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> 

Oder erklären in Ihrer Python-Dateien,

#!/usr/bin/env python 
# -*- coding: utf-8 -*- 
+2

'Python' vs 'python3' ist völlig abhängig davon, wie es installiert wurde ... keine allgemeine Lösung. Shebang ist gut, aber nur für * nix – Aaron

+0

@Aaron, thx für das darauf hinweisen. – SparkAndShine