<br><font size=2 face="sans-serif">I am sorry, instead of &quot;file&quot;,
I should have said &quot;a python function&quot;. </font>
<br>
<br><font size=2 face="sans-serif">Is it possible to access/use a python
function from Excel VB Editor e.g. a library function called &quot;eval()&quot;
is used to detect whether the expression/datatype is a valid python expression/datatype
? &nbsp;Can we do that?</font>
<br>
<br><font size=2 face="sans-serif">Thanks and Regards.</font>
<br><font size=2 face="sans-serif"><br>
Pallavi Ajabrao Apotikar<br>
Tata Consultancy Services<br>
Mailto: pallavi.apotikar@tcs.com<br>
Website: http://www.tcs.com<br>
____________________________________________<br>
Experience certainty. &nbsp; &nbsp; &nbsp; &nbsp;IT Services<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;Business Solutions<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;Outsourcing<br>
____________________________________________</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Larry Bates &lt;larry.bates@websafe.com&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: python-win32-bounces@python.org</font>
<p><font size=1 face="sans-serif">02/02/2008 01:50 AM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">python-win32@python.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [python-win32] Reading .py or .pyc
from an excel sheet</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>Pallavi Apotikar wrote:<br>
&gt; <br>
&gt; Actually, I have an excel sheet, where I am entering the data.<br>
&gt; <br>
&gt; I am reading the entered data in python.<br>
&gt; <br>
&gt; excel takes data as a string.<br>
&gt; <br>
&gt; before passing it to python, i wanted to check whether the entered
<br>
&gt; data(value) is a valid python data type.<br>
&gt; <br>
&gt; so instead of checking this in python script(/ say program), I wanted
to <br>
&gt; put macro in excel , so that all the values are checked at a stretch
(or <br>
&gt; say while entering - before passing it to the python program.)<br>
&gt; <br>
&gt; So is it possible ?<br>
&gt; <br>
&gt; Pallavi Ajabrao Apotikar<br>
&gt; Tata Consultancy Services<br>
&gt; Mailto: pallavi.apotikar@tcs.com<br>
&gt; Website: http://www.tcs.com<br>
&gt; ____________________________________________<br>
&gt; Experience certainty. &nbsp; &nbsp; &nbsp; &nbsp;IT Services<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;Business Solutions<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;Outsourcing<br>
&gt; ____________________________________________<br>
&gt; <br>
&gt; <br>
&gt; *&quot;Graeme Glass&quot; &lt;graemeglass@gmail.com&gt;*<br>
&gt; <br>
&gt; 01/31/2008 03:31 PM<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; To<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Pallavi
Apotikar&quot; &lt;pallavi.apotikar@tcs.com&gt;<br>
&gt; cc<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;python-win32@python.org<br>
&gt; Subject<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Re:
[python-win32] Reading .py or .pyc from an excel sheet<br>
&gt; <br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; On Jan 31, 2008 11:43 AM, Pallavi Apotikar &lt;_pallavi.apotikar@tcs.com_
<br>
&gt; &lt;mailto:pallavi.apotikar@tcs.com&gt;&gt; wrote:<br>
&gt; <br>
&gt; Hello Sir/Madam,<br>
&gt; <br>
&gt; I would like to know, is it possible to read a python file from an
excel <br>
&gt; sheet ?<br>
&gt; <br>
&gt; Thanks and Regards<br>
&gt; <br>
&gt; Pallavi Ajabrao Apotikar<br>
&gt; <br>
&gt; <br>
&gt; I don't fully understand what you are asking,<br>
&gt; <br>
&gt; But...<br>
&gt; <br>
&gt; If you where however asking, if it is possible to display the contents
<br>
&gt; of a python script in an excel sheet, yes it's possible (it's just
<br>
&gt; text), why you would want to? a .pyc file would be pretty meaningless
to <br>
&gt; you as it is a 'compiled' python script, and is 'bytecode'.<br>
&gt; <br>
&gt; If you where asking if you could control excel via a python script,
<br>
&gt; which I think is the most plausible, the answer is a resounding yes!<br>
&gt; <br>
&gt; There are countless examples on this mailing list of such tasks.<br>
&gt; <br>
&gt; Google for 'python +excel', will bring up loads of examples.<br>
&gt; <br>
&gt; (_http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html_)<br>
&gt; <br>
&gt; import win32com.client<br>
&gt; xl = win32com.client.Dispatch(&quot;Excel.Application&quot;)<br>
&gt; xl.Visible = 1<br>
&gt; <br>
&gt; I hope one of these answers will help with what you where asking.<br>
&gt; <br>
&gt; G<br>
&gt; ForwardSourceID:NT00006176 &nbsp; &nbsp;<br>
&gt; <br>
&gt; =====-----=====-----=====<br>
&gt; Notice: The information contained in this e-mail<br>
&gt; message and/or attachments to it may contain <br>
&gt; confidential or privileged information. If you are <br>
&gt; not the intended recipient, any dissemination, use, <br>
&gt; review, distribution, printing or copying of the <br>
&gt; information contained in this e-mail message <br>
&gt; and/or attachments to it are strictly prohibited. If <br>
&gt; you have received this communication in error, <br>
&gt; please notify us by reply e-mail or telephone and <br>
&gt; immediately and permanently delete the message <br>
&gt; and any attachments. Thank you<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; ------------------------------------------------------------------------<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; python-win32 mailing list<br>
&gt; python-win32@python.org<br>
&gt; http://mail.python.org/mailman/listinfo/python-win32<br>
<br>
Is sound line you should write the entire data entry program in wxWindows
using <br>
the wxGrid (which looks like Excel to the end user). &nbsp;Then you can
control the <br>
data that goes into each cell with your Python program.<br>
<br>
-Larry<br>
<br>
_______________________________________________<br>
python-win32 mailing list<br>
python-win32@python.org<br>
http://mail.python.org/mailman/listinfo/python-win32<br>
</tt></font>
<br><font size=1 color=white face="sans-serif">ForwardSourceID:NT000063AA
&nbsp; &nbsp;</font>
<br><pre>=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


</pre>