# PyConstructor **Repository Path**: Jimmy_Huang/PyConstructor ## Basic Information - **Project Name**: PyConstructor - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-05-23 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Constructor for C/C++. ## How to use? New a file into your project. Its name have no limitation. Run that file, `$ python my_constructor.py` You will see some like the following: ``` $ python my_constructor.py -- Project name: UnnamedProject -- Script's base dir: E:\gvim\vimfiles\myplug\constructor -- Current operating system: windows -- Added 'E:/gvim/vimfiles/myplug/constructor/main.c' to target 'haha' -- Added 'E:/gvim/vimfiles/myplug/constructor/test.h' to target 'haha' -- Building 'haha' ``` ### Samples ```python +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ from PyConstructor import * # new a project, have no name, so it will use default name. hello_world = Project() # new an object, you can not run it for now, so you have to link it. target_haha = hello_world.AddTarget('haha').SetRules(['-g', '-Wall', '-O2']).AddSrc('./main.c').AddSrc('./test.h') # compile all targets and link them. This will output a executable file. hello_world.Build() ``` ```python +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ from PyConstructor import * # new a project, have no name, so it will use default name. hello_world = Project('project_name') # get compiler support. a_c_compiler = C_Compiler() # compile a object, this will output a '.o' file. So you also have to link it. hello_world.AddTarget('name_is_needed').SetRules(['-g', '-Wall', '-O2']).AddSrc('./main.c').Compile(a_c_compiler) ```