マイPrankHeader.pyウィンドウのエラー:[エラー3]システムは指定されたパスを見つけることができません。」.prankは/*.*
import os
def removeNumber(str):
no_digit = []
for char in str:
if not char.isdigit():
no_digit.append(char)
return no_digit
def renameFiles():
saved_file = os.getcwd()
os.chdir("./prank")
# 1. loop through files in the directory
for files in os.listdir("./prank"):
# 2. if the file has the number, delete.
newFile = removeNumber(files)
# 3. make the list of char to string
newFile = ''.join(newFile)
os.rename(files, newFile)
os.chdir(saved_file)
そして、私のPrank.py
import PrankHeader
PrankHeader.renameFiles()
示されています両方のファイルはC:/ Users/Myname/Desktop/LocalServer/Prankフォルダーにあり、フィラーにはピクチャーを含むPrankフォルダーがあります。 [エラー3]システムは、指定されたパスを見つけることができません:私はそれは私に 」ウィンドウのエラーを示したプログラムを実装しようとした
『/ を.prankを』
なぜ私を知っている誰もがありますエラーが発生している?
ディレクトリPrankにos.chdir( "Prankt")を実行し、そのディレクトリでos.listdir( "./ – erik
実際には、ディレクトリPrankにPrankディレクトリがあります。最初のPrankは、Prankディレクトリにあります。PrankディレクトリにはPrankディレクトリがあります。プログラム(dirsとpy)と2番目のいたずらは、名前を変更したい画像の束を含むフォルダです。 –