<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Periodically receiving data from python using OSC]]></title><description><![CDATA[<p>Hi</p>
<p>I am working on a project in which I want to scrape data from a website and use it to manipulate parameters within pd. I am working on pd vanilla and python version 3.7.4</p>
<p>So far I have worked out how I can scrape data from websites using python and the beautifulsoup and requests library. What I need to be able to do now is work out how to periodically run this script again and again (say every minute for example) to keep the data up to date. I realise this part may be a question for a python forum but any guidance on this would be appreciated,</p>
<p>My main question, however, is how to then feed that information into pd. I have done a lot of reading and it seems like OSC is the best way to go, using python-osc. However, I am struggling to get my head round how I go about doing this as I am pretty new to coding and I can't find any tutorials or much information online about this. Has anyone had any experience doing this who can offer any advice?</p>
<p>Thanks in advance</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 16:05:46 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/12325.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Sep 2019 14:00:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Periodically receiving data from python using OSC on Tue, 24 Sep 2019 14:00:59 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>I am working on a project in which I want to scrape data from a website and use it to manipulate parameters within pd. I am working on pd vanilla and python version 3.7.4</p>
<p>So far I have worked out how I can scrape data from websites using python and the beautifulsoup and requests library. What I need to be able to do now is work out how to periodically run this script again and again (say every minute for example) to keep the data up to date. I realise this part may be a question for a python forum but any guidance on this would be appreciated,</p>
<p>My main question, however, is how to then feed that information into pd. I have done a lot of reading and it seems like OSC is the best way to go, using python-osc. However, I am struggling to get my head round how I go about doing this as I am pretty new to coding and I can't find any tutorials or much information online about this. Has anyone had any experience doing this who can offer any advice?</p>
<p>Thanks in advance</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc</guid><dc:creator><![CDATA[djpersonalspace]]></dc:creator><pubDate>Tue, 24 Sep 2019 14:00:59 GMT</pubDate></item><item><title><![CDATA[Reply to Periodically receiving data from python using OSC on Tue, 24 Sep 2019 17:20:27 GMT]]></title><description><![CDATA[<p>Is your question related to OSC in Pd or Python? Cause the latter would indeed fit a Python forum and not this one.<br />
As for the first part of your question, there are a couple of ways to run your script periodically. One way is to use [ggee/shell] (on Linux and Mac) to launch your script from within Pd. Since that is not a vanilla way, and it could be that you need to work with vanilla only, you can just put your Python script inside a <code>while True</code> loop and at the end of it put a <code>time.sleep(60)</code> to run it every one minute. You need to <code>import time</code> though. And that again is something that fits a Python forum.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/2</guid><dc:creator><![CDATA[alexandros]]></dc:creator><pubDate>Tue, 24 Sep 2019 17:20:27 GMT</pubDate></item><item><title><![CDATA[Reply to Periodically receiving data from python using OSC on Tue, 24 Sep 2019 19:06:37 GMT]]></title><description><![CDATA[<p>A quick way to do it:<br />
<a href="https://guitarextended.wordpress.com/2012/11/03/make-python-and-pure-data-communicate-on-the-raspberry-pi/" rel="nofollow">https://guitarextended.wordpress.com/2012/11/03/make-python-and-pure-data-communicate-on-the-raspberry-pi/</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/3</guid><dc:creator><![CDATA[EEight]]></dc:creator><pubDate>Tue, 24 Sep 2019 19:06:37 GMT</pubDate></item><item><title><![CDATA[Reply to Periodically receiving data from python using OSC on Thu, 26 Sep 2019 11:57:34 GMT]]></title><description><![CDATA[<p>I am unsure how OSC works so im not sure. I'm basically looking for a vanilla way, so what you have described should work. I will look into this. Thanks for the advice guys</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/4</guid><dc:creator><![CDATA[djpersonalspace]]></dc:creator><pubDate>Thu, 26 Sep 2019 11:57:34 GMT</pubDate></item><item><title><![CDATA[Reply to Periodically receiving data from python using OSC on Thu, 26 Sep 2019 18:42:49 GMT]]></title><description><![CDATA[<p>Have a look at Pd's [oscformat] and [oscparse] help patches. In order to receive OSC from another program you need a [netreceive -u -b portNr] to receive raw bytes in a UDP connection.<br />
As for Python, there are dozens of tutorials for sending and receiving OSC.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12325/periodically-receiving-data-from-python-using-osc/5</guid><dc:creator><![CDATA[alexandros]]></dc:creator><pubDate>Thu, 26 Sep 2019 18:42:49 GMT</pubDate></item></channel></rss>