Just include the main header—this pulls in everything under the Pythonic (or py) namespace:
#include "pythonic/pythonic.hpp"
using namespace Pythonic;
// or
using namespace py;Or, pick exactly what you need:
#include "pythonicVars.hpp" // var, list, dict, set
#include "pythonicPrint.hpp" // print(), pprint()
#include "pythonicLoop.hpp" // range(), enumerate(), zip() + macros
#include "pythonicFunction.hpp" // map, filter, comprehensions
#include "pythonicFile.hpp" // File I/O
#include "pythonicMath.hpp" // Math functions (trig, logarithms, etc.)
using namespace pythonic::vars;
using namespace pythonic::print;
using namespace pythonic::loop;
using namespace pythonic::math;
using namespace pythonic::file;
using namespace pythonic::func;
using namespace pythonic::graph;
using namespace pythonic::fast;
using namespace pythonic::overflow;
using namespace pythonic::error;Caution:
If you import namespaces globally, be careful withstdand other namespaces—they might clash or cause ambiguity. We recommend usingstd::explicitly if you make thepythonicnamespace global.
pythonic::vars– Corevartype, containers, type conversionpythonic::print– Printing and formatting (print(),pprint())pythonic::loop– Iteration helpers (range(),enumerate(),zip(),reversed())pythonic::func– Functional programming (map(),filter(), comprehensions)pythonic::file– File I/Opythonic::math– Comprehensive math library (trig,logarithms,random, etc.)pythonic::graph– Graph data structure and algorithmspythonic::error– Exception hierarchy and error handlingpythonic::fast– Hot-loop optimizationspythonic::overflow– Checked arithmetic helpers
You can use them all at once with:
using namespace Pythonic;
// or
using namespace py;Note:
We highly recommend including the whole library at once, as many parts have dependencies on others (e.g., the math library depends onvar). If you try to use the math library without includingpythonicVar.hppand thevarnamespace, your code may not work as expected.