Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Johann Spies
Νίκος,

I am glad that you solved the problem.

I am not using mysql but postgresql.  When I get a problem using python to
communicate with the database, one of my first steps will be to determine
whether the error is a python (maybe psycopg-related) related error or a
database error.  What I do then is to use the string python is sending to
the database and try to run that on the commandline interface to the
database (psgl) or something like pgadmin3.  Mysql have similar tools.

Once you have determined that it a database related problem, it should be
easy to sort it out on that side.  If it works on the database the rest of
the problem should be solved on the python side.

Maybe this approach would have saved you some time.

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)
-- 
https://mail.python.org/mailman/listinfo/python-list


EuroPython 2017: Call for Proposals is open

2017-03-27 Thread M.-A. Lemburg
We’re looking for proposals on every aspect of Python: programming
from novice to advanced levels, applications and frameworks, or how
you have been involved in introducing Python into your organization.
EuroPython is a community conference and we are eager to
hear about your experience.

Please also forward this Call for Proposals to anyone that you feel
may be interested.


 *** https://ep2017.europython.eu/en/call-for-proposals/ ***

   Submissions will be open until
  Sunday, April 16, 23:59:59 CEST


Please note that we will not have a second call for proposals as we
did in 2016, so if you want to enter a proposal, please consider to do
this in the next few days.


For full details, please see the above CFP page. We have many exciting
things waiting for you:

* PyData EuroPython 2017 as part of EuroPython

* a whole range of interesting formats, including talks, training
  sessions, panels, interactive sessions, posters and helpdesks

* tracks to focus on more specific domains, including the revived
  EuroPython Business Track

* speaker discounts for more than just talks and trainings


Enjoy,
--
EuroPython 2017 Team
http://ep2017.europython.eu/
http://www.europython-society.org/

PS: Please forward or retweet to help us reach all interested parties:
https://twitter.com/europython/status/846274948003958784
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Νίκος Βέργος
Thank you very much Johann.

i was using print(update wuery here) and i was seeing that print was able
to parser the query and that consused me as to why execute wont do the same
since with print all values was gettign substituted.

of course pymysql doesnt behave the same with print but until i fugure that
out cost me lots of time.

Στις Δευ, 27 Μαρ 2017 στις 10:52 π.μ., ο/η Johann Spies <
johann.sp...@gmail.com> έγραψε:

> Νίκος,
>
> I am glad that you solved the problem.
>
> I am not using mysql but postgresql.  When I get a problem using python to
> communicate with the database, one of my first steps will be to determine
> whether the error is a python (maybe psycopg-related) related error or a
> database error.  What I do then is to use the string python is sending to
> the database and try to run that on the commandline interface to the
> database (psgl) or something like pgadmin3.  Mysql have similar tools.
>
> Once you have determined that it a database related problem, it should be
> easy to sort it out on that side.  If it works on the database the rest of
> the problem should be solved on the python side.
>
> Maybe this approach would have saved you some time.
>
> Regards
> Johann
> --
> Because experiencing your loyal love is better than life itself,
> my lips will praise you.  (Psalm 63:3)
>
-- 
What is now proved was at first only imagined!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: C-Python and Endianness

2017-03-27 Thread Antoon Pardon
Op 26-03-17 om 08:47 schreef Ganesh Pal:
> Hello Team ,
>
>
>
>
> I want  to write the  hexadecimal string that is passed from python  as  it
> is  on disk in C  , my problem is that  the values are getting stored  in
> little endian and

Are you sure you are passing a string? Or are you passing a number and expecting
a particulare result when you hexdump the file?

> the values are  swapped it has been quite a pain for me to fix this , any
> suggestion on how to fix this (I am on Python 2.7 and Linux).

Why is this a problem? This is how things usually work on little endians
machines. If you are just reading and writing numbers in a binary way
this will work without a problem. However you may need to be carefull
when transferring the file to a bigendian machine.

So why do you perceive this swapping as a problem to be fixed?

-- 
Antoon.

-- 
https://mail.python.org/mailman/listinfo/python-list


Using/compiling pyuno with Python 3.6

2017-03-27 Thread filtered
I am running CentOS 7.1 with LibreOffice 5.0.6.2.

I have installed the official pyuno package from CentOS.

I installed Python 3.6.1 from the sources and now I am trying to import
pyuno which fails with

aj...@dev.zopyx.com:~/src/docx> bin/python
Python 3.6.1 (default, Mar 27 2017, 13:27:24)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux

aj...@dev.zopyx.com:~/src/docx> bin/python -c "import uno"
Traceback (most recent call last):
 File "", line 1, in 
 File "/home/ajung/src/docx/uno.py", line 24, in 
   import pyuno
ImportError: dynamic module does not define module export function
(PyInit_pyuno)

Is there a straight forward way for compiling pyuno myself? I could not
find any official documentation,
links to various posts are older than 5 years...

Andreas
-- 
https://mail.python.org/mailman/listinfo/python-list


Logging from different python scripts to different output files

2017-03-27 Thread James McMahon
I'm struggling with Python logging. Have tried to apply several examples I
have found in the open source literature, but can't get it to work. What I
need to do is this: I have two python scripts, a.py and b.py. Each is
called by NiFi ExecuteScript processor repeatedly against many incoming
flowfiles. In every case I need to output log messages to two distinct and
different log files. My scripts run in the same Python interpreter, which
as i understand it means they rely on the same root level logger. I have
tried establishing non-root loggers for each, and associating distinct file
handles for each to those loggers.

My output still appears in multiple log files, and appears to be repeating
in increasing numbers each time I try a test run (first test, output line
appeared in log once. second test, twice. third test, three times, etc). Is
there an example that anyone knows of that demonstrates how two
concurrently running python scripts within the same interpreter can direct
output to two distinct log files? Thanks in advance for any help.
-- 
https://mail.python.org/mailman/listinfo/python-list


Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Jan Gosmann

Hi,

I have a program which uses twice as much memory when I run it in Python 
3.6 than when I run it in Python 3.5 (about 60GB instead of 30GB). I 
tried to find the reason for that, but the cumulated size (measured with 
sys.getsizeof) of all objects returned by gc.get_objects accumulates 
only to about 17GB in both cases. The program also uses NumPy and I 
tried tracking allocations with the NumPy allocation tracker in the 
relevant part of the program, but again the number of allocations are 
almost identical and the reported maximum memory usage perfectly agrees 
(it is about 18GB).


Any ideas where this significant increase in memory consumption could 
come from? Or any ideas how to further debug this?


Looking at the changelog it seems that the only change in Python 3.6 
affecting memory usage is the new dict implementation which is supposed 
to be more memory efficient. In fact, this is what I find if I run the 
program with a smaller test cases. There the memory consumption is less 
with Python 3.6.


Cheers, Jan
--
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Peter Otten
Jan Gosmann wrote:

> Hi,
> 
> I have a program which uses twice as much memory when I run it in Python
> 3.6 than when I run it in Python 3.5 (about 60GB instead of 30GB). I
> tried to find the reason for that, but the cumulated size (measured with
> sys.getsizeof) of all objects returned by gc.get_objects accumulates
> only to about 17GB in both cases. The program also uses NumPy and I
> tried tracking allocations with the NumPy allocation tracker in the
> relevant part of the program, but again the number of allocations are
> almost identical and the reported maximum memory usage perfectly agrees
> (it is about 18GB).
> 
> Any ideas where this significant increase in memory consumption could
> come from? Or any ideas how to further debug this?
> 
> Looking at the changelog it seems that the only change in Python 3.6
> affecting memory usage is the new dict implementation which is supposed
> to be more memory efficient. In fact, this is what I find if I run the
> program with a smaller test cases. There the memory consumption is less
> with Python 3.6.

Are you perchance comparing 32-bit Python 3.5 with 64-bit Python 3.6?

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Jan Gosmann

On 27 Mar 2017, at 18:30, Peter Otten wrote:


Are you perchance comparing 32-bit Python 3.5 with 64-bit Python 3.6?


I don't think so. 
[sys.maxsize](https://docs.python.org/3/library/platform.html#cross-platform) 
indicates both to be 64-bit.

--
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Chris Angelico
On Tue, Mar 28, 2017 at 8:57 AM, Jan Gosmann  wrote:
> I have a program which uses twice as much memory when I run it in Python 3.6
> than when I run it in Python 3.5 (about 60GB instead of 30GB). I tried to
> find the reason for that, but the cumulated size (measured with
> sys.getsizeof) of all objects returned by gc.get_objects accumulates only to
> about 17GB in both cases. The program also uses NumPy and I tried tracking
> allocations with the NumPy allocation tracker in the relevant part of the
> program, but again the number of allocations are almost identical and the
> reported maximum memory usage perfectly agrees (it is about 18GB).
>
> Any ideas where this significant increase in memory consumption could come
> from? Or any ideas how to further debug this?

Are you able to share the program? I could try it on my system and see
if the same thing happens.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Jan Gosmann

On 27 Mar 2017, at 18:42, Chris Angelico wrote:


Are you able to share the program? I could try it on my system and see
if the same thing happens.


Yes, it is on GitHub (use the fixes branch): 
https://github.com/ctn-archive/gosmann-frontiers2017/tree/fixes

Installation instructions are in the readme.
The command I'm running is `python scripts/log_reduction.py spaun`

I was looking at the output of htop to see the memory consumption. The 
`time` built-in of the zsh might report a lower memory usage (I'm 
running it right now to make sure), which would also be surprising. But 
I'm certain that Python 3.6 uses more memory because the run time 
increases due to using the swap partition.


If you run the program, it will take an initial 10–15 minutes of 
processing during which the memory usage should increase to roughly 
10GB. Then the output “[INFO] Optimizing model...” will be printed 
after which the memory usage continues to increase to around 30GB (maybe 
a bit more with Python 3.6). This constitutes a first “optimization 
pass” that will be ended with the message “[INFO] Pass 1 [views]: 
Reduced 996917 to 913666 operators in 62.519006s.” Then in the second 
optimization pass the memory consumption will continue to increase with 
Python 3.6 (up to ~60GB being consumed, where less than 5GB should be 
due to other processes, though the virtual and resident memory reported 
for the Python process are only ~42GB and ~30GB respectively) and in 
later passes it will start decreasing again. With Python 3.5 the memory 
consumption stays about 30GB and decreases in later passes.


Let me know if you have more questions.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Chris Angelico
On Tue, Mar 28, 2017 at 10:01 AM, Jan Gosmann  wrote:
> Yes, it is on GitHub (use the fixes branch):
> https://github.com/ctn-archive/gosmann-frontiers2017/tree/fixes
> Installation instructions are in the readme.
> The command I'm running is python scripts/log_reduction.py spaun

Working on it.

By the way, since you're aiming this at recent Python versions, you
could skip the 'virtualenv' external dependency and use the built-in
'venv' package:

$ python3 -m venv env

I'm a little confused here. When I install PIP requirements, it wants
to set up OpenCL, but your README seems to be contrasting your
implementation with the OpenCL one. Or is that for the sake of
benchmarking, so you can compare one against the other?

In any case, I've installed nvidia-opencl-dev and it seems to be
happy. How long should I expect this to run for?

Now testing under CPython 3.7.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Chris Angelico
On Tue, Mar 28, 2017 at 11:00 AM, Chris Angelico  wrote:
> In any case, I've installed nvidia-opencl-dev and it seems to be
> happy. How long should I expect this to run for?
>
> Now testing under CPython 3.7.
>

It ran for about 14 minutes, then memory usage spiked and went into
the page file. Used roughly 8GB of RAM prior to that point, I think?
Unfortunately, I don't think my hard disk is fast enough for this to
run through the page file in any reasonable time.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Gregory Ewing

Νίκος Βέργος wrote:


Its still a mystery to em whay this fails syntactically when at the same time
INSERT works like that.


I don't think *anyone* understands why SQL was designed with
INSERT and UPDATE having completely different syntaxes.
But it was, and we have to live with it.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


RE: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Deborah Swanson
filtered wrote, on Monday, March 27, 2017 4:41 AM
> 
> I am running CentOS 7.1 with LibreOffice 5.0.6.2.
> 
> I have installed the official pyuno package from CentOS.
> 
> I installed Python 3.6.1 from the sources and now I am trying 
> to import pyuno which fails with
> 
> aj...@dev.zopyx.com:~/src/docx> bin/python
> Python 3.6.1 (default, Mar 27 2017, 13:27:24)
> [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
> 
> aj...@dev.zopyx.com:~/src/docx> bin/python -c "import uno" 
> Traceback (most recent call last):  File "", line 1, 
> in   File "/home/ajung/src/docx/uno.py", line 24, in 
>import pyuno
> ImportError: dynamic module does not define module export function
> (PyInit_pyuno)
> 
> Is there a straight forward way for compiling pyuno myself? I 
> could not find any official documentation, links to various 
> posts are older than 5 years...
> 
> Andreas

I have no idea how to compile pyuno from sources. But if I were in your
place, I'd look for other repositories that might have pyuno. It's been
awhile since I had a Linux machine (it was also CentOS) and I generally
found multiple repositories to try when the standard one failed.

-- 
https://mail.python.org/mailman/listinfo/python-list


Windows / ctypes issue with custom build

2017-03-27 Thread Eric Frederich
I built my own Python 2.7.13 for Windows because I'm using bindings to a
3rd party application which were built with Visual Studio 2012.
I started to code up some stuff using the "click" module and found an error
when using click.echo with any kind of unicode input.

Python 2.7.13 (default, Mar 27 2017, 11:11:01) [MSC v.1700 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import click
>>> click.echo('Hello World')
Hello World
>>> click.echo(u'Hello World')
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Users\eric\my_env\lib\site-packages\click\utils.py", line
259, in echo
file.write(message)
  File "C:\Users\eric\my_env\lib\site-packages\click\_winconsole.py",
line 180, in write
return self._text_stream.write(x)
  File "C:\Users\eric\my_env\lib\site-packages\click\_compat.py", line
63, in write
return io.TextIOWrapper.write(self, x)
  File "C:\Users\eric\my_env\lib\site-packages\click\_winconsole.py",
line 164, in write
raise OSError(self._get_error_message(GetLastError()))
OSError: Windows error 6

If I download and install the Python 2.7.13 64-bit installer I don't get
this issue.  It echo's just fine.
I have looked into this a lot and am at a loss right now.
I'm not too familiar with Windows, Visual Studio, or ctypes.

I spent some time looking at the code path to produce the smallest file
(without click) which demonstrates this problem (see below)
It produces the same "Windows error 6"... again, this works fine with the
python installed from the 2.7.13 64 bit MSI installer.
Can someone share the process used to create the Windows installers?  Is
this a manual process or is it automated?
Maybe I'm missing some important switch to msbuild or something.  Any help
or ideas are appreciated.
I cannot use a downloaded copy of Python... it needs to be built with a
specific version, update, patch, etc of Visual Studio.

All I did was
1) clone cpython from github and checkout 2.7.13
2) edit some xp stuff out of tk stuff to get it to compile on Windows
Server 2003
In `externals\tk-8.5.15.0\win\Makefile.in` remove
`ttkWinXPTheme.$(OBJEXT)` line
In `externals\tk-8.5.15.0\win\makefile.vc` remove
`$(TMP_DIR)\ttkWinXPTheme.obj` line
In `externals\tk-8.5.15.0\win\ttkWinMonitor.c` remove 2
`TtkXPTheme_Init` lines
In `PCbuild\tcltk.props` change VC9 to VC11 at the bottom
3) PCbuild\build.bat -e -p x64 "/p:PlatformToolset=v110"

After that I created an "install" by copying .exe, .pyd, .dll files, ran
get-pip.py, then python -m pip install virtualenv, then virtualenv my_env,
then activated it, then did a pip install click.
But with this stripped down version you don't need pip, virtualenv or
click... just ctypes.
You could probably even build it without the -e switch to build.bat.

from ctypes import byref, POINTER, py_object, pythonapi, Structure,
windll
from ctypes import c_char, c_char_p, c_int, c_ssize_t, c_ulong, c_void_p
c_ssize_p = POINTER(c_ssize_t)

kernel32 = windll.kernel32
STDOUT_HANDLE = kernel32.GetStdHandle(-11)

PyBUF_SIMPLE = 0
MAX_BYTES_WRITTEN = 32767

class Py_buffer(Structure):
_fields_ = [
('buf', c_void_p),
('obj', py_object),
('len', c_ssize_t),
('itemsize', c_ssize_t),
('readonly', c_int),
('ndim', c_int),
('format', c_char_p),
('shape', c_ssize_p),
('strides', c_ssize_p),
('suboffsets', c_ssize_p),
('internal', c_void_p)
]
_fields_.insert(-1, ('smalltable', c_ssize_t * 2))

bites = u"Hello World".encode('utf-16-le')
bytes_to_be_written = len(bites)
buf = Py_buffer()
pythonapi.PyObject_GetBuffer(py_object(bites), byref(buf), PyBUF_SIMPLE)
buffer_type = c_char * buf.len
buf = buffer_type.from_address(buf.buf)
code_units_to_be_written = min(bytes_to_be_written, MAX_BYTES_WRITTEN)
// 2
code_units_written = c_ulong()

kernel32.WriteConsoleW(STDOUT_HANDLE, buf, code_units_to_be_written,
byref(code_units_written), None)
bytes_written = 2 * code_units_written.value

if bytes_written == 0 and bytes_to_be_written > 0:
raise OSError('Windows error %s' % kernel32.GetLastError())
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Michael Torrie
On 03/27/2017 05:40 AM, filtered wrote:
> I am running CentOS 7.1 with LibreOffice 5.0.6.2.
> 
> I have installed the official pyuno package from CentOS.
> 
> I installed Python 3.6.1 from the sources and now I am trying to import
> pyuno which fails with
> 
> aj...@dev.zopyx.com:~/src/docx> bin/python
> Python 3.6.1 (default, Mar 27 2017, 13:27:24)
> [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
> 
> aj...@dev.zopyx.com:~/src/docx> bin/python -c "import uno"
> Traceback (most recent call last):
>  File "", line 1, in 
>  File "/home/ajung/src/docx/uno.py", line 24, in 
>import pyuno
> ImportError: dynamic module does not define module export function
> (PyInit_pyuno)
> 
> Is there a straight forward way for compiling pyuno myself? I could not
> find any official documentation,
> links to various posts are older than 5 years...

Pretty sure PyUno is Python 2 only.  Looks like there might be an
alternative in the form of unotools:
https://pypi.python.org/pypi/unotools

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Jim

On 03/27/2017 09:36 PM, Michael Torrie wrote:

On 03/27/2017 05:40 AM, filtered wrote:

I am running CentOS 7.1 with LibreOffice 5.0.6.2.

I have installed the official pyuno package from CentOS.

I installed Python 3.6.1 from the sources and now I am trying to import
pyuno which fails with

aj...@dev.zopyx.com:~/src/docx> bin/python
Python 3.6.1 (default, Mar 27 2017, 13:27:24)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux

aj...@dev.zopyx.com:~/src/docx> bin/python -c "import uno"
Traceback (most recent call last):
 File "", line 1, in 
 File "/home/ajung/src/docx/uno.py", line 24, in 
   import pyuno
ImportError: dynamic module does not define module export function
(PyInit_pyuno)

Is there a straight forward way for compiling pyuno myself? I could not
find any official documentation,
links to various posts are older than 5 years...


Pretty sure PyUno is Python 2 only.  Looks like there might be an
alternative in the form of unotools:
https://pypi.python.org/pypi/unotools



I don't know if this is of any help but I am running Mint 18 with Python 
3.5 and I have a package installed called python3-uno which is described 
as "Python-UNO bridge". Maybe CentOS has a similarly name package.


regards,  Jim

--
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Jan Gosmann

On 27 Mar 2017, at 20:00, Chris Angelico wrote:


By the way, since you're aiming this at recent Python versions, you
could skip the 'virtualenv' external dependency and use the built-in
'venv' package:

$ python3 -m venv env


Yeah, I know about venv. The last time I tried it, there was still some 
issue that prevented me from using it and I'm also still targeting 2.7 
too.



I'm a little confused here. When I install PIP requirements, it wants
to set up OpenCL, but your README seems to be contrasting your
implementation with the OpenCL one. Or is that for the sake of
benchmarking, so you can compare one against the other?


Right, the PIP requirements are more than actually required for this 
particular problem. But it is indeed for benchmarking comparing 
different backends for a neural network simulator.


For the log_reduction.py script the nengo==2.3.1 and numpy==1.12.0 are 
probably sufficient.



In any case, I've installed nvidia-opencl-dev and it seems to be
happy. How long should I expect this to run for?


On an Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz with 32GB RAM it 
probably takes about 30 minutes with Python 3.5; longer with 3.6 because 
things get written to the swap partition.


Jan
--
https://mail.python.org/mailman/listinfo/python-list


Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-27 Thread Jan Gosmann

On 27 Mar 2017, at 20:12, Chris Angelico wrote:

On Tue, Mar 28, 2017 at 11:00 AM, Chris Angelico  
wrote:

In any case, I've installed nvidia-opencl-dev and it seems to be
happy. How long should I expect this to run for?

Now testing under CPython 3.7.



It ran for about 14 minutes, then memory usage spiked and went into
the page file. Used roughly 8GB of RAM prior to that point, I think?
Unfortunately, I don't think my hard disk is fast enough for this to
run through the page file in any reasonable time.


Yeah, it will be problematic with less than 32GB.

My latest findings: The zsh `time` built-in reports a maximum of only 
30GB used which seems to correspond to the resident memory size, while 
the virtual memory size exceeds 40GB for the process and the total 
memory allocated over all processes exceeds 60GB (with the main 
contribution from the process that supposedly only uses ~40GB).


My best idea about what's going on at the moment is that memory 
fragmentation is worse in Python 3.6 for some reason. The virtual memory 
size indicates that a large address space is acquired, but the resident 
memory size is smaller indicating that not all of that address space is 
actually used. In fact, the code might be especially bad to 
fragmentation because it takes a lot of small NumPy arrays and 
concatenates them into larger arrays. But I'm still surprised that this 
is only a problem with Python 3.6 (if this hypothesis is correct).


Jan
--
https://mail.python.org/mailman/listinfo/python-list


Re: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Michael Torrie
On 03/27/2017 09:13 PM, Jim wrote:
> I don't know if this is of any help but I am running Mint 18 with Python 
> 3.5 and I have a package installed called python3-uno which is described 
> as "Python-UNO bridge". Maybe CentOS has a similarly name package.

You're right. In fact it looks like LibreOffice 5.3 at least ships with
Python 3.5 as part of the package, and comes with pyuno as part of that.
Try running the python binary from the LibreOffice install directory (on
my machine that is
/opt/libreoffice5.3/program/python).  I'm not sure how to work with
pyuno outside of the LO-shipped python.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using/compiling pyuno with Python 3.6

2017-03-27 Thread filtered
Sorry but all your answers are pointless.

I clearly asked about compiling PyUno MYSELF with a self-compiled
Python 3.6.1 installation. Is this so hard to understand? Why do you give
unrelated comments to a clear questions? Sometimes it is better to be quiet.

-aj

2017-03-28 5:49 GMT+02:00 Michael Torrie :

> On 03/27/2017 09:13 PM, Jim wrote:
> > I don't know if this is of any help but I am running Mint 18 with Python
> > 3.5 and I have a package installed called python3-uno which is described
> > as "Python-UNO bridge". Maybe CentOS has a similarly name package.
>
> You're right. In fact it looks like LibreOffice 5.3 at least ships with
> Python 3.5 as part of the package, and comes with pyuno as part of that.
> Try running the python binary from the LibreOffice install directory (on
> my machine that is
> /opt/libreoffice5.3/program/python).  I'm not sure how to work with
> pyuno outside of the LO-shipped python.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Michael Torrie
On 03/27/2017 10:09 PM, filtered wrote:
> Sorry but all your answers are pointless.

Possibly.

> I clearly asked about compiling PyUno MYSELF with a self-compiled
> Python 3.6.1 installation. Is this so hard to understand? Why do you give
> unrelated comments to a clear questions? 

Sometimes clear questions don't have easy answers.  Or rather there's a
process of problem solving and Jim and I were exploring that process a
bit.  But I don't think any of us will go further with it now.  I did
find the source code for pyuno in the main LO tree, but it doesn't look
easy to build out of tree, but that's just at first glance.

I suspect you'll find better information on one of the LO mailing lists
or forums, provided you don't react to them as you have to this list!

> Sometimes it is better to be quiet.

Indeed.

Good luck.

ciao
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Michael Torrie
On 03/27/2017 10:09 PM, filtered wrote:
> Sorry but all your answers are pointless.

Possibly.

> I clearly asked about compiling PyUno MYSELF with a self-compiled
> Python 3.6.1 installation. Is this so hard to understand? Why do you give
> unrelated comments to a clear questions? 

Sometimes clear questions don't have easy answers.  Or rather there's a
process of problem solving and Jim and I were exploring that process a
bit.  But I don't think any of us will go further with it now.  I did
find the source code for pyuno in the main LO tree, but it doesn't look
easy to build out of tree, but that's just at first glance.

I suspect you'll find better information on one of the LO mailing lists
or forums, provided you don't react to them as you have to this list!

> Sometimes it is better to be quiet.

Indeed.

Good luck.

ciao
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Deborah Swanson
filtered wrote, on March 27, 2017 9:09 PM
> 
> Sorry but all your answers are pointless.
> 
> I clearly asked about compiling PyUno MYSELF with a 
> self-compiled Python 3.6.1 installation. Is this so hard to 
> understand? Why do you give unrelated comments to a clear 
> questions? Sometimes it is better to be quiet.
> 
> -aj

If you really only wanted to know how to compile PyUno with a
self-compiled Python 3.6.1 installation, it muddied the waters
considerably that you first went on at length about your difficulties
importing PyUno. It appeared that your main objective was to have an
importable installation of PyUno, and it would have been better to omit
the error details if all you wanted to know is how to compile it. Maybe
not as clear a question as you imagine.


> 2017-03-28 5:49 GMT+02:00 Michael Torrie :
> 
> > On 03/27/2017 09:13 PM, Jim wrote:
> > > I don't know if this is of any help but I am running Mint 18 with 
> > > Python 3.5 and I have a package installed called 
> python3-uno which 
> > > is described as "Python-UNO bridge". Maybe CentOS has a similarly 
> > > name package.
> >
> > You're right. In fact it looks like LibreOffice 5.3 at least ships 
> > with Python 3.5 as part of the package, and comes with 
> pyuno as part 
> > of that. Try running the python binary from the LibreOffice install 
> > directory (on my machine that is 
> /opt/libreoffice5.3/program/python).  
> > I'm not sure how to work with pyuno outside of the 
> LO-shipped python.
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Escaping confusion with Python 3 + MySQL

2017-03-27 Thread Jussi Piitulainen
Gregory Ewing writes:

> Νίκος Βέργος wrote:
>
>> Its still a mystery to em whay this fails syntactically when at the
>> same time INSERT works like that.
>
> I don't think *anyone* understands why SQL was designed with
> INSERT and UPDATE having completely different syntaxes.
> But it was, and we have to live with it.

A story I heard is that IBM had two competing teams working to design a
database system. One team understood programming languages. The other
team understood storage system layouts. The latter team won, and their
system grew up to be SQL.
-- 
https://mail.python.org/mailman/listinfo/python-list