Ask Your Question

pysb's profile - activity

2018-01-20 14:02:20 +0100 received badge  Nice Answer (source)
2018-01-20 12:06:40 +0100 received badge  Notable Question (source)
2018-01-19 23:50:22 +0100 received badge  Student (source)
2018-01-19 21:04:41 +0100 received badge  Popular Question (source)
2018-01-19 16:11:23 +0100 asked a question Is there a way to remove "total" from libreoffice

Is there a way to remove "total" from libreoffice I´m trying to set an alternating color row on libre office. I´m able t

2017-08-12 20:10:35 +0100 received badge  Teacher (source)
2017-08-12 20:10:35 +0100 received badge  Necromancer (source)
2017-08-12 06:46:57 +0100 answered a question Detailed tutorial regarding LibreOffice to Python macro writing, especially for Calc

I made two libreoffice macros on python to rename and delete files. I hope It helps. Here is the link: https://github.co

2016-04-29 05:46:51 +0100 received badge  Famous Question (source)
2016-02-11 01:41:21 +0100 received badge  Notable Question (source)
2015-12-13 03:16:59 +0100 received badge  Popular Question (source)
2015-12-10 12:04:49 +0100 asked a question Macro python without ssl?

Reference: LibreOffice Versão: 5.0.3.2

Hello guys!

I´m trying to make a python macro with urllib module to access a https:// website, but it seems SSL was not implemented.

I also tried with requests, and had the same problem. If I use a http:// page, it works, but the same can´t be said when it´s a https:// page.

Here´s my pseucode:

----------[some Codeformatting by karolus]

import uno
from com.sun.star.awt.PosSize import POSSIZE
import urllib.request
import urllib.parse
from urllib.request import urlopen
import os
from os.path import isdir,expanduser
import pickle
import sys
import http.cookiejar
import ssl
import sys
def access_webpage():
    with urllib.request.urlopen('https://www.google.com.br') as f:
        print(f.read(300))

g_exportedScripts = access_webpage()

the error:

com.sun.star.uno.RuntimeExceptionError during invoking function consulta_CPF in module file:///C:/Program%20Files%20(x86)/LibreOffice%205/share/Scripts/python/CPF.py (<class 'urllib.error.URLError'>: <urlopen error unknown url type: https>
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:1316 in function unknown_open() [raise URLError('unknown url type: %s' % type)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:447 in function _call_chain() [result = func(*args)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:492 in function _open() ['unknown_open', req)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:469 in function open() [response = self._open(req, data)]
C:\Program Files (x86)\LibreOffice 5\program\python-core-3.3.3\lib\urllib\request.py:156 in function urlopen() [return opener.open(url, data, timeout)]
C:\Program Files (x86)\LibreOffice 5\share\Scripts\python\CPF.py:99 in function consulta_CPF() [with urllib.request.urlopen('https://www.google.com.br') as f:]
C:\Program Files (x86)\LibreOffice 5\program\pythonscript.py:869 in function invoke() [ret = self.func( *args )]