User forums > Help

Is Python built into Code::Blocks?

<< < (2/2)

Jenna:
I do not have a link, search the wen and/or the forum.
But i's a plugin to develop python applications, not to use python as scripting-engine for C::B, this is not easily possible as thomas wrote.

thomas:
It really depends which of the two things you want.

If you want to develop Python scripts in Code::Blocks, you can do that, although it is not primarily designed for that purpose. Still, you can edit source code and organize source files in a project just fine, and you can launch python.exe either as tool or with a (relatively simple) compiler plugin, instead of running a compiler. Maybe such a plugin already exists, too.

If you want to use Python scripting within Code::Blocks, the answer is simply: bad luck for you.

oBFusCATed:
Here are the plugins for python/scripting languages: http://developer.berlios.de/projects/cbilplugin/
Our fellow dmoore works on them.
But be prepared to compile C++ code.

LETARTARE:

sous Windows, you can also write for example:

--- Code: ---#include <Python.h>

int main()
{
    Py_Initialize();
    PyRun_SimpleString (//"# This Python file uses the following encoding: utf-8\n"
"# -*- coding: iso-8859-1 -*-\n"
"import serial\n"
"from serial.tools import list_ports\n"

"listeport=list_ports.comports()\n"
"print 'Hardware serial ports :'\n"
"n=0\n"
"for tu in listeport:\n"
" print n, tu\n"
" n+=1\n"

"import serialenum\n"
"listeport=serialenum.enumerate()\n"
"print 'All serial ports :'\n"
"n=0\n"
"for tu in listeport:\n"
" print n, tu\n"
" n+=1\n"
"\n"
);
    Py_Finalize();
    return 0;
}
--- End code ---
and compile with gcc, gives exe file.

Navigation

[0] Message Index

[*] Previous page

Go to full version