<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/excelpython/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 17 Jul 2014 09:41:34 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/excelpython/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v11
+++ v12
@@ -1 +1 @@
-For up-to-date documentation please visit the ExcelPython GitHub site - https://github.com/ericremoreynolds/excelpython/wiki
+For up-to-date documentation please visit the ExcelPython GitHub site - https://github.com/ericremoreynolds/excelpython
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Thu, 17 Jul 2014 09:41:34 -0000</pubDate><guid>https://sourceforge.net3f4389ca0e69a5280a74d4b20d7d3ef5145d905e</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v10
+++ v11
@@ -1 +1 @@
-For up-to-date documentation please visit the ExcelPython GitHub site - https://github.com/ericremoreynolds/excelpython
+For up-to-date documentation please visit the ExcelPython GitHub site - https://github.com/ericremoreynolds/excelpython/wiki
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Mon, 16 Jun 2014 07:42:29 -0000</pubDate><guid>https://sourceforge.net3fd3e89208eadf374591bf6c7bd708ba544fa49c</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v9
+++ v10
@@ -1,17 +1 @@
-Getting started
-===
-
-
-Installation
----
-
-ExcelPython is now packaged up in an installer which registers the relevant type libraries.
-
-
-Tutorials
----
-
-* [A very simple usage example]
-* [A more practical use of ExcelPython]
-* [Putting it all together]
-* [Lists and SAFEARRAYs]
+For up-to-date documentation please visit the ExcelPython GitHub site - https://github.com/ericremoreynolds/excelpython
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Mon, 09 Jun 2014 08:09:11 -0000</pubDate><guid>https://sourceforge.net57c6c7fdadc8d7f8b69adc4832e88ac18109c3c9</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v8
+++ v9
@@ -8,109 +8,10 @@
 ExcelPython is now packaged up in an installer which registers the relevant type libraries.

-A very simple usage example
+Tutorials
 ---

-First of all add a reference to the ExcelPython type library. To do this, open Excel, go to the VBA window (Alt-F11) and select Tools &gt; References. Scroll down and select ExcelPythonXX where XX is 26 or 27 depending on which version of Python you have installed on your machine (note only Python 2.6 and 2.7 are supported currently). Click OK to get back to VBA.
-
-You can try out ExcelPython from the VBA Immediate Window (Ctrl + G if it's not already visible in the VBA window).
-
-Type the following
-
-    ?PyStr(PyEval("1+2"))
-
-and press return. You should see 
-
-    ?PyStr(PyEval("1+2"))
-    3
-
-You can try evaluating any Python expression, and you'll get the result
-printed in the Immediate Window.
-
-    ?PyStr(PyEval("[1,2,3]+[4,5,6]"))
-    [1, 2, 3, 4, 5, 6]
-
-(As a side note: why is the PyStr function needed? If you try just calling
-
-    ?PyEval("1+2")
-
-you'll get a type mismatch error. This is because the PyEval function
-returns a handle to the Python object itself, and VBA doesn't know how
-to print it to the Immediate Window. PyStr takes a Python object and
-calls the Python str function on it and returns a VBA string, which can
-be printed)
-
-The PyEval function takes as an optional second argument a locals dictionary to be used when evaluating the expression. To build the dictionary, you can use the function PyDict which takes alternating keys and values as arguments.
-
-    ?PyStr(PyEval("x+y", PyDict("x", 3, "y", 4)))
-    7
-    ?PyStr(PyEval("x+y", PyDict("x", "abc", "y", "def")))
-    abcdef
-
-
-A more practical use of ExcelPython
----
-
-The above example gives a light introduction to manipulating a few simple objects through VBA. In practice though, what's needed is a way to get a load of inputs from Excel, pass them to a method defined in a Python script somewhere, get the outputs back from Python and use them VBA or place them in the spreadsheet as required.
-
-The key to doing this are the methods PyModule and PyCall.
-
-PyModule returns a pointer to a Python module, much like the import statement. If no additional arguments are specified, the embedded Python interpreter will look for the requested module in the default search path.
-
-    ?PyStr(PyModule("datetime"))
-    
-
-If you want to call functions from a script which you have placed in a non-standard location, you can tell ExcelPython to add additional search directories before trying to load the module, as follows:
-
-    ?PyStr(PyModule("MyScript", AddPath:="D:\\Scripts"))
-    
-
-Once you have access to the module you want, you can use PyCall to invoke functions contained in the module (note that PyCall actually calls any method of any object, not just module objects). This is done by explicitly passing the ordered and keyword arguments. For example calling
-
-    ?PyStr(PyCall(PyModule("datetime"), "date", Args:=PyTuple(2013, 8, 9)))
-    2013-08-09
-
-is equivalent to calling `datetime.date(2013, 8, 9)`, whereas
-
-    ?PyStr(PyCall(PyModule("datetime"), _
-        "timedelta", Args:=PyTuple(3), KwArgs:=PyDict("milliseconds", 500)))
-    3 days, 0:00:00.500000
-
-is like calling `datetime.timedelta(3, milliseconds=500)`.
-
-Putting it all together
----
-
-Let's suppose we have the following script MyScript.py saved in the same folder as the workbook.
-
-    :::python
-    def MyFunction(x, y):
-      return {
-        "sum": x + y,
-        "sorted": sorted([x, y])
-      }
-
-The following VBA code can be used to call this function, taking the input parameters from a worksheet and pasting the outputs back to that sheet.
-
-    Function PyPath()
-        PyPath = ThisWorkbook.Path
-    End Function
-    
-    Sub CallPythonCode()
-        Set res = PyCall( _
-            PyModule("MyScript", AddPath:=PyPath), "MyFunction", _
-            KwArgs:=PyDict( _
-                "x", Sheet1.Range("A1").Value2, _
-                "y", Sheet1.Range("A2").Value2))
-        Sheet1.Range("A3").Value2 = PyVar(PyGetItem(res, "sum"))
-        Sheet1.Range("A4:B4").Value2 = PyVar(PyGetItem(res, "sorted"))
-    End Sub
-
-The function `PyPath` is a utility function which returns our additional module search path. It's set up so that to access Python scripts we just need to place them in the same folder as the workbook. It's worth defining this once in your workbook's VBA project for use wherever necessary.
-
-The calls to `PyModule` and `PyCall` have been explained above. Once the result dictionary is obtained from the function, its elements can be accessed using `PyGetItem`.
-
-Finally, we use `PyVar` to convert the Python objects into variants so that they can be pasted into worksheet ranges.
-
-
-    
+* [A very simple usage example]
+* [A more practical use of ExcelPython]
+* [Putting it all together]
+* [Lists and SAFEARRAYs]
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Wed, 15 Jan 2014 10:17:18 -0000</pubDate><guid>https://sourceforge.net12217f90f041b6bb11803600d0025361f3c80aae</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -106,9 +106,7 @@
         Sheet1.Range("A4:B4").Value2 = PyVar(PyGetItem(res, "sorted"))
     End Sub

-Let's go through this step-by-step.
-
-The function `PyPath` is a utility function which returns our additional module search path. It's set up so that to access Python scripts we just need to place them in the same folder as the workbook.
+The function `PyPath` is a utility function which returns our additional module search path. It's set up so that to access Python scripts we just need to place them in the same folder as the workbook. It's worth defining this once in your workbook's VBA project for use wherever necessary.

 The calls to `PyModule` and `PyCall` have been explained above. Once the result dictionary is obtained from the function, its elements can be accessed using `PyGetItem`.

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Fri, 09 Aug 2013 14:16:13 -0000</pubDate><guid>https://sourceforge.net7750eb36dc8332b126d038849af6f93946d18999</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -17,22 +17,22 @@

 Type the following

-&gt; ?PyStr(PyEval("1+2"))
+    ?PyStr(PyEval("1+2"))

 and press return. You should see 

-&gt; ?PyStr(PyEval("1+2"))
-&gt; 3
+    ?PyStr(PyEval("1+2"))
+    3

 You can try evaluating any Python expression, and you'll get the result
 printed in the Immediate Window.

-&gt; ?PyStr(PyEval("\[1,2,3\]+\[4,5,6\]"))
-&gt; \[1, 2, 3, 4, 5, 6\]
+    ?PyStr(PyEval("[1,2,3]+[4,5,6]"))
+    [1, 2, 3, 4, 5, 6]

 (As a side note: why is the PyStr function needed? If you try just calling

-&gt; ?PyEval("1+2")
+    ?PyEval("1+2")

 you'll get a type mismatch error. This is because the PyEval function
 returns a handle to the Python object itself, and VBA doesn't know how
@@ -42,10 +42,10 @@

 The PyEval function takes as an optional second argument a locals dictionary to be used when evaluating the expression. To build the dictionary, you can use the function PyDict which takes alternating keys and values as arguments.

-&gt; ?PyStr(PyEval("x+y", PyDict("x", 3, "y", 4)))
-&gt; 7
-&gt; ?PyStr(PyEval("x+y", PyDict("x", "abc", "y", "def")))
-&gt; abcdef
+    ?PyStr(PyEval("x+y", PyDict("x", 3, "y", 4)))
+    7
+    ?PyStr(PyEval("x+y", PyDict("x", "abc", "y", "def")))
+    abcdef

 A more practical use of ExcelPython
@@ -57,22 +57,62 @@

 PyModule returns a pointer to a Python module, much like the import statement. If no additional arguments are specified, the embedded Python interpreter will look for the requested module in the default search path.

-&gt; ?PyStr(PyModule("datetime"))
-&gt; 
+    ?PyStr(PyModule("datetime"))
+    

 If you want to call functions from a script which you have placed in a non-standard location, you can tell ExcelPython to add additional search directories before trying to load the module, as follows:

-&gt; ?PyStr(PyModule("MyScript", AddPath:="D:\\Scripts"))
-&gt; 
+    ?PyStr(PyModule("MyScript", AddPath:="D:\\Scripts"))
+    

 Once you have access to the module you want, you can use PyCall to invoke functions contained in the module (note that PyCall actually calls any method of any object, not just module objects). This is done by explicitly passing the ordered and keyword arguments. For example calling

-&gt; ?PyStr(PyCall(PyModule("datetime"), "date", Args:=PyTuple(2013, 8, 9)))
-&gt; 2013-08-09
+    ?PyStr(PyCall(PyModule("datetime"), "date", Args:=PyTuple(2013, 8, 9)))
+    2013-08-09

-is equivalent to calling datetime.date(2013, 8, 9), whereas
+is equivalent to calling `datetime.date(2013, 8, 9)`, whereas

-&gt; ?PyStr(PyCall(PyModule("datetime"), "timedelta", Args:=PyTuple(3), KwArgs:=PyDict("milliseconds", 500)))
-&gt; 3 days, 0:00:00.500000
+    ?PyStr(PyCall(PyModule("datetime"), _
+        "timedelta", Args:=PyTuple(3), KwArgs:=PyDict("milliseconds", 500)))
+    3 days, 0:00:00.500000

-is like calling datetime.timedelta(3, milliseconds=500).
+is like calling `datetime.timedelta(3, milliseconds=500)`.
+
+Putting it all together
+---
+
+Let's suppose we have the following script MyScript.py saved in the same folder as the workbook.
+
+    :::python
+    def MyFunction(x, y):
+      return {
+        "sum": x + y,
+        "sorted": sorted([x, y])
+      }
+
+The following VBA code can be used to call this function, taking the input parameters from a worksheet and pasting the outputs back to that sheet.
+
+    Function PyPath()
+        PyPath = ThisWorkbook.Path
+    End Function
+    
+    Sub CallPythonCode()
+        Set res = PyCall( _
+            PyModule("MyScript", AddPath:=PyPath), "MyFunction", _
+            KwArgs:=PyDict( _
+                "x", Sheet1.Range("A1").Value2, _
+                "y", Sheet1.Range("A2").Value2))
+        Sheet1.Range("A3").Value2 = PyVar(PyGetItem(res, "sum"))
+        Sheet1.Range("A4:B4").Value2 = PyVar(PyGetItem(res, "sorted"))
+    End Sub
+
+Let's go through this step-by-step.
+
+The function `PyPath` is a utility function which returns our additional module search path. It's set up so that to access Python scripts we just need to place them in the same folder as the workbook.
+
+The calls to `PyModule` and `PyCall` have been explained above. Once the result dictionary is obtained from the function, its elements can be accessed using `PyGetItem`.
+
+Finally, we use `PyVar` to convert the Python objects into variants so that they can be pasted into worksheet ranges.
+
+
+    
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Fri, 09 Aug 2013 14:15:07 -0000</pubDate><guid>https://sourceforge.net735e995d0d76024434304f633ce8373c5ab5722a</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -58,12 +58,12 @@
 PyModule returns a pointer to a Python module, much like the import statement. If no additional arguments are specified, the embedded Python interpreter will look for the requested module in the default search path.

 &gt; ?PyStr(PyModule("datetime"))
-&gt; \
+&gt; 

 If you want to call functions from a script which you have placed in a non-standard location, you can tell ExcelPython to add additional search directories before trying to load the module, as follows:

 &gt; ?PyStr(PyModule("MyScript", AddPath:="D:\\Scripts"))
-&gt; \
+&gt; 

 Once you have access to the module you want, you can use PyCall to invoke functions contained in the module (note that PyCall actually calls any method of any object, not just module objects). This is done by explicitly passing the ordered and keyword arguments. For example calling

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Fri, 09 Aug 2013 13:20:52 -0000</pubDate><guid>https://sourceforge.net08a50885b33280f2d500551f762ee4b9285d314d</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -8,7 +8,7 @@
 ExcelPython is now packaged up in an installer which registers the relevant type libraries.

-Simple usage examples
+A very simple usage example
 ---

 First of all add a reference to the ExcelPython type library. To do this, open Excel, go to the VBA window (Alt-F11) and select Tools &gt; References. Scroll down and select ExcelPythonXX where XX is 26 or 27 depending on which version of Python you have installed on your machine (note only Python 2.6 and 2.7 are supported currently). Click OK to get back to VBA.
@@ -46,3 +46,33 @@
 &gt; 7
 &gt; ?PyStr(PyEval("x+y", PyDict("x", "abc", "y", "def")))
 &gt; abcdef
+
+
+A more practical use of ExcelPython
+---
+
+The above example gives a light introduction to manipulating a few simple objects through VBA. In practice though, what's needed is a way to get a load of inputs from Excel, pass them to a method defined in a Python script somewhere, get the outputs back from Python and use them VBA or place them in the spreadsheet as required.
+
+The key to doing this are the methods PyModule and PyCall.
+
+PyModule returns a pointer to a Python module, much like the import statement. If no additional arguments are specified, the embedded Python interpreter will look for the requested module in the default search path.
+
+&gt; ?PyStr(PyModule("datetime"))
+&gt; \
+
+If you want to call functions from a script which you have placed in a non-standard location, you can tell ExcelPython to add additional search directories before trying to load the module, as follows:
+
+&gt; ?PyStr(PyModule("MyScript", AddPath:="D:\\Scripts"))
+&gt; \
+
+Once you have access to the module you want, you can use PyCall to invoke functions contained in the module (note that PyCall actually calls any method of any object, not just module objects). This is done by explicitly passing the ordered and keyword arguments. For example calling
+
+&gt; ?PyStr(PyCall(PyModule("datetime"), "date", Args:=PyTuple(2013, 8, 9)))
+&gt; 2013-08-09
+
+is equivalent to calling datetime.date(2013, 8, 9), whereas
+
+&gt; ?PyStr(PyCall(PyModule("datetime"), "timedelta", Args:=PyTuple(3), KwArgs:=PyDict("milliseconds", 500)))
+&gt; 3 days, 0:00:00.500000
+
+is like calling datetime.timedelta(3, milliseconds=500).
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Fri, 09 Aug 2013 13:19:12 -0000</pubDate><guid>https://sourceforge.net3be5b5200dd9332860a2232f54e6357d24fed7a7</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -27,8 +27,8 @@
 You can try evaluating any Python expression, and you'll get the result
 printed in the Immediate Window.

-&gt; ?PyStr(PyEval("[1,2,3]+[4,5,6]"))
-&gt; [1, 2, 3, 4, 5, 6]
+&gt; ?PyStr(PyEval("\[1,2,3\]+\[4,5,6\]"))
+&gt; \[1, 2, 3, 4, 5, 6\]

 (As a side note: why is the PyStr function needed? If you try just calling

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Fri, 09 Aug 2013 11:14:55 -0000</pubDate><guid>https://sourceforge.net4e343f4b29cbfb997d15efe0131cfe63dd9cf232</guid></item><item><title>Home modified by Eric Reynolds</title><link>https://sourceforge.net/p/excelpython/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -0,0 +1,48 @@
+Getting started
+===
+
+
+Installation
+---
+
+ExcelPython is now packaged up in an installer which registers the relevant type libraries.
+
+
+Simple usage examples
+---
+
+First of all add a reference to the ExcelPython type library. To do this, open Excel, go to the VBA window (Alt-F11) and select Tools &gt; References. Scroll down and select ExcelPythonXX where XX is 26 or 27 depending on which version of Python you have installed on your machine (note only Python 2.6 and 2.7 are supported currently). Click OK to get back to VBA.
+
+You can try out ExcelPython from the VBA Immediate Window (Ctrl + G if it's not already visible in the VBA window).
+
+Type the following
+
+&gt; ?PyStr(PyEval("1+2"))
+
+and press return. You should see 
+
+&gt; ?PyStr(PyEval("1+2"))
+&gt; 3
+
+You can try evaluating any Python expression, and you'll get the result
+printed in the Immediate Window.
+
+&gt; ?PyStr(PyEval("[1,2,3]+[4,5,6]"))
+&gt; [1, 2, 3, 4, 5, 6]
+
+(As a side note: why is the PyStr function needed? If you try just calling
+
+&gt; ?PyEval("1+2")
+
+you'll get a type mismatch error. This is because the PyEval function
+returns a handle to the Python object itself, and VBA doesn't know how
+to print it to the Immediate Window. PyStr takes a Python object and
+calls the Python str function on it and returns a VBA string, which can
+be printed)
+
+The PyEval function takes as an optional second argument a locals dictionary to be used when evaluating the expression. To build the dictionary, you can use the function PyDict which takes alternating keys and values as arguments.
+
+&gt; ?PyStr(PyEval("x+y", PyDict("x", 3, "y", 4)))
+&gt; 7
+&gt; ?PyStr(PyEval("x+y", PyDict("x", "abc", "y", "def")))
+&gt; abcdef
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Reynolds</dc:creator><pubDate>Fri, 09 Aug 2013 11:07:48 -0000</pubDate><guid>https://sourceforge.net7257a69e4db92e04a2e92105916e0e41c204dfca</guid></item></channel></rss>