How to run main script

124 views
Skip to first unread message

ABarbosa

unread,
Aug 3, 2012, 1:25:45 PM8/3/12
to pyscr...@googlegroups.com
I'm trying pyscripter as replacement of my favorite python editor but there are several things that I miss or do not find.

This one is so basic that I don't believe it is not yet implemented:

 - how to run the main script without leaving the actual tab editor?

I know that I can, for each project, define one (or more) «Run Configuration» but I don't know how to associate a shortcut key or a button in the toolbar.
I know that I can use «run last script» but this is not always the same.

Any help would be appreciated.

By the way: so far, I like PyScripter. Good work!
Thanks
AB

Colin J. Williams

unread,
Aug 3, 2012, 1:35:37 PM8/3/12
to pyscr...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "PyScripter" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyscripter/-/WaMrpNvNRm8J.
To post to this group, send email to pyscr...@googlegroups.com.
To unsubscribe from this group, send email to pyscripter+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyscripter?hl=en.
I have never found a need to use "Run Configuration".

Have you tried F9, which starts the current script in the Debug Mode?   Perhaps it would help if you told us just what you are aiming to do,

Yes PyScripter is a work of beauty.

Colin W.

ABarbosa

unread,
Aug 3, 2012, 5:17:55 PM8/3/12
to pyscr...@googlegroups.com
Colin, thanks for a quick answer.

Let me describe better my problem:

In a typical project we have several scripts (right?)
Suppose the first is main.py, the second is custom.py, the third is utils.py
Suppose that main.py imports custom and utils

Now suppose that I'm furiously working in the third script and each time I want to test it, if I press F9 I debug only that script.
But if I want to run the «project» I have to run the fisrt script (main.py): for that I have to select the first tab of the editor and then press ^F9.

It is possible to run the script in the first tab without leaving the focus of the script that I'm working on?

Is that clear now?

Thanks again
Antonio B 

On Friday, August 3, 2012 6:35:37 PM UTC+1, cjw wrote:
On 03/08/2012 1:25 PM, ABarbosa wrote:
I'm trying pyscripter as replacement of my favorite python editor but there are several things that I miss or do not find.

This one is so basic that I don't believe it is not yet implemented:

 - how to run the main script without leaving the actual tab editor?

I know that I can, for each project, define one (or more) «Run Configuration» but I don't know how to associate a shortcut key or a button in the toolbar.
I know that I can use «run last script» but this is not always the same.

Any help would be appreciated.

By the way: so far, I like PyScripter. Good work!
Thanks
AB

--
You received this message because you are subscribed to the Google Groups "PyScripter" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyscripter/-/WaMrpNvNRm8J.
To post to this group, send email to pyscr...@googlegroups.com.
To unsubscribe from this group, send email to pyscripter+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/pyscripter?hl=en.

PyScripter

unread,
Aug 3, 2012, 6:59:39 PM8/3/12
to pyscr...@googlegroups.com
I am afraid currently you can not assign a shortcut key to a Run Configuration.   You can only right-click on it and select Run, Debug or External Run.

ABarbosa

unread,
Aug 3, 2012, 7:16:25 PM8/3/12
to pyscr...@googlegroups.com
Thank you.
AB

Colin J. Williams

unread,
Aug 3, 2012, 7:52:43 PM8/3/12
to pyscr...@googlegroups.com
Antonio,

I've interpolated some comments below, I hope that they help.

Colin W.


On 03/08/2012 5:17 PM, ABarbosa wrote:
Colin, thanks for a quick answer.

Let me describe better my problem:

In a typical project we have several scripts (right?)
In Pythonese, we thinks of these as modules or packages.

Suppose the first is main.py, the second is custom.py, the third is utils.py
Suppose that main.py imports custom and utils
This is clear


Now suppose that I'm furiously working in the third script and each time I want to test it, if I press F9 I debug only that script.
I would suggest that first, before testing the project, there should be test cases in utils.py to (a) confirm that the additions you have made are functioning properly and (b) confirm that the changes you have made have not upset other functionality.

The utils.py module would look something like this:
Class definitions
Function definitions
Main module test function - say test()
if __name__ == '__main__':
     test()                                           <<==  Note that this line is not reached if  utils is imported by some other module

But if I want to run the «project» I have to run the fisrt script (main.py): for that I have to select the first tab of the editor and then press ^F9.

It is possible to run the script in the first tab without leaving the focus of the script that I'm working on?
No, but you could put breakpoints in say utils, when executing main.  Thus there would be a need to save the changes in utils and one extra click to move from utils - the module being changed to main.

I would not advocate use of a button to combine the functions.

I hope that this helps.

Is that clear now?
Yes, thanks.

Thanks again
Antonio B

Colin W.

On Friday, August 3, 2012 6:35:37 PM UTC+1, cjw wrote:
On 03/08/2012 1:25 PM, ABarbosa wrote:
I'm trying pyscripter as replacement of my favorite python editor but there are several things that I miss or do not find.

This one is so basic that I don't believe it is not yet implemented:

 - how to run the main script without leaving the actual tab editor?

I know that I can, for each project, define one (or more) «Run Configuration» but I don't know how to associate a shortcut key or a button in the toolbar.
I know that I can use «run last script» but this is not always the same.

Any help would be appreciated.

By the way: so far, I like PyScripter. Good work!
Thanks
AB

--
You received this message because you are subscribed to the Google Groups "PyScripter" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyscripter/-/WaMrpNvNRm8J.
To post to this group, send email to pyscr...@googlegroups.com.
To unsubscribe from this group, send email to pyscripter+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyscripter?hl=en.
I have never found a need to use "Run Configuration".

Have you tried F9, which starts the current script in the Debug Mode?   Perhaps it would help if you told us just what you are aiming to do,

Yes PyScripter is a work of beauty.

Colin W.
--
You received this message because you are subscribed to the Google Groups "PyScripter" group.
To view this discussion on the web visit https://groups.google.com/d/msg/pyscripter/-/0Hn49Q1rLMgJ.

To post to this group, send email to pyscr...@googlegroups.com.
To unsubscribe from this group, send email to pyscripter+...@googlegroups.com.

ABarbosa

unread,
Aug 4, 2012, 6:53:25 AM8/4/12
to pyscr...@googlegroups.com
Colin, thanks for your thorough response. 

Antonio B.



On Friday, August 3, 2012 6:25:45 PM UTC+1, ABarbosa wrote:
Reply all
Reply to author
Forward
0 new messages