Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Alan Gauld
On 12/07/14 02:29, Jim Byrnes wrote: I've worked on this a little more. If I create a file like: #!/usr/bin/python import os, subprocess subprocess.Popen(args=[gnome-terminal, --working-directory=/home/jfb/Documents/Prog/Python/breezygui]) and execute it, it will take me to the correct

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Jim Byrnes
On 07/11/2014 10:50 PM, Cameron Simpson wrote: On 11Jul2014 20:29, Jim Byrnes jf_byr...@comcast.net wrote: I've worked on this a little more. If I create a file like: #!/usr/bin/python import os, subprocess subprocess.Popen(args=[gnome-terminal,

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Jim Byrnes
On 07/12/2014 03:02 AM, Alan Gauld wrote: On 12/07/14 02:29, Jim Byrnes wrote: I've worked on this a little more. If I create a file like: #!/usr/bin/python import os, subprocess subprocess.Popen(args=[gnome-terminal, --working-directory=/home/jfb/Documents/Prog/Python/breezygui]) and

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Alan Gauld
On 12/07/14 16:34, Jim Byrnes wrote: I guess because I don't have the depth of knowledge to know any better. I wanted to automate a tedious process using Python. I was working with a Python3 version of breezypythongui on a Python2.7 system. So I would open a terminal, cd to the correct

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-12 Thread Jim Byrnes
On 07/12/2014 01:36 PM, Alan Gauld wrote: On 12/07/14 16:34, Jim Byrnes wrote: I guess because I don't have the depth of knowledge to know any better. I wanted to automate a tedious process using Python. I was working with a Python3 version of breezypythongui on a Python2.7 system. So I would

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-11 Thread Jim Byrnes
On 07/10/2014 09:23 AM, Jim Byrnes wrote: On 07/09/2014 04:16 PM, Walter Prins wrote: Hi Jim, On 9 July 2014 14:43, Jim Byrnes jf_byr...@comcast.net wrote: On 07/09/2014 04:27 AM, Walter Prins wrote: I forgot to mention I am using Linux (Ubuntu 12.04). I am working my way through a book

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-11 Thread Cameron Simpson
On 11Jul2014 20:29, Jim Byrnes jf_byr...@comcast.net wrote: I've worked on this a little more. If I create a file like: #!/usr/bin/python import os, subprocess subprocess.Popen(args=[gnome-terminal, --working-directory=/home/jfb/Documents/Prog/Python/breezygui]) and execute it, it will take

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-10 Thread Jim Byrnes
On 07/09/2014 05:40 PM, Cameron Simpson wrote: On 09Jul2014 09:00, Jim Byrnes jf_byr...@comcast.net wrote: My mistake. I went to the Docs page and clicked on modules and then os. For some reason as I was scrolling down the page I thought the subject had changed and stopped reading. Now I see

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-10 Thread Jim Byrnes
On 07/09/2014 04:16 PM, Walter Prins wrote: Hi Jim, On 9 July 2014 14:43, Jim Byrnes jf_byr...@comcast.net wrote: On 07/09/2014 04:27 AM, Walter Prins wrote: I forgot to mention I am using Linux (Ubuntu 12.04). I am working my way through a book about breezypythongui which uses Python 3,

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-09 Thread Walter Prins
Hi Jim, On 8 July 2014 21:45, Jim Byrnes jf_byr...@comcast.net wrote: I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate I found some examples of using os.system() to get gnome-terminal to open but I

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-09 Thread Jim Byrnes
On 07/09/2014 04:27 AM, Walter Prins wrote: Hi Jim, On 8 July 2014 21:45, Jim Byrnes jf_byr...@comcast.net wrote: I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate I found some examples of using

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-09 Thread Jim Byrnes
On 07/08/2014 06:39 PM, Alan Gauld wrote: On 08/07/14 21:45, Jim Byrnes wrote: I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate Thats almost certainly the wrong approach. Instead of trying to automate

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-09 Thread Walter Prins
Hi Jim, On 9 July 2014 14:43, Jim Byrnes jf_byr...@comcast.net wrote: On 07/09/2014 04:27 AM, Walter Prins wrote: I forgot to mention I am using Linux (Ubuntu 12.04). I am working my way through a book about breezypythongui which uses Python 3, hence virtualenv. I found that each time I

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-09 Thread Cameron Simpson
On 09Jul2014 09:00, Jim Byrnes jf_byr...@comcast.net wrote: My mistake. I went to the Docs page and clicked on modules and then os. For some reason as I was scrolling down the page I thought the subject had changed and stopped reading. Now I see I stopped reading to soon as it is much

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-09 Thread Cameron Simpson
On 09Jul2014 22:16, Walter Prins wpr...@gmail.com wrote: On 9 July 2014 14:43, Jim Byrnes jf_byr...@comcast.net wrote: On 07/09/2014 04:27 AM, Walter Prins wrote: I forgot to mention I am using Linux (Ubuntu 12.04). I am working my way through a book about breezypythongui which uses Python

[Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-08 Thread Jim Byrnes
I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate I found some examples of using os.system() to get gnome-terminal to open but I can't figure out how then cd to the proper directory in the new terminal.

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-08 Thread Danny Yoo
You might look at: http://askubuntu.com/questions/351582/open-terminal-window-and-execute-python-script-on-startup http://superuser.com/questions/198015/open-gnome-terminal-programmatically-and-execute-commands-after-bashrc-was-execu both which appears relevant to your question. If I

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-08 Thread Alan Gauld
On 08/07/14 21:45, Jim Byrnes wrote: I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate Thats almost certainly the wrong approach. Instead of trying to automate what the user does in the terminal replace

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-08 Thread Cameron Simpson
On 08Jul2014 15:45, Jim Byrnes jf_byr...@comcast.net wrote: I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate I found some examples of using os.system() to get gnome-terminal to open but I can't figure

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-08 Thread Steven D'Aprano
On Tue, Jul 08, 2014 at 03:45:42PM -0500, Jim Byrnes wrote: I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate Why not just run /bin/activate directly from Python? os.chdir(the/proper/directory)

Re: [Tutor] How can I open and use gnome-terminal from a Python script?

2014-07-08 Thread Cameron Simpson
On 09Jul2014 11:42, Steven D'Aprano st...@pearwood.info wrote: On Tue, Jul 08, 2014 at 03:45:42PM -0500, Jim Byrnes wrote: I would like to automate running virtualenv with a python script by: opening gnome-terminal cd to proper directory run source /bin/activate Why not just run