Crate pyprint

Crate pyprint 

Source
Expand description

§pyprint

A Rust library that provides Python-like print functionality with macros.

§Features

  • Python-style printing with customizable separators and line endings
  • Support for regular, debug, and error printing
  • Options for file redirection and flushing
  • Helpful macros to reduce boilerplate

§Version

1.0.1

§Examples

use pyprint::pprn;
use pyprint::dprn;
 
// Basic printing (like Python's print)
pprn!("Hello", "World");  // Prints: Hello World
 
// Customize separator and ending
pprn!("Hello", "World", sep=", ", end="!\n");  // Prints: Hello, World!
 
// Print with debug formatting
dprn!(vec![1, 2, 3]);  // Prints the vector with default formatting

Macros§

deprint
Prints to stderr in debug format.
deprn
Similar to deprint!, but unwraps the Result.
dprint
Prints values in debug format.
dprn
Similar to dprint!, but unwraps the Result.
eprint
Prints to stderr.
eprn
Similar to eprint!, but unwraps the Result.
match_variants
pprint
Prints values with a specified format, returning a Result.
pprn
Similar to pprint!, but unwraps the Result.

Structs§

Printer
The main printer struct used by the printing macros.

Functions§

last_printer_result
Returns the result of the last print operation.