Pfcreator is a handy tool built with Rust and Zig that simplifies the creation of lab practical records. It automates the process of compiling code, running it, and neatly organizing the results into a .docx file. You can customize the look of your record using a straightforward format.toml configuration file.
Note
Pfcreator currently supports .cpp, .py, and .java.
- Automatically runs your
.cppor.pycode files. - Creates a well-structured
.docxpractical record. - Lets you customize the formatting with a
format.tomlfile. - Uses a
questions.txtfile to organize your practical questions.
- Run the installer via
curl -fsSL https://raw.githubusercontent.com/UndiedGamer/pfcreator/refs/heads/main/install.sh | sh- Source your shell profile (
.bashrc,.zshrc, etc.) or create a new terminal instance to use thepfcreatorcommand.
- Enable Windows Subsystem for Linux (WSL).
- Open Ubuntu or your distro of choice in Windows Terminal or from Start Menu.
- Follow Linux steps.
Important
WSL ships with gcc/g++ but it does not ship with python, you might have to install python inside WSL.
- Code Files: Put all your
.cpp,.py, or.javafiles into a single folder.
Important
Pfcreator works with one file type at a time (.cpp, .py, or .java), not multiple types simultaneously.
-
questions.txt: In the same folder, create a file namedquestions.txt. Write each practical question, followed by a line of---to separate them. Like this:Question 1::file1.java --- Question 2::file2.java --- Question 3::file3.java -
format.toml: Also in the same folder, create aformat.tomlfile to define how your record should look. Here's an example:[header] size = 14 # Font size (optional, default is 12) bold = true # Bold text (optional, default is false) text = "Task {n}" # {n} will be the question number align = "center" # Text alignment (optional, default is left) [question] size = 17 bold = true text = "Q) {question}" # {question} will be taken from questions.txt [solution] size = 12 text = "{solution}" # {solution} will be your code [solution.title] size = 14 bold = true underline = true text = "Code:" [output] size = 12 text = "{output}" # {output} will be the program's output [output.title] size = 14 bold = true underline = true text = "Output:" # Optional footer [footer] size = 10 text = "Made by Hemanth" align = "right"
-
Open your terminal and go to the folder with your files.
-
Run this command:
pfcreator [color] <file_extension> <folder_path>
[color]is optional - enables colored output in the terminal.- Replace
<file_extension>withcpp,py, orjava(depending on your code files). - Replace
<folder_path>with the path to your folder.
For example:
pfcreator cpp my_cpp_practical
or
pfcreator py my_python_practical
or
pfcreator java my_java_practical
or with colored output:
pfcreator color cpp my_cpp_practical
Your .docx practical record will be created inside the folder you specified (my_cpp_practical, my_python_practical, or my_java_practical in the examples).
These are special tags in your format.toml that Pfcreator replaces:
{n}: The question number.{question}: The question fromquestions.txt.{solution}: Your code.{output}: The output of your code.
Note to self: add windows deprecation in future section here