This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KDevelop python

Tags: None
(comma "," separated)
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: KDevelop python

Wed Jun 18, 2014 7:18 am
Did you install the Python 2 or the Python 3 version of the plugin? I'll have a look if I can reproduce this then.


I'm working on the KDevelop IDE.
mkramer
Registered Member
Posts
3
Karma
0

Re: KDevelop python

Wed Jun 18, 2014 9:51 am
Hi,

I have installed kdev-python version 1.6.1-py3.

Kind regards,
Michael
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: KDevelop python

Wed Jun 18, 2014 11:20 pm
Thanks for the report, this was actually broken for python 3 -- it was still using the old print syntax. I fixed it now, you can either build the 1.6-py3 branch of kdev-python from sources or wait for the next bugfix release (1.6.2).

Greetings!


I'm working on the KDevelop IDE.
mkramer
Registered Member
Posts
3
Karma
0

Re: KDevelop python

Sun Jun 22, 2014 9:39 am
Hi,

I have tried it. Now it works like a charm;)

Thank you
Michael
TheArchitect
Registered Member
Posts
4
Karma
0
OS

Re: KDevelop python

Sun Jul 20, 2014 8:15 am
This plugin works perfectly for me! ;D
After having tested different Python ide, it has made Kdevelop my principal IDE

I've got a question about the plugin. Would it be possible to use like a Python interpreter (to quickly check some code like in IDLE)?
I've tried some code like ( coding a Python interpreter inside a Python program) :
Code: Select all
import readline
import code
vars = globals().copy()
vars.update(locals())
shell = code.InteractiveConsole(vars)
shell.interact()


But apparently I can put no input. I've read about using the option of 'using an external Terminal' but I don't know which option put inside it
https://stackoverflow.com/questions/121 ... n-kdevelop
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: KDevelop python

Sun Jul 20, 2014 10:18 am
The KDevelop output view is only an output view and does not support input. "Use external terminal" only works for the "Native application" (called "Compiled binary" in newer versions) launcher, which you can use as well for python if you want (just put python as the executable and your script path as the argument).

I personally would recommend using the terminal tool view for such purposes. It has a shortcut to focus/close/open it, and pressing that and up arrow + enter isn't really much worse than pressing your launch shortcut in this case.

Greetings!


I'm working on the KDevelop IDE.
TheArchitect
Registered Member
Posts
4
Karma
0
OS

Re: KDevelop python

Sun Jul 20, 2014 12:11 pm
Thanks a lot for your reply!

scummos wrote:I personally would recommend using the terminal tool view for such purposes. It has a shortcut to focus/close/open it, and pressing that and up arrow + enter isn't really much worse than pressing your launch shortcut in this case.

Sorry to ask for precision but where is the "terminal tool view" in Kdevelop?
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: KDevelop python

Sun Jul 20, 2014 12:34 pm
There should be a button in the bottom toolbar:
http://i.imgur.com/3E8VfuG.png

Maybe you need to add it through the right-click menu. Since you're not using Plasma as your desktop, another possibility is that you don't have "konsole" installed, which is required for the toolview to work.

Greetings!


I'm working on the KDevelop IDE.
malcolmm
Registered Member
Posts
2
Karma
0

Re: KDevelop python

Mon Oct 20, 2014 10:17 pm
Hello,

I compile the module but I can't seem to have it in the external module list.
I work on Fedora 20 with Kdevelop 4.7 and I don't really remember which version of the plugin I installed and I can't find this information anywhere in the folder.

When I try to run :

Code: Select all
[malcolm@bokkie ~]$ echo $KDEDIRS
/usr
[malcolm@bokkie ~]$  KDEDIRS=$KDEDIRS:/usr/local
[malcolm@bokkie ~]$ echo $KDEDIRS
/usr:/usr/local
[malcolm@bokkie ~]$ kbuildsycoca4
kbuildsycoca4 running...
kbuildsycoca4(15772) VFolderMenu::loadDoc: Parse error in  "/home/malcolm/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu" , line  1 , col  1 :  "unexpected end of file"
[malcolm@bokkie ~]$


So I don't really know what to do. Any help on this would be appreciated =)
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: KDevelop python

Mon Oct 20, 2014 10:30 pm
You have to do export KDEDIRS=$KDEDIRS:/usr/local, otherwise the change is just for the shell you're currently running, not its child-processes. Hope that helps.


I'm working on the KDevelop IDE.
malcolmm
Registered Member
Posts
2
Karma
0

Re: KDevelop python

Mon Nov 03, 2014 12:49 pm
Hello again,

Ok I did the export. Now when I start Kdevelop I have a huge crash :( .

Code: Select all
Thread 2 (Thread 0x7f4bc37fe700 (LWP 8211)):
[KCrash Handler]
#5  0x00007f4c9a5e3e81 in KDevelop::DUContext::findDeclarations(KDevelop::QualifiedIdentifier const&, KDevelop::CursorInRevision const&, TypePtr<KDevelop::AbstractType> const&, KDevelop::TopDUContext const*, QFlags<KDevelop::DUContext::SearchFlag>) const () from /lib64/libkdevplatformlanguage.so.8
#6  0x00007f4bd8bc9b7e in operator() (p=..., __closure=<synthetic pointer>) at /home/malcolm/external_source/kdev-python/duchain/expressionvisitor.cpp:761
#7  Python::ExpressionVisitor::fromBinaryOperator (this=this@entry=0x7f4bc37fc9f0, lhs=..., rhs=..., op=...) at /home/malcolm/external_source/kdev-python/duchain/expressionvisitor.cpp:769
#8  0x00007f4bd8bca01d in Python::ExpressionVisitor::visitBinaryOperation (this=0x7f4bc37fc9f0, node=0x7f4ba80b8f20) at /home/malcolm/external_source/kdev-python/duchain/expressionvisitor.cpp:789
#9  0x00007f4bd8bc9eaf in Python::ExpressionVisitor::visitBinaryOperation (this=0x7f4bc37fce50, node=0x7f4ba80b8ff0) at /home/malcolm/external_source/kdev-python/duchain/expressionvisitor.cpp:778
#10 0x00007f4bd8bcb053 in Python::ExpressionVisitor::visitCall (this=0x7f4bc37fce50, node=0x7f4ba80b9320) at /home/malcolm/external_source/kdev-python/duchain/expressionvisitor.cpp:264
#11 0x00007f4bd8be5003 in Python::DeclarationBuilder::visitCall (this=0x7f4bc37fda30, node=0x7f4ba80b9320) at /home/malcolm/external_source/kdev-python/duchain/declarationbuilder.cpp:938
#12 0x00007f4be0c42ab7 in Python::AstDefaultVisitor::visitAssignment (this=this@entry=0x7f4bc37fda88, node=node@entry=0x7f4ba80b9750) at /home/malcolm/external_source/kdev-python/parser/astdefaultvisitor.cpp:368
#13 0x00007f4bd8be69c5 in Python::DeclarationBuilder::visitAssignment (this=0x7f4bc37fda30, node=0x7f4ba80b9750) at /home/malcolm/external_source/kdev-python/duchain/declarationbuilder.cpp:1139
#14 0x00007f4bd8bda5c5 in visitNodeList<Python::Ast> (l=..., this=0x7f4bc37fda30) at /home/malcolm/external_source/kdev-python/duchain/contextbuilder.h:121
#15 Python::ContextBuilder::visitFunctionBody (this=0x7f4bc37fda30, node=<optimized out>) at /home/malcolm/external_source/kdev-python/duchain/contextbuilder.cpp:503
#16 0x00007f4bd8be8dba in Python::DeclarationBuilder::visitFunctionDefinition (this=0x7f4bc37fda30, node=0x7f4ba80bb030) at /home/malcolm/external_source/kdev-python/duchain/declarationbuilder.cpp:1504
#17 0x00007f4bd8be84cb in Python::DeclarationBuilder::visitClassDefinition (this=0x7f4bc37fda30, node=0x7f4ba80c33a0) at /home/malcolm/external_source/kdev-python/duchain/declarationbuilder.cpp:1428
#18 0x00007f4be0c42f1c in Python::AstDefaultVisitor::visitCode (this=this@entry=0x7f4bc37fda88, node=node@entry=0x7f4ba8072470) at /home/malcolm/external_source/kdev-python/parser/astdefaultvisitor.cpp:66
#19 0x00007f4bd8bda9e7 in Python::ContextBuilder::visitCode (this=this@entry=0x7f4bc37fda30, node=node@entry=0x7f4ba8072470) at /home/malcolm/external_source/kdev-python/duchain/contextbuilder.cpp:329
#20 0x00007f4bd8bde5f0 in Python::DeclarationBuilder::visitCode (this=0x7f4bc37fda30, node=0x7f4ba8072470) at /home/malcolm/external_source/kdev-python/duchain/declarationbuilder.cpp:356
#21 0x00007f4bd8bea02d in supportBuild (context=0x7f4ba805e2c0, node=0x7f4ba8072470, this=0x7f4bc37fda30) at /usr/include/kde4/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:133
#22 KDevelop::AbstractTypeBuilder<Python::Ast, Python::Identifier, Python::ContextBuilder>::supportBuild (this=0x7f4bc37fda30, node=0x7f4ba8072470, context=<optimized out>) at /usr/include/kde4/kdevplatform/language/duchain/builders/abstracttypebuilder.h:85
#23 0x00007f4bd8bdb11b in build (updateContext=..., node=0x7f4ba8072470, url=..., this=0x7f4bc37fda30) at /usr/include/kde4/kdevplatform/language/duchain/builders/abstractcontextbuilder.h:113
#24 Python::ContextBuilder::build (this=this@entry=0x7f4bc37fda30, url=..., node=node@entry=0x7f4ba8072470, updateContext=...) at /home/malcolm/external_source/kdev-python/duchain/contextbuilder.cpp:82
#25 0x00007f4bd8bdffc3 in Python::DeclarationBuilder::build (this=this@entry=0x7f4bc37fda30, url=..., node=node@entry=0x7f4ba8072470, updateContext=...) at /home/malcolm/external_source/kdev-python/duchain/declarationbuilder.cpp:102
#26 0x00007f4bd90556d8 in Python::ParseJob::run (this=0x5318650) at /home/malcolm/external_source/kdev-python/pythonparsejob.cpp:151
#27 0x00007f4ca06ada42 in ThreadWeaver::JobRunHelper::runTheJob(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /lib64/libthreadweaver.so.4
#28 0x00007f4ca06adc2e in ThreadWeaver::Job::execute(ThreadWeaver::Thread*) () from /lib64/libthreadweaver.so.4
#29 0x00007f4ca06ad40b in ThreadWeaver::Thread::run() () from /lib64/libthreadweaver.so.4
#30 0x00007f4c9cbb269f in QThreadPrivate::start(void*) () from /lib64/libQtCore.so.4
#31 0x00007f4c9c920f35 in start_thread () from /lib64/libpthread.so.0
#32 0x00007f4c9be2ac3d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f4ca224c940 (LWP 8023)):
#0  0x00007f4ca20c35a1 in _dl_sort_fini () from /lib64/ld-linux-x86-64.so.2
#1  0x00007f4ca20c384d in _dl_fini () from /lib64/ld-linux-x86-64.so.2
#2  0x00007f4c9bd6f0f9 in __run_exit_handlers () from /lib64/libc.so.6
#3  0x00007f4c9bd6f145 in exit () from /lib64/libc.so.6
#4  0x00007f4c7fdfb4ce in gdk_x_io_error () from /lib64/libgdk-x11-2.0.so.0
#5  0x00007f4c9e711fa0 in KApplication::xioErrhandler(_XDisplay*) () from /lib64/libkdeui.so.5
#6  0x00007f4c999a315e in _XIOError () from /lib64/libX11.so.6
#7  0x00007f4c999a0b4d in _XEventsQueued () from /lib64/libX11.so.6
#8  0x00007f4c9999256b in XEventsQueued () from /lib64/libX11.so.6
#9  0x00007f4c9d7d669c in x11EventSourceCheck(_GSource*) () from /lib64/libQtGui.so.4
#10 0x00007f4c95553ff9 in g_main_context_check () from /lib64/libglib-2.0.so.0
#11 0x00007f4c95554533 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#12 0x00007f4c955546dc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#13 0x00007f4c9cceb41e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#14 0x00007f4c9d7d6c46 in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtGui.so.4
#15 0x00007f4c9ccbb38f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#16 0x00007f4c9ccbb6dd in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQtCore.so.4
#17 0x00007f4c9ccc0da9 in QCoreApplication::exec() () from /lib64/libQtCore.so.4
#18 0x0000000000410561 in main ()


I think it's the interesing part with the actual bug. I'm running Kdevelop 4.7.

[EDIT] NEVERMIND, I just needed to restart the project ! =) Thanks a lot

What would be the best way to have the export on every start of kdevelop ? :S
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: KDevelop python

Mon Nov 03, 2014 7:28 pm
You can have a shell script, or put it in your .bashrc or so. To be honest, I'm not sure if there's an official, proper way -- if you find it, let us know ;)


I'm working on the KDevelop IDE.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KDevelop python

Tue Nov 04, 2014 4:20 am
There is no official way as such. The most reliable way is to place an executable *.sh file in $KDEHOME/env/ containing the export statement in question as startkde will always include that (assuming you use a Plasma Workspace).


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]