Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start pyscaffold(python) project?

Tags:

python-3.x

How to start the pyscaffold project? I use this command to create the project putup sampleProject but i don't know how to start this project?

like image 882
ranjith Avatar asked Jan 19 '26 04:01

ranjith


1 Answers

You don't start a pyscaffold project per say -- Its goal is simply to create the files and folder that you will commonly need for your project. See my structure below from "putup MyTestProject". Look at all the nice stuff already created that you now don't have to do by hand.

To get started, you need to start adding packages/code to "..src/mytestproject" and run that code like you normally would.

Might I recommend for you the use of a good IDEA, such as pycharm? I think you will find it makes starting your journey much easier.

A second recommendation -- if you are just getting started, you might skip pyscaffold for now. While a great tool, it might add confusion that you don't need right now.

MyTestProject/
├── AUTHORS.rst
├── CHANGELOG.rst
├── docs
│   ├── authors.rst
│   ├── changelog.rst
│   ├── conf.py
│   ├── index.rst
│   ├── license.rst
│   ├── Makefile
│   └── _static
├── LICENSE.txt
├── README.rst
├── requirements.txt
├── setup.cfg
├── setup.py
├── src
│   └── mytestproject
│       ├── __init__.py
│       └── skeleton.py
└── tests
    ├── conftest.py
    └── test_skeleton.py

[Edit]

With respect to why "python skeleton.py" gives an output, the library is simply providing an example to show the user where to start adding code, and how the code relates to the tests (test_skeleton.py). The intent is that skeleton.py will be erased and replaced with your code structure. This may be some python.py files or packages and sub packages with python.py files. Read it this way; "Your Code goes here ... and here is an arbitrary example to get you started."

But you have to ask yourself what you are trying to accomplish? If you are just creating a few scripts for yourself -- for nobody else in the world to see, do you need the additional stuff (docs, setup, licensing, etc?) If the answer is no - don't use pyscaffold, just create your scripts in a venv and be on your way. This scaffolding is meant to give you most of what you need to create a full, github worthy, project to potentially share with the world. Based on what I gather your python experience to be, I don't think you want to use pyscaffold.

But specific to your question. Were I starting with pyscaffold, I would erase skeleton.py, replace it with "mytester.py", use the begins library to parse my incoming command arguments, then write individual methods to respond to my command line calls.

like image 153
SteveJ Avatar answered Jan 22 '26 01:01

SteveJ