<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed><type>rich</type><version>1.0</version><provider_name>phorkie</provider_name><provider_url>https://p.cweiske.de/</provider_url><title>errbot: named fifo to send messages</title><author_name>Christian Weiske</author_name><cache_age>86400</cache_age><width>900</width><height>900</height><html>&lt;!-- embedding all files of https://p.cweiske.de/339 --&gt;
&lt;link rel="stylesheet" href="https://p.cweiske.de/css/embed.css"/&gt;
&lt;div class="phork" id="339"&gt;
    &lt;div class="phork-file"&gt;
 &lt;div class="phork-content"&gt;
  &lt;style type="text/css"&gt;&lt;/style&gt;&lt;div class="code"&gt;&lt;table class="py"&gt;&lt;tbody&gt;&lt;tr class="li1"&gt;&lt;td class="ln"&gt;&lt;pre class="de1"&gt;1
2
3
4
5
6
7
&lt;/pre&gt;&lt;/td&gt;&lt;td class="de1"&gt;&lt;pre class="de1"&gt;if not os.path.exists(pipe_name):&#13;
&amp;#160; &amp;#160; os.mkfifo(pipe_name) &#13;
&amp;#160; &amp;#160; pipein = open(pipe_name, 'r')&#13;
&amp;#160; &amp;#160; while True:&#13;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; line = pipein.readline()[:-1]&#13;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.send(...)&#13;
&amp;#160;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
 &lt;/div&gt;
 &lt;div class="phork-meta"&gt;
  &lt;a href="https://p.cweiske.de/339/rev-raw/d02ce62d783e14d999b10b8d0a7ba3c9e1b38135/code.py" style="float: right"&gt;view raw source&lt;/a&gt;
  &lt;a href="https://p.cweiske.de/339#code.py"&gt;code.py&lt;/a&gt;
 &lt;/div&gt;
&lt;/div&gt;
    &lt;div class="phork-file"&gt;
 &lt;div class="phork-content"&gt;
  &lt;div class="code"&gt;&lt;pre class="txt"&gt;&amp;lt;gbin&amp;gt; something as simple as that in a thread ?&lt;/pre&gt;&lt;/div&gt;

 &lt;/div&gt;
 &lt;div class="phork-meta"&gt;
  &lt;a href="https://p.cweiske.de/339/rev-raw/d02ce62d783e14d999b10b8d0a7ba3c9e1b38135/phork0.txt" style="float: right"&gt;view raw source&lt;/a&gt;
  &lt;a href="https://p.cweiske.de/339#phork0.txt"&gt;phork0.txt&lt;/a&gt;
 &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</html></oembed>
