Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

poetry python install

# Install Poetry Python using this command the others are deprecated
curl -sSL https://install.python-poetry.org/ | python3
Comment

poetry python

# install
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
# setup
poetry new <name> # new project
poetry init # existign project
poetry install
# requirements.txt
poetry add `cat requirements.txt`
poetry export --output requirements.txt
# venv
poetry run python your_script.py # single script
poetry shell # venv sub shell
# dependencies
poetry show --tree
poetry add <name>
poetry remove <name>
poetry update
# build and publish
poetry build
poetry config http-basic.pypi username password
poetry publish
Comment

python poetry

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
Comment

python poetry

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -
Comment

how to run python with poetry

from flask import Flask
from flask_mysqldb import MySQL

app = Flask(__name__)

# Required
app.config["MYSQL_USER"] = "user"
app.config["MYSQL_PASSWORD"] = "password"
app.config["MYSQL_DB"] = "database"
# Extra configs, optional:
app.config["MYSQL_CURSORCLASS"] = "DictCursor"
app.config["MYSQL_CUSTOM_OPTIONS"] = {"ssl": {"ca": "/path/to/ca-file"}}  # https://mysqlclient.readthedocs.io/user_guide.html#functions-and-attributes

mysql = MySQL(app)

@app.route("/")
def users():
    cur = mysql.connection.cursor()
    cur.execute("""SELECT user, host FROM mysql.user""")
    rv = cur.fetchall()
    return str(rv)

if __name__ == "__main__":
    app.run(debug=True)
Comment

how to run python with poetry

pip install flask-mysqldb
Comment

poetry python

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
Comment

PREVIOUS NEXT
Code Example
Python :: django reverse vs reverse_lazy 
Python :: django button 
Python :: Implement a binary search of a sorted array of integers Using pseudo-code. 
Python :: check if value is in series pandas 
Python :: get_permissions 
Python :: list peek python 
Python :: python count the vowels 
Python :: numpy insert 
Python :: removing stop words from the text 
Python :: python power of e 
Python :: palindrome of a number in python 
Python :: sum up list python 
Python :: os module in python 
Python :: python print in the same line 
Python :: convert time python 
Python :: python script to write dataframe on excel 
Python :: python alphanum 
Python :: color reverse 
Python :: dataframe change index 
Python :: merge sort function 
Python :: regex python 
Python :: python test framework 
Python :: principal component analysis (pca) 
Python :: pandas dummy classification data 
Python :: all string methods in python 
Python :: how to remove a string in python 
Python :: python logical operators code 
Python :: sum python 
Python :: python pandas merge dataframe 
Python :: how to create templates in python 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =