Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8238425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:48:38+00:00 2026-06-07T19:48:38+00:00

I’ve raked through a lot of make for Python projects, but I can’t find

  • 0

I’ve raked through a lot of “make for Python” projects, but I can’t find any with the simplicity of a cake file. What I’m looking for is a Python equivalent that will let me:

  1. Keep the build commands in a single file in my project root
  2. Define each task as a simple function with a description that will automatically be displayed when the “make” file is run without arguments
  3. Import my Python modules

I’m picturing something like this:

from pymake import task, main

@task('reset_tables', 'Drop and recreate all MySQL tables')
def reset_tables():
    # ...

@task('build_stylus', 'Build the stylus files to public/css/*')
def build_stylus():
    from myproject import stylus_builder
    # ...

@task('build_cscript', 'Build the coffee-script files to public/js/*')
def build_cscript():
    # ...

@task('build', 'Build everything buildable')
def build():
    build_cscript()
    build_stylus()

# etc...

# Function that parses command line args etc...
main()

I’ve searched and searched but found nothing like it. If it doesn’t exist, I will make it myself and probably answer this question with it.

Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:48:40+00:00Added an answer on June 7, 2026 at 7:48 pm

    It’s not that hard to build a simple solution yourself:

    import sys
    
    tasks = {}
    def task (f):
        tasks[f.__name__] = f
        return f
    
    def showHelp ():
        print('Available tasks:')
        for name, task in tasks.items():
            print('  {0}: {1}'.format(name, task.__doc__))
    
    def main ():
        if len(sys.argv) < 2 or sys.argv[1] not in tasks:
            showHelp()
            return
    
        print('Executing task {0}.'.format(sys.argv[1]))
        tasks[sys.argv[1]]()
    

    And then a small sample:

    from pymake import task, main
    
    @task
    def print_foo():
        '''Prints foo'''
        print('foo')
    
    @task
    def print_hello_world():
        '''Prints hello world'''
        print('Hello World!')
    
    @task
    def print_both():
        '''Prints both'''
        print_foo()
        print_hello_world()
    
    if __name__ == '__main__':
        main()
    

    And what it looks like when used:

    > .\test.py
    Available tasks:
      print_hello_world: Prints hello world
      print_foo: Prints foo
      print_both: Prints both
    > .\test.py print_hello_world
    Executing task print_hello_world.
    Hello World!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.