Skip to content Skip to sidebar Skip to footer

Python Output Is Different Than What I Need

Hi guys I'm farely new to python and I need your help. import sys, http.client file = open('out.txt', 'w') showlines = 50 npa = [] try: servername = sys.argv[1] except:

Solution 1:

If you can change the script, do this:

file.write(',' + npa[i])

If you can't change this script do this:

If your script is called "example.py", then you could invoke it like this:

python example.py ; sed -i s/NXX//g out.txt

This will remove NXX from its output.

Post a Comment for "Python Output Is Different Than What I Need"