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 712603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:51:59+00:00 2026-05-14T04:51:59+00:00

What are some best practices to keep in mind when developing a script program

  • 0

What are some best practices to keep in mind when developing a script program that could be integrated with a GUI, probably by somebody else, in the future?

Possible scenario:

  1. I develop a fancy python CLI program that scrapes every unicorn images from the web
  2. I decide to publish it on github
  3. A unicorn fan programmer decides to take the sources and build a GUI on them
  4. he/she gives up because my code is not reusable

How to prevent the step four letting the unicorn fan programmer build his/her GUI without too much hassle?

  • 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-05-14T04:52:00+00:00Added an answer on May 14, 2026 at 4:52 am

    You do it by applying a good portion of layering (maybe implementing the MVP pattern) and treating your CLI as a UI in it’s own right.

    UPDATE

    This text from the wikipedia article about the Model-View-Presenter pattern explains it quite well.

    Model-view-presenter (MVP) is a user
    interface design pattern engineered to
    facilitate automated unit testing and
    improve the separation of concerns in
    presentation logic.

    • The model is an interface defining the data to be displayed or
      otherwise acted upon in the user
      interface.

    • The view is an interface that displays data (the model) and routes
      user commands (events) to the
      presenter to act upon that data.

    • The presenter acts upon the model and the view. It retrieves data
      from repositories (the model),
      persists it, and formats it for
      display in the view.

    The main point being that you need to work on separation of concern in your application.
    Your CLI would be one implementation of a view, whereas the unicorn fan would implement another view for a rich client. The unicorn fan, would base his view on the same presenters as your CLI. If those presenters are not sufficient for his rich client he could easily add more, because each presenter is based on data from the model. The model, in turn, is where all the core logic of your application is based. Designing a good model is an entire subject in itself. You may be interested in reading, for example, about Domain-Driven Design, even though I don’t know how well it applies to your current application. But it’s interesting reading anyway.
    As you can see, the wikipedia article on MVP also talks about testability, which is also crucial if you want to provide a robust framework for others to build on. To reach a high level of testability in your code-base, it is often a good idea to use some kind of Dependency Injection framework.

    I hope this gives you a general idea of the techniques you need to employ, although I understand that it may be a little overwhelming. Don’t hesitate to ask if you have any further doubts.

    /Klaus

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What are some best practices to keep in mind when working extensively with SQLite
I'm trying to adopt some best practices to keep my python code efficient. I've
What are some best practices to orchestrate the interaction between complex components that are
I'm looking to hear some best practices... Assuming a web application that interacts with
What are the best practices for building a GUI desktop app that will support
I'm looking for some Best Practices for automating the deployment of Stored Procedures/Views/Functions/Table changes
What are some best practices on enabling a web application to support multiple resolutions?
Can anyone recommend some best-practices on how to tackle the problem of starting to
I was wondering about some best practices for data binding in web forms. For
I have searched this topic on google a bit and seen some best practices.

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.