PyScripter supports Python versions 2.3, 2.4, 2.5, 2.6, 3.0 and 3.1. You should consider support for version 2.3 as deprecated and likely to be dropped soon.
Here is how you can debug Django applications with PyScripter in six simple steps:
To stop debugging, right-click on the interpreter window and select "Reinitialize Interpreter", then go to the browser and reload the document.
You can very easily setup PyScripter so that it can work with unregistered versions of Python such as for example Portable Python and Movable Python which are typically residing in a USB stick or a portable hard disk.
Steps:
a) Download the zip-only distribution from the PyScripter downloads page and extract it to a directory of your choice in the portable drive.
b) From an existing PyScripter installation copy PyScripter.ini (this file is typically located in the %APPDATA%\PyScripter directory) to the same directory as the PyScripter.exe file..
c) In the same directory create a batch or command file that will set the PYTHONHOME environment variable and start PyScripter with appropriate command-line options e.g.
SET PYTHONHOME=E:\PortablePython PyScripter --PYTHON25 --PYTHONDLLPATH "E:\PortablePython" %1 %2 %3 %4 %5
d) Start PyScripter using the created batch file.
See answer above
The remote interpreter/debugger is strongly recommended for all uses of PyScripter. It is more robust since it isolates the IDE from the Python engine that runs your scripts. It also allows you to start afresh by reinitializing the Python engine.
When you run GUI scripts such wxPython, Tkinter etc. it is necessary to use the remote Python engine and reinitialize the engine before each run. This last step is done automatically by default. Back to Top
To work with matplotlib within PyScripter you should use the Remote Python Engines.
You can also run matplotlib in interactive mode. Here is how:
Assuming that you have selected the Remote Engine wx, issue the following commands in the interpreter:
>>> import matplotlib >>> matplotlib.interactive(True) >>> matplotlib.use("WXAgg") >>> from matplotlib.pylab import * >>> plot([1,2,3]) >>> xlabel('time (s)')
You can set the backend and interactive mode in the matplotlibrc file. If this is done, the following is sufficient for the above example:
>>> from pylab import * >>> plot([1,2,3]) >>> xlabel('time (s)')
Issue more pylab commands, or close the pylab window and call plot again for a new plot, etc.
Sample script by heylam
#Tested on: PyScripter 1.9.9.2, Matplotlib 0.91.2 #Assumed setup: #In site-packages\matplotlib\mpl-data\matplotlibrc set backend to WXAgg. def demoplot(): '''This represents your work''' close('all') #closes figures t = c_[0:1:20j] s = cos(2*pi*t) for ampl in c_[0.1:1:10j]: plot(t, ampl*s, 'o-', lw=2) xlabel('time (s)') ylabel('voltage (mV)') title('demo', color='b') grid(True) draw() #update figure if already shown #Select a demonstration: if 0: #Normal session #Starts non-interactive. #Figures have toolbar for zooming and panning. #Disadvantage: You can't re-run your script with PyScripter Remote # engine without first reinitializing the Remote interpreter. #Best use Remote(Wx) engine. This also allows interactive mode using # ion() and ioff(). For disadvantages: see the PyScripter help file. #from numpy import * #from scipy import * #includes numpy from pylab import * #includes scipy demoplot() show() #Open the figure, let figure GUI take over. #This should be last line of script. #You can also type this at command line after the script exits. if 0: ion() #turns interactive mode on (needs Remote(Wx) engine!) ylabel('interactive modification') plot( rand(200), rand(200), 'go' ) ioff() #turns interactive mode off elif 0: #Same but use WX instead try: type(matplotlib) except NameError: import matplotlib matplotlib.use('WX') from matplotlib.pylab import * demoplot() show() #Open the figure, let figure GUI take over. #This should be last line of script. #You can also type this at command line after the script exits. elif 0: #Same but start as interactive session, needs Remote(Wx)engine. try: type(matplotlib) except NameError: import matplotlib matplotlib.interactive(True) from matplotlib.pylab import * demoplot() show() #Open the figure, let figure GUI take over. #This should be last line of script. #You can also type this at command line after the script exits. elif 0:#pdf output, allows use of Remote engine without re-initialization. #Disadvantage: no figure toolbar. #WARNING: close the file in acrobat reader before the next run. #(Maybe other pdf viewers don't block file overwrite) try: type(matplotlib) except NameError: import matplotlib matplotlib.use('PDF') from pylab import * demoplot() filename='demo_plot' savefig(filename) #view the file: import win32api win32api.ShellExecute(0, "open", filename+'.pdf', None, "", 1) elif 1:#png output, allows use of Remote engine without re-initialization. #Disadvantage: no figure toolbar. #Tip: make Irfanview your standard viewer. from pylab import * demoplot() filename='demo_plot' savefig(filename) #view the file: import win32api win32api.ShellExecute(0, "open", filename+'.png', None, "", 1)
TortoiseHg is Windows Explorer extention for the Mercurial distributed revision control system. When installed it affects PyScripter in two ways.
Use PyScripter with a python version different than 2.5 which comes with TortoiseHg. You can force PyScripter to use a specific version of Python using the -PYTHONxx start up flags e.g.
PyScripter --PYTHON26
If you really need to use Python 2.5 then create a command file with the following
regsvr32 /u "C:\Program Files\TortoiseHg\tortoisehg.dll" PyScripter --PYTHON25 --PYTHONDLLPATH=c:\windows\system32 regsvr32 "C:\Program Files\TortoiseHg\tortoisehg.dll"
Then run PyScripter using this command file. Note that the PYTHONDLLPATH should point to the directory in which the originall python25.dll that came from the python installation program resides.
Update The incompatibility between PyScripter and the TortoiseHg Mercurial addon has finally been fixed with the release of TortoiseHg 0.8, which replaces the Python Windows shell extensions with C++ based ones. Back to Top
This how-to is based on the XFCE 4.8 desktop running on top of Ubuntu 11.04. The easiest way to get this configuration is to install Xubuntu. Or from any Ubuntu distribution one can install the XFCE meta package from Synaptic and choose XFCE from the boot manager at login.
I installed version 1.3.15 via Synaptic.
option and proceed with the installation as normal.
Double click on the exe and Wine will intercept it and run it automagically.
and proceed with the installation as normal. Applications menu>Wine>Programs>PyScripter> "your choice"
Both configurations seem to work flawlessly with the internal and remote python engines.
from PyQt4 import QtCore, QtGui
* Save and restart [PyScripter](PyScripter), go to a new editor and type
from PyQt4 import QtCore, QtGui
QtGui.
and voila. Code completion is available. See Support Group message for explanations.
Most likely you are using scripts with file names containing non-ascii characters. Please see my blog post explaining the issue and providing advice for dealing with it.
Home: Home
Wiki: PyScripter
Wiki: RemoteEngines
Wiki: Sidebar
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: map...@gmail.com
for the "portable python" batch file example above, use
%*
instead of%1 %2 ... %5
to capture all command line parameters instead of just the first five. Also on WinXP and above,%~dp0
can be used to determine the path of the currently running batchfile (so the drive letter doesn't need to be hard coded).Example,
pyscripter25.bat
at root of portable drive:Last edit: Anonymous 2019-01-24
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: lars.ru...@gmail.com
Following the discussion in https://groups.google.com/d/topic/pyscripter/1xwy0yltTrA/discussion As i guess no one will ever put this into the FAQ, i'm posting this here, in the hope it will get picked up by search engines and may be helpfull to others.
How do I use PyScripter with virtualenv? There's a problem if you use PyScripter with the remote python engine in a virutalenv environment. On Microsoft Windows, if ENV is your virtual python environment (created with 'python virtualenv.py ENV'), then after switching to this environment, the python.exe executable is located in C:\Python27\ENV\Scripts. (Or whatever your Python version and installation directory is) However, PyScripter expects it to be in C:\Python27\ENV. You can use this workaround: Create a symbolic link from C:\Python27\ENV\python.exe to C:\Python27\ENV\Scripts\python.exe . On Windows Vista or 7, you may use the mklink command to do this:
(you'll need administrator privilleges to do this). Start PyScripter via a batch file with the following commands:
The first line activates the virtual environment ENV. The second line sets the PYTHONHOME environment variable to the one defined by virtualenv, i.e. 'C:\Python27\ENV'. This is that Python finds all libraries specific to that environment. The last line starts PyScripter via a project file. You might as well call PyScripter.exe directly. Versions tested: Python 2.7.3 PyScripter 2.5.3.0 x86 virtualenv 1.8.2 on Windows 7 (32 bit)
Last edit: Anonymous 2019-01-24
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: bisketas...@gmail.com
How do i use PyScripter With Blender
Last edit: Anonymous 2019-01-24
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: alessand...@gmail.com
when i import liblas module i have this message
import liblas Traceback (most recent call last):
WindowsError?: 193? %1 is not a valid Win32 application
Last edit: Anonymous 2019-01-24
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: garyrh...@gmail.com
Are there any plans to port PyScripter to Linux?
Last edit: Anonymous 2019-01-24
It would be really intersting to use PyScripter as an IDE pour OpenOffice / LibreOffice, which slill lacks an IDE for python programming. It is possible to define the LibreOffice python as an external engine. I have a script (8000 lines) which is properly run by PyScripter with the external engine properly configured, and then Run / External Run (Alt + F9). But this does not allow debugging. So I tried to use the FAQ option above : How do I use PyScripter with an unregistered version of Python?.
PyScripter starts well with :
Be careful with the quotes.
Tools / Python Path shows :
c:\Prog2\LibreOffice 5\program\python-core-3.3.0\DLLs
c:\Prog2\LibreOffice 5\program\python-core-3.3.0\lib
c:\Prog2\LibreOffice 5\program\python-core-3.3.0
c:\Prog2\LibreOffice 5\program\python33.zip
c:\Prog2\LibreOffice 5\program\python-core-3.3.0\lib\site-packages
"import uno" raises the error : "No module named 'uno' ".
If I add a line in the python paths :
c:\Prog2\LibreOffice 5\program
then, "import uno" works, but "from com.sun.star. ... import ...." fails :
"ImportError: No module named 'com' (or 'com.sun.star.script.provider.XScriptContext' is unknown)"
I will update the post if I find a solution
Last edit: Averell 2018-02-09
Hi from the future, did you ever figure this out? I am having the same issue with IntelliJ.
Unfortunately I didn't find a solution. It is a pity that LibreOffice which supports python scripts for more than a decade has never made any effort to give us a proper IDE.
Hello,
I was able to get things working with IntelliJ with the help of a tool called IDE_Utils, found here: https://gitlab.com/LibreOfficiant/ide_utils/-/tree/master
Add it to your LibreOffice/program/ directory.
Download the official python that matches your LibreOffice, mine was 3.8.10. From Intellij create a new Python project and new virtual environment using it as the SDK. Close the project. Then create a new Python project, choose Add Python SDK... -> Virtual Environment -> Existing environment -> C:\Program Files\LibreOffice\program\python.exe as referenced here: https://wiki.documentfoundation.org/Macros/Python_Basics under IDE Project Setup -> Pycharm (also made by JetBrains). It seems this custom python knows all about the Uno files.
Finally you may need to update line 154 of IDE_Utils to point to your LibreOffice install.
Open an odt file (LibreOffice Writer document) and run the sample macros from IDE_Utils. I was able to get Hello World to print in the document.
Perhaps the first virtual environment is not needed but this is what worked for me.
Order of images: Exisiting_environment, Add_python_sdk, Project_name_and_paths
Last edit: Brian Hultin 2022-06-07