<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Graph Forums — Python scripting question]]></title>
		<link>https://forum.padowan.dk/viewtopic.php?id=786</link>
		<atom:link href="https://forum.padowan.dk/extern.php?action=feed&amp;tid=786&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Python scripting question.]]></description>
		<lastBuildDate>Sat, 16 Feb 2013 10:43:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Python scripting question]]></title>
			<link>https://forum.padowan.dk/viewtopic.php?pid=2187#p2187</link>
			<description><![CDATA[<p>Thank you for the very fast responses. For now I will use the technique suggested by GraphUser3546 and thanks to Ivan for looking into this.</p>]]></description>
			<author><![CDATA[null@example.com (scottmarley85)]]></author>
			<pubDate>Sat, 16 Feb 2013 10:43:05 +0000</pubDate>
			<guid>https://forum.padowan.dk/viewtopic.php?pid=2187#p2187</guid>
		</item>
		<item>
			<title><![CDATA[Re: Python scripting question]]></title>
			<link>https://forum.padowan.dk/viewtopic.php?pid=2182#p2182</link>
			<description><![CDATA[<p>I can see that there is a bug in the Eval() function so it assumes that the function always is in the function list and it crashes when it is not. I will try to get it fixed.</p>]]></description>
			<author><![CDATA[null@example.com (Ivan Johansen)]]></author>
			<pubDate>Sat, 16 Feb 2013 01:19:37 +0000</pubDate>
			<guid>https://forum.padowan.dk/viewtopic.php?pid=2182#p2182</guid>
		</item>
		<item>
			<title><![CDATA[Re: Python scripting question]]></title>
			<link>https://forum.padowan.dk/viewtopic.php?pid=2181#p2181</link>
			<description><![CDATA[<p>I tried asking the evaluation directly, without going through a dydx variable :</p><div class="codebox"><pre><code>&gt;&gt;&gt; Graph.Selected.MakeDifFunc().Eval(1)</code></pre></div><p>and got that error as well :<br /></p><div class="codebox"><pre><code>Access violation at address 005248A5 in module &#039;Graph.exe&#039;. Read of address 00000008.</code></pre></div><p>As a workaround, add the derivative of the function to the list of functions in the grf file, and then evaluate the function you want :<br /></p><div class="codebox"><pre><code>&gt;&gt;&gt; Graph.FunctionList.append(Graph.Selected.MakeDifFunc())
&gt;&gt;&gt; Graph.FunctionList[len(Graph.FunctionList)-1].Eval(1)</code></pre></div><p>&quot;len(Graph.FunctionList)-1&quot; is the list index of the last item in the list, since you just appended the derivative at the end of the list. You may want to choose something else. Instead of the last code line I gave you, you may choose to select the derivative and use &quot;Graph.Selected.Eval(1)&quot;. Do it as you like.</p><p>As for the Access Violation Error, I leave the issue to Ivan.</p>]]></description>
			<author><![CDATA[null@example.com (GraphUser3546)]]></author>
			<pubDate>Fri, 15 Feb 2013 17:44:25 +0000</pubDate>
			<guid>https://forum.padowan.dk/viewtopic.php?pid=2181#p2181</guid>
		</item>
		<item>
			<title><![CDATA[Python scripting question]]></title>
			<link>https://forum.padowan.dk/viewtopic.php?pid=2180#p2180</link>
			<description><![CDATA[<p>Hi there. Thank you for this software, I use it regularly as a maths tutor. I have started playing with scripting but I keep getting an error. I am running Python 3.2.3 and Graph 4.4.2.</p><p>From the console (F11):<br /></p><div class="codebox"><pre><code>&gt;&gt;&gt; Graph.Selected
TStdFunc(&quot;f(x)=x^3+4x^2+x+3&quot;)
&gt;&gt;&gt; Graph.Selected.Eval(1)
(1.0, 9.0)
&gt;&gt;&gt; Graph.Selected.MakeDifFunc()
TStdFunc(&quot;f(x)=3*x^2+8x+1&quot;)
&gt;&gt;&gt; dydx = Graph.Selected.MakeDifFunc()
&gt;&gt;&gt; dydx.Eval(1)</code></pre></div><p>This results in an error box displaying the message:<br /></p><div class="quotebox"><blockquote><p>Access violation at address 00520E79 in module &#039;Graph.exe&#039;. Read of address 00000008.</p></blockquote></div><p>If I try to do the same thing from a script, I get an error box stating:<br /></p><div class="quotebox"><blockquote><p>Invalid pointer operation.</p></blockquote></div><p>Does anyone know if this is something that I am doing wrong, or a bug? I&#039;m new to Python so I may be doing something stupid!</p><p>Thanks.</p>]]></description>
			<author><![CDATA[null@example.com (scottmarley85)]]></author>
			<pubDate>Fri, 15 Feb 2013 13:48:51 +0000</pubDate>
			<guid>https://forum.padowan.dk/viewtopic.php?pid=2180#p2180</guid>
		</item>
	</channel>
</rss>
