Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based) --- workaround

2019-02-12 Thread ANTONIO CARLOS PAES NASCIMENTO
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

ANTONIO CARLOS PAES NASCIMENTO confirmed that the question is solved:
Thanks RaiMan, that solved my question.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based) --- workaround

2019-02-12 Thread RaiMan
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

Summary changed to:
How to import cx_Oracle library into python SikuliX script --- not possible 
(C-based) --- workaround

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based) --- workaround

2019-02-12 Thread RaiMan
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

Description changed to:
*** workarounds

see comment #3 following


Hi guys,

I'm trying to import cx_Oracle library into my python test script inside
sikulix, however I'm getting this error:

[error] script [ connect_and_print ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\Users\BRX 
Retail\Desktop\Testes_automatic\connect_and_print.sikuli\connect_and_print.py", 
line 3, in  import cx_Oracle ImportError: No module named cx_Oracle 

My imports are:

import random
import org.sikuli.script.SikulixForJython
import cx_Oracle

Can you guys help me?

Thanks,

Antonio

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-12 Thread ANTONIO CARLOS PAES NASCIMENTO
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

Status: Answered => Solved

ANTONIO CARLOS PAES NASCIMENTO confirmed that the question is solved:
Good one hahah

Now it works, thanks RaiMan (:

I'll close this question!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-12 Thread RaiMan
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

RaiMan proposed the following answer:
Add an extension?

.exe?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-12 Thread ANTONIO CARLOS PAES NASCIMENTO
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

ANTONIO CARLOS PAES NASCIMENTO posted a new comment:
Nice!

It works, but now we've permission problems:

[error] RunTimeIDE: fatal error: java.io.IOException: Cannot run program 
"C:\Users\BRX Retail\AppData\Local\Programs\Python\Python38-32": CreateProcess 
error=5, Acesso negado
 
*error* 
java.io.IOException: Cannot run program "C:\Users\BRX 
Retail\AppData\Local\Programs\Python\Python38-32": CreateProcess error=5, 
Acesso negado*error* 

The strage is all this folders are with full permissions.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-12 Thread RaiMan
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

RaiMan proposed the following answer:
python = r"C:\Users\BRX
Retail\AppData\Local\Programs\Python\Python38-32\"

... a raw string can not end with a \

try:
python = r"C:\Users\BRX Retail\AppData\Local\Programs\Python\Python38-32"

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-12 Thread ANTONIO CARLOS PAES NASCIMENTO
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

ANTONIO CARLOS PAES NASCIMENTO posted a new comment:
Thanks man,

I found this question
https://answers.launchpad.net/sikuli/+question/286612 and I think this
solve my problem, however when I run rour example I got this errors in
the message area from sikulix IDE:

[error] Error caused by: Traceback (most recent call last): File "C:\Users\BRX 
Retail\Desktop\Testes_automatic\test)open_app.sikuli\test)open_app.py", line 4, 
in  result = run(cmd) File "C:\Users\BRX 
Retail\AppData\Roaming\Sikulix\Lib\sikuli\Sikuli.py", line 555, in run return 
Sikulix.run(cmd) at java.util.Formatter.checkText(Unknown Source)
at java.util.Formatter.parse(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.util.Formatter.format(Unknown Source)
at java.lang.String.format(Unknown Source)
at org.sikuli.basics.Debug.log(Debug.java:726)
at org.sikuli.basics.Debug.logx(Debug.java:691)
at org.sikuli.script.RunTime.log(RunTime.java:97)
at org.sikuli.script.RunTime.runcmd(RunTime.java:2952)
at org.sikuli.script.Sikulix.run(Sikulix.java:550)
at org.sikuli.script.Sikulix.run(Sikulix.java:546)
at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)
at sun.reflect.D

elegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.util.UnknownFormatConversionException: 
java.util.UnknownFormatConversionException: Conversion = '1' 

This is my script:

python = r"C:\Users\BRX Retail\AppData\Local\Programs\Python\Python38-32\"
pyscript = r"C:\Users\BRX Retail\Desktop\teste.py"
cmd = "%s %s" % (python, pyscript)
result = run(cmd)
print(result)


#teste.py

import cx_Oracle

# Connect as user "hr" with password "welcome" to the "oraclepdb" service 
running on this computer.
con = cx_Oracle.connect('user/passwd@host')

#cursor = con.cursor()
#cursor.execute("""
#SELECT *
#FROM table
#""")

#res = cursor.fetchmany(numRows=10)

print("BLABLA")

You already see this?

Thanks

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-11 Thread RaiMan
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

RaiMan proposed the following answer:
cx_Oracle only works with Python (C-based Python), but from there you
cannot use SikuliX directly, but only with some Python-Java wrapping
(like pyjnius).

So if you need direct access to your DB during scriptrun, then it will
be a stony way - may be impossible.

If acceptable: write what you need from your DB to a CSV-file and use
that in your script.

Surely there might be other workarounds, like running Python scripts
from SikuliX using subprocess, that return some stuff to be used in the
script.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-11 Thread ANTONIO CARLOS PAES NASCIMENTO
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

ANTONIO CARLOS PAES NASCIMENTO posted a new comment:
Hi RaiMan,

First off all thanks for answering.

And if I use another dev tool like Sublime and try to import sikulix
inside that tool, or something in this line?

Thanks.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-11 Thread RaiMan
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

Status: Open => Answered

RaiMan proposed the following answer:
Supposing the module cx_Oracle is in a place, where it can be found by
SikuliX (containing folder is in sys.path).

Sorry, but since SikuliX is Java based using the Jython interpreter,
only Python modules written in plain Python language can be imported.

cx_Oracle seems to depend on native libraries, which means it contains
C-based code, which leads to the ImportError: No module named cx_Oracle

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script --- not possible (C-based)

2019-02-11 Thread RaiMan
Question #678478 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/678478

Summary changed to:
How to import cx_Oracle library into python SikuliX script --- not possible 
(C-based)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #678478]: How to import cx_Oracle library into python SikuliX script

2019-02-11 Thread ANTONIO CARLOS PAES NASCIMENTO
New question #678478 on Sikuli:
https://answers.launchpad.net/sikuli/+question/678478

Hi guys,

I'm trying to import cx_Oracle library into my python test script inside 
sikulix, however I'm getting this error:

[error] script [ connect_and_print ] stopped with error at line --unknown--
[error] Error caused by: Traceback (most recent call last): File "C:\Users\BRX 
Retail\Desktop\Testes_automatic\connect_and_print.sikuli\connect_and_print.py", 
line 3, in  import cx_Oracle ImportError: No module named cx_Oracle 

My imports are:

import random
import org.sikuli.script.SikulixForJython
import cx_Oracle

Can you guys help me?

Thanks,

Antonio

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp