Skip to content

Example of Pixi package and task management for C and Python

Notifications You must be signed in to change notification settings

liquidcarbon/pixi-examples-ctypes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ctypes example: large factorials

This examples calculates approximate factorials of large numbers using pure Python or Python with ctypes.

Features demonstrated:

  • packaging C and Python libraries together
  • compiling with gcc through Pixi tasks
  • conditional Pixi task execution (depends_on)
  • defining tasks with arguments

Output

$ pixi run factorial 12345678 python
2023-11-06@18:49:19.296216|INFO|__main__.<module>:50|calculating approximate factorial of 12345678 using pure Python...
2023-11-06@18:49:23.992089|INFO|__main__.<module>:61|12345678! ≈ 1.457260e82187904

$ pixi run factorial 12345678 ctypes
2023-11-06@18:49:29.404679|INFO|__main__.<module>:53|calculating factorial of 12345678 using ctypes...
2023-11-06@18:49:29.947188|INFO|__main__.<module>:61|12345678! ≈ 1.457260e82187904

About

Example of Pixi package and task management for C and Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published