<div dir="ltr">Allora, ho studiato un po' e ho capito che per chiamare quei metodi dell'ocx ho bisogno di un ActiveX container.<div style>Posso usare quello di pythonwin, quindi mi sono guardato un po' gli esempi ocx nella cartella:</div>
<div style><br></div><div style>C:\Python27\Lib\site-packages\pythonwin\pywin\Demos\ocx</div><div style><br></div><div style>e ho partorito questo mostro: <a href="http://pastebin.com/ftGFqPmR">http://pastebin.com/ftGFqPmR</a></div>
<div style>Ovviamente č solo un test, ma sono riuscito a chiamare la funzione Open:</div><div style><br></div><div style><br></div><div style><ol style="margin:0px;padding:0px 0px 0px 48px;color:rgb(172,172,172);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono',monospace,serif;font-size:12px;line-height:21px;background-color:rgb(248,248,248)">
<li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"><span class="" style="color:rgb(255,119,0);font-weight:bold">def</span> OnOK<span class="">(</span><span class="" style="color:rgb(0,128,0)">self</span><span class="">)</span>:</div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> ris <span class="" style="color:rgb(102,204,102)">=</span> <span class="" style="color:rgb(0,128,0)">self</span>.<span class="">olectl</span>.<span class="">Open</span><span class="">(</span><span class="" style="color:rgb(72,61,139)">'PORT = 1'</span><span class="">)</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> <span class="" style="color:rgb(255,119,0);font-weight:bold">print</span> <span class="" style="color:rgb(72,61,139)">'PORTA APERTA'</span><span class="" style="color:rgb(102,204,102)">,</span><span class="" style="color:rgb(72,61,139)">'RIS'</span><span class="" style="color:rgb(102,204,102)">,</span>ris</div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> <span class="" style="color:rgb(255,119,0);font-weight:bold">if</span> ris <span class="" style="color:rgb(102,204,102)">==</span> <span class="" style="color:rgb(255,69,0)">0</span>:</div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> <span class="" style="color:rgb(0,128,0)">self</span>.<span class="">olectl</span>.<span class="">Close</span><span class="">(</span><span class="">)</span></div>
</li><li class="" style><div class="" style="padding:0px 5px;vertical-align:top;color:rgb(0,0,0);border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);background-color:rgb(255,255,255)"> <span class="" style="color:rgb(255,119,0);font-weight:bold">print</span> <span class="" style="color:rgb(72,61,139)">'PORTA CHIUSA'</span><span class="" style="color:rgb(102,204,102)">,</span><span class="" style="color:rgb(0,128,0)">self</span>.<span class="">olectl</span>.<span class="">Close</span></div>
</li></ol></div><div style><br></div><div class="gmail_extra" style>ma soprattutto evito di buttarmi gių da un ponte... per questa volta ;-))</div></div>