Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cbcf89d
Update README.md
CursedPrograms Feb 4, 2024
700ea3a
...
CursedPrograms Feb 6, 2024
9e504cd
...
CursedPrograms Feb 6, 2024
91ddaf8
...
CursedPrograms Feb 8, 2024
28bb63e
...
CursedPrograms Feb 8, 2024
9f2b175
...
CursedPrograms Feb 8, 2024
247f959
...
CursedPrograms Feb 9, 2024
e8362c6
Update README.md
CursedPrograms Feb 11, 2024
7bfc61b
Update .gitattributes
CursedPrograms Feb 15, 2024
83ae132
Delete config.ini
CursedPrograms Feb 15, 2024
b2d68fc
Delete config.xml
CursedPrograms Feb 15, 2024
544ba0a
Add files via upload
CursedPrograms Oct 3, 2024
1f8d0d3
Add files via upload
CursedPrograms Oct 5, 2024
f8a03fa
Update README.md
CursedPrograms Oct 9, 2024
beffa08
Update README.md
CursedPrograms Oct 9, 2024
9f7d53d
Update README.md
CursedPrograms Oct 9, 2024
8c08c81
Add files via upload
CursedPrograms Oct 10, 2024
c4a2fd0
Add files via upload
CursedPrograms Oct 10, 2024
cb7d3d1
Update and rename stup.ps1 to setup.ps1
CursedPrograms Oct 14, 2024
9a62525
Update README.md
CursedPrograms Oct 14, 2024
e33e7dd
Update README.md
CursedPrograms Oct 14, 2024
6eef8b3
Update README.md
CursedPrograms Oct 20, 2024
ed11acc
Add files via upload
CursedPrograms Oct 20, 2024
0ad4e35
Update README.md
CursedPrograms Oct 20, 2024
e7a2b89
Update run.ps1
CursedPrograms Oct 20, 2024
9990245
Update README.md
CursedPrograms Oct 20, 2024
6485ece
Update README.md
CursedPrograms Oct 20, 2024
26a519e
Update README.md
CursedPrograms Oct 20, 2024
2f6c3e0
Update README.md
CursedPrograms Oct 20, 2024
f8960aa
Update README.md
CursedPrograms Oct 20, 2024
2095886
...
CursedPrograms Oct 20, 2024
3f8e20a
Add files via upload
CursedPrograms Apr 14, 2025
d767d51
Add files via upload
CursedPrograms May 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
*.md linguist-vendored=false
*.md linguist-generated=false
*.md linguist-documentation=false
*.md linguist-detectable=true

*.json linguist-vendored=false
*.json linguist-generated=false
*.json linguist-documentation=false
*.json linguist-detectable=true

*.yml linguist-vendored=false
*.yml linguist-generated=false
*.yml linguist-documentation=false
*.yml linguist-detectable=true

*.ini linguist-vendored=false
*.ini linguist-generated=false
*.ini linguist-documentation=false
*.ini linguist-detectable=true

*.txt linguist-vendored=false
*.txt linguist-generated=false
*.txt linguist-documentation=false
*.txt linguist-detectable=true

*.xml linguist-vendored=false
*.xml linguist-generated=false
*.xml linguist-documentation=false
*.xml linguist-detectable=true
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
custom: [ buymeacoffee.com/cursedentertainment, ko-fi.com/cursedentertainment ]
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
64 changes: 60 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,76 @@
[![Twitter: @NorowaretaGemu](https://img.shields.io/badge/X-@NorowaretaGemu-blue.svg?style=flat)](https://x.com/NorowaretaGemu)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

<br>
<div align="center">
<a href="https://ko-fi.com/cursedentertainment">
<img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="ko-fi" style="width: 20%;"/>
</a>
</div>
<br>

<div align="center">
<img alt="Python" src="https://img.shields.io/badge/python%20-%23323330.svg?&style=for-the-badge&logo=python&logoColor=white"/>
</div>
<div align="center">
<img alt="Git" src="https://img.shields.io/badge/git%20-%23323330.svg?&style=for-the-badge&logo=git&logoColor=white"/>
<img alt="PowerShell" src="https://img.shields.io/badge/PowerShell-%23323330.svg?&style=for-the-badge&logo=powershell&logoColor=white"/>
<img alt="Shell" src="https://img.shields.io/badge/Shell-%23323330.svg?&style=for-the-badge&logo=gnu-bash&logoColor=white"/>
<img alt="Batch" src="https://img.shields.io/badge/Batch-%23323330.svg?&style=for-the-badge&logo=windows&logoColor=white"/>
</div>
<br>

# Python-Template

## How to Run:

# Cursed-Python-Template
### Install Requirements

Using Python directly:

```bash
pip install -r requirements.txt
```
To make the setup script executable, run the following command in your terminal:
Or run:
- `install_requirements.bat`


<br>

### Run main.py

Using Python directly:

```bash
python main.py
```

Using provided scripts:

Windows:
- `.\run.bat`
or
- `.\run.ps1`

Unix-like systems (Linux/macOS):
- `.\run.sh`

<br>

## Requirements:

```bash
chmod +x setup.sh

```

<br>
<div align="center">
© Cursed Entertainment 202*
</div>
<br>
<div align="center">
<a href="https://cursed-entertainment.itch.io/" target="_blank">
<img src="https://github.com/CursedPrograms/cursedentertainment/raw/main/images/logos/logo-wide-grey.png"
alt="CursedEntertainment Logo">
alt="CursedEntertainment Logo" style="width:250px;">
</a>
</div>
File renamed without changes.
18 changes: 18 additions & 0 deletions clear-commits.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off
REM Switch to a new orphan branch
git checkout --orphan new_branch

REM Stage all changes
git add .

REM Commit changes
git commit -m "new_commit"

REM Delete the old main branch
git branch -D main

REM Rename the new branch to main
git branch -m main

REM Force push to the remote main branch
git push -f origin main
17 changes: 17 additions & 0 deletions clear-commits.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Switch to a new orphan branch
git checkout --orphan new_branch

# Stage all changes
git add .

# Commit changes
git commit -m "new_commit"

# Delete the old main branch
git branch -D main

# Rename the new branch to main
git branch -m main

# Force push to the remote main branch
git push -f origin main
28 changes: 28 additions & 0 deletions clear-commits.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import subprocess

def run_command(command):
"""Run a command in the shell and print the output."""
try:
result = subprocess.run(command, check=True, text=True, capture_output=True)
print(result.stdout)
except subprocess.CalledProcessError as e:
print(f"Error: {e.stderr}")
exit(1)

# Switch to a new orphan branch
run_command(["git", "checkout", "--orphan", "new_branch"])

# Stage all changes
run_command(["git", "add", "."])

# Commit changes
run_command(["git", "commit", "-m", "new_commit"])

# Delete the old main branch
run_command(["git", "branch", "-D", "main"])

# Rename the new branch to main
run_command(["git", "branch", "-m", "main"])

# Force push to the remote main branch
run_command(["git", "push", "-f", "origin", "main"])
19 changes: 19 additions & 0 deletions clear-commits.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Switch to a new orphan branch
git checkout --orphan new_branch

# Stage all changes
git add .

# Commit changes
git commit -m "new_commit"

# Delete the old main branch
git branch -D main

# Rename the new branch to main
git branch -m main

# Force push to the remote main branch
git push -f origin main
12 changes: 11 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"Config": {
"AppName": "TemplateProject",
"Description": "",
"ProjectStructure": {
"MainScript": "main.py",
"DependenciesScript": "scripts/install-dependencies.py"
},
"Scripts": {

}
}
}
}
1 change: 0 additions & 1 deletion config.xml

This file was deleted.

3 changes: 3 additions & 0 deletions install_requirements.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
pip install -r requirements.txt
pause
14 changes: 11 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import os
import subprocess
import json

def main():
print("Python Project")
with open('config.json') as json_file:
config_data = json.load(json_file)

# Get the project name from the JSON data
app_name = config_data.get('Config', {}).get('AppName', 'default_app')

# Print the actual app name value
print(app_name)

scripts = {
"1": {
Expand All @@ -16,9 +24,9 @@ def main():
"file_name": "scripts/script01.py"
},
"00": {
"name": "Run 'Install Dependencies'",
"name": "Run 'install_dependencies.py'",
"description": "Install dependencies",
"file_name": "scripts/install-dependencies.py"
"file_name": "scripts/install_dependencies.py"
},
}

Expand Down
15 changes: 15 additions & 0 deletions run.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Define the virtual environment directory
$VENV_DIR = "psdenv"

# Check if the virtual environment directory exists
if (-Not (Test-Path $VENV_DIR)) {
# Create the virtual environment
python -m venv $VENV_DIR
}

# Activate the virtual environment and run the Python script
& "$VENV_DIR\Scripts\Activate.ps1"
python main.py

# Pause for user input before closing (optional)
Read-Host "Press Enter to continue..."
16 changes: 16 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

VENV_DIR="psdenv"

# Check if the virtual environment directory exists
if [ ! -d "$VENV_DIR" ]; then
# Create the virtual environment
python -m venv "$VENV_DIR"
fi

# Activate the virtual environment and run the Python script
source "$VENV_DIR/bin/activate"
python main.py

# Pause for user input before closing (optional)
read -p "Press Enter to continue..."
Empty file added scripts/__init__.py
Empty file.
File renamed without changes.
Empty file added settings.json
Empty file.
6 changes: 6 additions & 0 deletions setup.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Create a Python virtual environment
python -m venv psdenv

# Activate the virtual environment and run the Python script
& ".\psdenv\Scripts\Activate.ps1"
python main.py