・ If you make a bat file, you do not have to mess with the black screen as much as possible. -It is necessary to specify the python path in the environment variable in advance.
cd /d %~dp0 python test.py pause
from sklearn.datasets import load_iris import pandas as pd import seaborn as sns iris = load_iris() df = pd.DataFrame(iris.data, columns=iris.feature_names) df['target'] = iris.target img1 = sns.lmplot('sepal length (cm)','sepal width (cm)',data=df,hue='target') img1.savefig("out_img1/img1.png ") img2 = sns.pairplot(df, hue="target") img2.savefig("out_img2/img2.png ")
This time, I prepared subfolders named out_img1 and 2 in any folder. The output is output to the specified subfolder.
Put the bat file and py file in the same folder and execute bat