Giter Site home page Giter Site logo

codeblocks-python's Introduction

Codeblocks-Python

A variety of plugins for the Code::Blocks IDE that will be useful for python programmers. Plugins include:

  • Code completion
  • Visual debugger
  • Python interpreter console

All plugins assume that python is installed and in the system path.

Code Completion

  • Uses the jedi completion lib (must be installed)
  • Provides completion tips for any open python source file
  • TODO: Symbol browser pane, showing docstrings alongside completion hints,

image

Visual Debugger

  • Uses pdb (installed by default in any python)
  • TODO: add support for rpdb2

To use it, make the python debugger the active debugger from the debugger menu

image

Then open a source file and press Debug/Continue (from the Debugger toolbar or the Debugger menu).

image

Python Interpreter Console

  • Run multiple python interpreters sessions inside a dockable pane in Code::Blocks
  • Features syntax highlighting and automatic indentation in the code input control
  • TODO: Handling stdin (e.g. raw_input), code completion hints, syntax error hints, extracting code/output from the I/O control, numbering instructions and output(?)

Usage

Show the interpreters panel using the View menu:

image

Each interpreter has 2 panes, one for editing and submitting blocks of code, the other for displaying the history of submitted statements and any output

image

When the code control has the keyboard focus, press

  • 'Enter' with the keyboard positioned at the end of your block of code to submit it to the interpreter
  • 'Ctrl-Up' and 'Ctrl-Down' to browse through the history of previously submitted statements.

Ready Built Binaries

Coming soon ...

Building from Source

There are two Code::Blocks projects for each of the plugins (one for Windows and one for Linux) and the XmlRpcEmbedder library that is used to control remote python processes from Code::Blocks. There is also a workspace file for Windows and Linux containing all of the projects.

Use the "All" target to compile against Code::Blocks that you have built yourself. Read more about building Code::Blocks at the Code::Blocks Wiki

Use the "cbplugin" target to be able to install into a pre-built Code::Blocks (you must compile against the headers that were used to create that version of Code::Blocks and link against the pre-built Code::Blocks library files)

For the cbplugin targets, the plugins that use it should be statically linked against the XmlRpcEmbedder lib if you want to be able to install the plugins as cbplugin packages.

Get Help

Use the issues to report problems or get support at the Code::Blocks Forums

codeblocks-python's People

Contributors

spillz avatar yvesdm3000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeblocks-python's Issues

Build Error in code::blocks 17.02

I just tried to build the plugin in code::blocks 17.02 on Ubuntu 16.04, but get the following error:

error: ‘virtual void wxEvtHandler::AddPendingEvent(const wxEvent&)’ is inaccessible

I built code::blocks myself from source. The full build log for your plugin is below. To build it I just did 'buld workspace'. Incidentally, when I first opened the workspace there was an issue with there being no global variable 'cb' set. I created one and set the base value to /home/rcrozier/src/codeblocks-17.12/src/include/. I've never used global variables before, so I'm not sure if this is correct.

-------------- Clean: LibCommon in XmlRpcEmbedder (compiler: GNU GCC Compiler)---------------

Cleaned "XmlRpcEmbedder - LibCommon"

-------------- Clean: default in PythonCodeCompletion (compiler: GNU GCC Compiler)---------------

Cleaned "PythonCodeCompletion - default"

-------------- Clean: default in PythonInterpreter (compiler: GNU GCC Compiler)---------------

Cleaned "PythonInterpreter - default"

-------------- Clean: default in PythonDebugger-Unix (compiler: GNU GCC Compiler)---------------

Cleaned "PythonDebugger-Unix - default"

-------------- Build: LibCommon in XmlRpcEmbedder (compiler: GNU GCC Compiler)---------------

g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/ExecHiddenMSW.cpp -o .objs/ExecHiddenMSW.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcClient.cpp -o .objs/XMLRPC/src/XmlRpcClient.o
/home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcClient.cpp: In member function ‘virtual std::__cxx11::string XmlRpc::XmlRpcClient::generateHeader(const string&)’:
/home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcClient.cpp:254:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘std::__cxx11::basic_string<char>::size_type {aka long unsigned int}’ [-Wformat=]
   sprintf(buff,"%d\r\n\r\n", body.size());
                                         ^
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcDispatch.cpp -o .objs/XMLRPC/src/XmlRpcDispatch.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcServer.cpp -o .objs/XMLRPC/src/XmlRpcServer.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcServerConnection.cpp -o .objs/XMLRPC/src/XmlRpcServerConnection.o
/home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcServerConnection.cpp: In member function ‘std::__cxx11::string XmlRpc::XmlRpcServerConnection::generateHeader(const string&)’:
/home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcServerConnection.cpp:350:44: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘std::__cxx11::basic_string<char>::size_type {aka long unsigned int}’ [-Wformat=]
   sprintf(buffLen,"%d\r\n\r\n", body.size());
                                            ^
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcServerMethod.cpp -o .objs/XMLRPC/src/XmlRpcServerMethod.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcSocket.cpp -o .objs/XMLRPC/src/XmlRpcSocket.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcSource.cpp -o .objs/XMLRPC/src/XmlRpcSource.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcUtil.cpp -o .objs/XMLRPC/src/XmlRpcUtil.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp -o .objs/XMLRPC/src/XmlRpcValue.o
g++ -ansi -g -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -fmessage-length=0 -fexceptions -Winvalid-pch -fPIC -IXMLRPC/include -c /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/xmlrpc_embedder.cpp -o .objs/xmlrpc_embedder.o
In file included from /usr/include/wx-3.0/wx/app.h:19:0,
                 from /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/xmlrpc_embedder.h:4,
                 from /home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/xmlrpc_embedder.cpp:3:
/usr/include/wx-3.0/wx/event.h: In member function ‘void XmlRpcInstance::OnEndProcess(wxProcessEvent&)’:
/usr/include/wx-3.0/wx/event.h:3387:18: error: ‘virtual void wxEvtHandler::AddPendingEvent(const wxEvent&)’ is inaccessible
     virtual void AddPendingEvent(const wxEvent& event)
                  ^
/home/rcrozier/src/codeblocks-python-git/XmlRpcEmbedder/xmlrpc_embedder.cpp:463:37: error: within this context
         m_parent->AddPendingEvent(ce);
                                     ^
Process terminated with status 1 (0 minute(s), 2 second(s))
2 error(s), 2 warning(s) (0 minute(s), 2 second(s))
 

failed to compile XmlRPCEmbedder on Mac OS!

I want to build python plugin for CB on Mac OS Yosemite. However, the compile is failed. The following is the error report:

clang++ -std=c++11 -O2  -fPIC -I/Users/james/Developer/wxWidgets/cocoabuild/lib/wx/include/osx_cocoa-unicode-3.0 -I/Users/james/Developer/wxWidgets/include -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__  -fmessage-length=0 -fexceptions -Winvalid-pch    -IXMLRPC/include -c /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp -o .objs30/XMLRPC/src/XmlRpcValue.o
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:232:13: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                        _St |= _IOS_FAILBIT|_IOS_EOFBIT; return _First; // unexpected EOF
                                               ^~~~~~~~~~~~
XMLRPC/include/base64.h:35:29: note: expanded from macro '_IOS_FAILBIT'
#define _IOS_FAILBIT   std::ios_base::failbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:232:26: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                        _St |= _IOS_FAILBIT|_IOS_EOFBIT; return _First; // unexpected EOF
                                                            ^~~~~~~~~~~
XMLRPC/include/base64.h:36:29: note: expanded from macro '_IOS_EOFBIT'
#define _IOS_EOFBIT    std::ios_base::eofbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:238:12: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                _St |= _IOS_FAILBIT; 
                                       ^~~~~~~~~~~~
XMLRPC/include/base64.h:35:29: note: expanded from macro '_IOS_FAILBIT'
#define _IOS_FAILBIT   std::ios_base::failbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:252:12: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                _St |= _IOS_FAILBIT|_IOS_EOFBIT; // unexpected EOF 
                                       ^~~~~~~~~~~~
XMLRPC/include/base64.h:35:29: note: expanded from macro '_IOS_FAILBIT'
#define _IOS_FAILBIT   std::ios_base::failbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:252:25: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                _St |= _IOS_FAILBIT|_IOS_EOFBIT; // unexpected EOF 
                                                    ^~~~~~~~~~~
XMLRPC/include/base64.h:36:29: note: expanded from macro '_IOS_EOFBIT'
#define _IOS_EOFBIT    std::ios_base::eofbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:258:12: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                _St |= _IOS_FAILBIT; 
                                       ^~~~~~~~~~~~
XMLRPC/include/base64.h:35:29: note: expanded from macro '_IOS_FAILBIT'
#define _IOS_FAILBIT   std::ios_base::failbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:273:12: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                _St |= _IOS_FAILBIT|_IOS_EOFBIT; 
                                       ^~~~~~~~~~~~
XMLRPC/include/base64.h:35:29: note: expanded from macro '_IOS_FAILBIT'
#define _IOS_FAILBIT   std::ios_base::failbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:273:25: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                _St |= _IOS_FAILBIT|_IOS_EOFBIT; 
                                                    ^~~~~~~~~~~
XMLRPC/include/base64.h:36:29: note: expanded from macro '_IOS_EOFBIT'
#define _IOS_EOFBIT    std::ios_base::eofbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:287:13: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                        _St |= _IOS_EOFBIT;
                                               ^~~~~~~~~~~
XMLRPC/include/base64.h:36:29: note: expanded from macro '_IOS_EOFBIT'
#define _IOS_EOFBIT    std::ios_base::eofbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
In file included from /Users/james/Developer/CodeBlocks-SVN/src/plugins/contrib/PythonPlugins/XmlRpcEmbedder/XMLRPC/src/XmlRpcValue.cpp:5:
XMLRPC/include/base64.h:315:13: error: incomplete type 'std::__1::ios_base' named in nested name specifier
                                        _St |= _IOS_EOFBIT; 
                                               ^~~~~~~~~~~
XMLRPC/include/base64.h:36:29: note: expanded from macro '_IOS_EOFBIT'
#define _IOS_EOFBIT    std::ios_base::eofbit
                       ~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:98:24: note: forward declaration of 'std::__1::ios_base'
class _LIBCPP_TYPE_VIS ios_base;
                       ^
10 errors generated.

By the way, is there any plan to update your python plugin to wx 3.0?

Lingering code-completion on different line

There is an issue where a slow code-completion request is running in the background and the user goes to another line, an unexpected/unwanted code-completion menu pops up.

Building Code::Blocks with these Python integrated

[Ubunutu 14.04 64bit]

I'm about to replace my Code::Block package binaries with a build from source. I'm wondering how difficult it would be to add these plug-ins to the list that comes with the standard code base. (So I don't have to build separately.)

Has anyone done this?

Cheers,
Nap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.