Ich habe ein Stück Code, der in Linux funktioniert, und ich versuche jetzt, es in Windows auszuführen, ich importiere sys, aber wenn ich sys.exit() verwende. Ich bekomme einen Fehler, sys ist nicht definiert. Hier ist der Anfangsteil meines Codespython: sys ist nicht definiert
try:
import numpy as np
import pyfits as pf
import scipy.ndimage as nd
import pylab as pl
import os
import heapq
import sys
from scipy.optimize import leastsq
except ImportError:
print "Error: missing one of the libraries (numpy, pyfits, scipy, matplotlib)"
sys.exit()
Warum funktioniert sys nicht ??
ah ja, dank – astrochris