print(variable) doesn't work. Why??
Verfasst: Dienstag 17. Mai 2022, 15:03
Hello All,
i wrote a short python Prog and put some print's within to check the status of the variables
Here is the Code:
# import re
import os
#import pandas as pd
from pathlib import Path
# import hashlib
from sys import argv
print("Hallo Welt")
print("!")
# --------------------------------------------------------------------------
speicher =[]
Dateiuebersicht = []
link = r"O:\Marcel_W\Diagdcf"
Daten_Verzeichnis: Path = Path(link)
for Ordnerinhalt in os.walk(Daten_Verzeichnis):
for Datei_Name in Ordnerinhalt[2]:
full_path: Path = Path(Ordnerinhalt[0]) / Path(Datei_Name)
if (full_path.suffix.lower() == ".cap") & (
int(full_path.stat().st_size) > 1):
**print(full_path.stat().st_size)
print(full_path.stat().st_mtime)
print((full_path.suffix))**
Dateiuebersicht.append(Path(Ordnerinhalt[0], Datei_Name))
**print("Hier")
print(Dateiuebersicht)**
The Output stated:
C:/Users/nx023526/PycharmProjects/django-datta-able-master/apps/read_parset_log.py
Hallo Welt
!
Process finished with exit code 0
Can anyone help me to find the Reason why print "Hello World works" but printing the variables is not possible?? Using the Programm step by step in the python console is no problem.
Big thanks in advance.
Best Regards
i wrote a short python Prog and put some print's within to check the status of the variables
Here is the Code:
# import re
import os
#import pandas as pd
from pathlib import Path
# import hashlib
from sys import argv
print("Hallo Welt")
print("!")
# --------------------------------------------------------------------------
speicher =[]
Dateiuebersicht = []
link = r"O:\Marcel_W\Diagdcf"
Daten_Verzeichnis: Path = Path(link)
for Ordnerinhalt in os.walk(Daten_Verzeichnis):
for Datei_Name in Ordnerinhalt[2]:
full_path: Path = Path(Ordnerinhalt[0]) / Path(Datei_Name)
if (full_path.suffix.lower() == ".cap") & (
int(full_path.stat().st_size) > 1):
**print(full_path.stat().st_size)
print(full_path.stat().st_mtime)
print((full_path.suffix))**
Dateiuebersicht.append(Path(Ordnerinhalt[0], Datei_Name))
**print("Hier")
print(Dateiuebersicht)**
The Output stated:
C:/Users/nx023526/PycharmProjects/django-datta-able-master/apps/read_parset_log.py
Hallo Welt
!
Process finished with exit code 0
Can anyone help me to find the Reason why print "Hello World works" but printing the variables is not possible?? Using the Programm step by step in the python console is no problem.
Big thanks in advance.
Best Regards