を使用して、私は、ファイルパスの束持っている:私は数のID(2001)を定義することができれば一度ID番号を定義し、それをすべてのファイルパス
shapefile = "C:\\file\\path \\here\\this\\one\\is\\different\\2001_6W.shp"
place1 = "C:\\file\\path\\here\\place1_2001.shp"
place2 = "C:\\file\\path\\here\\place2_2001.shp"
place3 = "C:\\file\\path\\here\\place3_2001.shp"
が、私はそれを希望し、その後、それが中で使用されてきましたファイル名は次のようになります。
ID = 2001
shapefile = "C:\\file\\path \\here\\this\\one\\is\\different\\ID_6W.shp"
place1 = "C:\\file\\path\\here\\place1_ID.shp"
place2 = "C:\\file\\path\\here\\place2_ID.shp"
place3 = "C:\\file\\path\\here\\place3_ID.shp
これを行う方法はありますか?私は私が非常によくしたいことを説明したかどうか分かりません。
正規表現を使用することはできますが、なぜそうしたいのですか? "C:\\ file \\ path \\ here \\ place1 _" + ID + "shp"のような文字列を追加するだけでいいのですか? – OneRaynyDay