Hallo,
ich möchte gerne ne Datei einlesen und die Variable weiter verarbeiten mein Code bisher:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
|
elif 'windows' in platform.system().lower():
source_file_list= 'dp_source.ini'
excludes_list='dp_excludes.ini'
dp_excludes_file=open(excludes_list)
for excludeline in dp_excludes_file.readlines():
if excludeline.lower().strip().startswith("excludes"):
excludes=re.split('^excludes\s=', excludeline.lower().strip())[1]
dp_source_file = open(source_file_list)
for lines in dp_source_file.readlines():
if lines.lower().strip().startswith("sources"):
sources = re.split('^sources\s*=', lines.lower().strip())[1]
|
Die Sources werden übernommen Jedoch die Excludes ignoriert ich hoffe jemand kanns mir erklären was falsch ist
die sources.ini=
sources ='C:\'
die Excludes.ini=
excludes ='C:\Windows\'
natürlich bekommt excludes noch mehrere Ordner aber immer wenn ich die excludes aus Datei einlese hat meine Sicherung 0kb.
auch im Forum
http://www.python-forum.de konnte oder wollte mir niemand helfen.
Vielen dank schonmal