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