Python

Did you copy the the pyglet folder – i.e. the folder under pyglet-1.1.4 – into C:\lianja\scriptinglanguages\python\Lib\site-packages\?


From Python, you can use:
Lianja.execute(‘Lianja.showdocument(“page:name_of_ page”)’)
to select a particular Page. Lianja.activePage returns an object reference for the currently active Page. If you get the chance, can you submit a ticket with an App that displays the ‘white flash’ – I haven’t seen that.


Q:
I have some VFP global variables declared in App Init() event. What would be the best way to access those in a python event delegate?
A:
For example I have an App, myapp, with the myapp_init.prg (App init()):

Code:
public m_var = "Hello World"

Then a Python Custom Section:

Code:
import Lianja

print "<html>"
print "<head>"
print "</head>"
print "<body>"
m_pub = Lianja.evaluate("m_var")
print m_pub
# Or, if all I want to do is print the value
# print Lianja.evaluate("m_var")
print "</body>"
print "</html>"

With the modules installed in the Lianja Python path under C:\lianja\scriptinglanguages\python\Lib\ (default installation) you should be able to import as in your existing Python code. Check out http://www.lianja.com/community/show…Python-modules for information on Registry tweaks that may be required.
Remember that you can also use the Python tab in the Console Workspace to test out imports (and see any error messages if the modules aren’t found) before running your complete script.


It looks like you don’t yet have pywin32 installed and wmi sits on top of it. Once you have pywin32 installed, copy the dlls from C:\Lianja\scriptinglanguages\python\Lib\site-packages\pywin32_system32 into your Windows System folder and you should be up and running.


Q:
for num in range(5):
Lianja.writeLog(num)
A.
Lianja.writeLog() takes a string.



Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s