<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>s51517765</author_name>
  <author_url>https://blog.hatena.ne.jp/s51517765/</author_url>
  <blog_title>プログラミング素人のはてなブログ</blog_title>
  <blog_url>https://s51517765.hatenadiary.jp/</blog_url>
  <categories>
    <anon>python_3</anon>
  </categories>
  <description>発生した問題Pythonで条件を指定してフォルダの画像ファイル（ここではpxが100x100以下）を削除しようとしたらPermissionErrorと怒られました。以下のようにPILで画像を開いてサイズを取得、条件に一致したら削除、というようなことをやろうとしました。 from PIL import Image os.chdir(r&quot;C:\Users\***\Documents\***&quot;) files = glob.glob(&quot;./*&quot;) for file in files: if &quot;.jpeg&quot; in file: #拡張子で画像をさがす img = Image.open(file) if i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fs51517765.hatenadiary.jp%2Fentry%2F2020%2F12%2F07%2F073000&quot; title=&quot;Pythonでos.remove()を使って条件を指定してファイルを削除しようとするとPermissionErrorになる - プログラミング素人のはてなブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn.blog.st-hatena.com/images/theme/og-image-1500.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-12-07 07:30:00</published>
  <title>Pythonでos.remove()を使って条件を指定してファイルを削除しようとするとPermissionErrorになる</title>
  <type>rich</type>
  <url>https://s51517765.hatenadiary.jp/entry/2020/12/07/073000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
