Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
190 views
in Technique[技术] by (71.8m points)

python - Path error using Atom Teletype on both Mac and Windows

I'm currently working on a project on Atom using Teletype (so I can work on Discord with somebody). The code is working fine locally. But, when I try to run it using Teletype (my friend is hosting), it fails like that:

python: can't open file 'C:Pythoncode_perso@Turelure13:Pythoniocapteur_first_step.py': [Errno 22] Invalid argument'

I assumed I should define the path differently but locally it's OK for both of us. So, it might be the path added by teletype that induce an error.. Also, I'm on Windows and my friend on Unix.

import numpy as np
import pandas as pd
from pathlib import Path #Offers classes representing filesystem paths with semantics appropriate for different OS.
import matplotlib.pyplot as plt

DATA_PATH = Path("Spectre TFBG.txt")


data = pd.read_csv(DATA_PATH, sep='', skiprows=[0,1,2,3,4,5,6], header=0, skipfooter=0, engine='python')
data2 = data.drop(columns=['X Axis - Frequency (GHz)'])
print(data2)

#Ecriture du fichier CSV
data2.to_csv('newdata_modified.csv')
question from:https://stackoverflow.com/questions/66047713/path-error-using-atom-teletype-on-both-mac-and-windows

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...