Re: [Tutor] Open a libreoffice calc file in Python

2016-12-22 Thread eryk sun
On Thu, Dec 22, 2016 at 4:20 PM, boB Stepp wrote: > > Both you and Eryk seem to be speaking in terms of using > subprocess.Popen() directly. So I think I need some clarification. > At > https://docs.python.org/3/library/subprocess.html#using-the-subprocess-module > it says: > > "The recommended

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-22 Thread Jim Byrnes
On 12/22/2016 03:54 AM, Alan Gauld via Tutor wrote: On 22/12/16 03:37, Jim Byrnes wrote: Python 3.4 on Ubuntu If I was going to open a libreoffice calc file from the terminal I would go: libreoffice --calc /home/path/to/myfile.ods. How would I do this from Python? Others have advised how to

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-22 Thread boB Stepp
On Wed, Dec 21, 2016 at 10:50 PM, wrote: > To my mind the more important thing is to use the "shell=False" version of > Popen. os.system() inherently accepts a shell command string, which means > you need to hand quote the /home/path/to/myfile.ods. But it is better to > pass an array of strings:

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-22 Thread Alan Gauld via Tutor
On 22/12/16 03:37, Jim Byrnes wrote: > Python 3.4 on Ubuntu > > If I was going to open a libreoffice calc file from the terminal I would > go: libreoffice --calc /home/path/to/myfile.ods. > > How would I do this from Python? Others have advised how to run the Libreoffice app from within Python.

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-21 Thread eryk sun
On Thu, Dec 22, 2016 at 4:50 AM, wrote: > BTW, the array form is Popen's default mode; sensibly you need to _ask_ to > use a shell string with shell=True, because that is harder and more fragile. Without shell=True, args as a string on POSIX is generally an error because it will look for the ent

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-21 Thread cs
On 21Dec2016 21:54, boB Stepp wrote: On Wed, Dec 21, 2016 at 9:37 PM, Jim Byrnes wrote: Python 3.4 on Ubuntu If I was going to open a libreoffice calc file from the terminal I would go: libreoffice --calc /home/path/to/myfile.ods. How would I do this from Python? My first thought was: impo

Re: [Tutor] Open a libreoffice calc file in Python

2016-12-21 Thread boB Stepp
On Wed, Dec 21, 2016 at 9:37 PM, Jim Byrnes wrote: > Python 3.4 on Ubuntu > > If I was going to open a libreoffice calc file from the terminal I would go: > libreoffice --calc /home/path/to/myfile.ods. > > How would I do this from Python? My first thought was: import os os.system(insert_your_co

[Tutor] Open a libreoffice calc file in Python

2016-12-21 Thread Jim Byrnes
Python 3.4 on Ubuntu If I was going to open a libreoffice calc file from the terminal I would go: libreoffice --calc /home/path/to/myfile.ods. How would I do this from Python? Thanks, Jim ___ Tutor maillist - Tutor@python.org To unsubscribe or c