Projects for a beginner?
Which projects should a beginner at Python start at, and then progress too? I don't have anything in mind right now, so I don't have a lot of ideas.
/r/Python
https://redd.it/7exjil
Which projects should a beginner at Python start at, and then progress too? I don't have anything in mind right now, so I don't have a lot of ideas.
/r/Python
https://redd.it/7exjil
reddit
Projects for a beginner? • r/Python
Which projects should a beginner at Python start at, and then progress too? I don't have anything in mind right now, so I don't have a lot of ideas.
Help serving static file sitemap.xml
Hello,
I am having issues serving my sitemap.xml file. It works on localhost:5000/sitemap.xml but not on the live domain. I am hosting this on a Linux server with Apache2
This is what I get on the live domain:
"Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and
try again."
This is my code:
import _mysql
from flask import Flask, request, jsonify, redirect,
url_for,render_template, send_from_directory,session,
abort,json,flash
import os
import prettyprint
import sys
reload(sys)
sys.setdefaultencoding('utf8')
PATH = os.path.dirname(os.path.abspath(__file__))
app=Flask("Locals",template_folder=os.path.join(PATH,
'templates'),static_folder='static')
@app.route('/sitemap.xml')
def static_from_root():
return send_from_directory(app.static_folder, request.path[1:])
@app.route("/", defaults={'state': None, 'city': None, 'keyword':
None})
@app.route("/<state>", defaults={'city': None, 'keyword': None})
@app.route("/<state>/<city>", defaults={'keyword': None})
@app.route("/<state>/<city>/<keyword>")
def index(state,city,keyword):
& at the bottom:
if __name__ == '__main__':
app.debug = True
app.run(host='0.0.0.0', port=5000)
/r/flask
https://redd.it/7erilu
Hello,
I am having issues serving my sitemap.xml file. It works on localhost:5000/sitemap.xml but not on the live domain. I am hosting this on a Linux server with Apache2
This is what I get on the live domain:
"Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and
try again."
This is my code:
import _mysql
from flask import Flask, request, jsonify, redirect,
url_for,render_template, send_from_directory,session,
abort,json,flash
import os
import prettyprint
import sys
reload(sys)
sys.setdefaultencoding('utf8')
PATH = os.path.dirname(os.path.abspath(__file__))
app=Flask("Locals",template_folder=os.path.join(PATH,
'templates'),static_folder='static')
@app.route('/sitemap.xml')
def static_from_root():
return send_from_directory(app.static_folder, request.path[1:])
@app.route("/", defaults={'state': None, 'city': None, 'keyword':
None})
@app.route("/<state>", defaults={'city': None, 'keyword': None})
@app.route("/<state>/<city>", defaults={'keyword': None})
@app.route("/<state>/<city>/<keyword>")
def index(state,city,keyword):
& at the bottom:
if __name__ == '__main__':
app.debug = True
app.run(host='0.0.0.0', port=5000)
/r/flask
https://redd.it/7erilu
reddit
Help serving static file sitemap.xml • r/flask
Hello, I am having issues serving my sitemap.xml file. It works on localhost:5000/sitemap.xml but not on the live domain. I am hosting this on a...
How to join two tables across DBs using Django ORM?
I want to perform the equivalent SQL query using django's ORM:
USE TRADING_DB;
SELECT NAME,
BUY_UNITS, BUY_NAV,
SELL_UNITS, SELL_NAV,PANDL
FROM
MUTUAL_FUND_POSITIONS
INNER JOIN MUTUAL_FUND_DB.MF_NAV_DATA AS NAV ON NAV.ISIN =
MUTUAL_FUND_POSITIONS.MF_ISIN
WHERE STATUS='OPEN' AND CLIENT_ID="Z712A";
Let's assume I have the following models:
class MutualFundPositions(models.Model):
pos_id = models.AutoField(db_column='POS_ID', primary_key=True)
client_id = models.CharField(db_column='CLIENT_ID', max_length=45)
mf_isin = models.CharField(db_column='MF_ISIN', max_length=100)
buy_units = models.DecimalField(db_column='BUY_UNITS',
max_digits=10, decimal_places=5)
buy_nav = models.DecimalField(db_column='BUY_NAV', max_digits=10,
decimal_places=5)
sell_units = models.DecimalField(db_column='SELL_UNITS',
max_digits=10, decimal_places=5)
sell_nav = models.DecimalField(db_column='SELL_NAV', max_digits=10,
decimal_places=5)
status = models.CharField(db_column='STATUS', max_length=45)
product = models.CharField(db_column='PRODUCT', max_length=45,
blank=True, null=True)
pandl = models.DecimalField(db_column='PANDL', max_digits=10,
decimal_places=2, blank=True, null=True)
class Meta:
managed = False
db_table = 'MUTUAL_FUND_POSITIONS'
class MfNavData(models.Model):
scheme_code = models.IntegerField(db_column='SCHEME_CODE')
isin = models.CharField(db_column='ISIN', primary_key=True,
max_length=45)
name = models.CharField(db_column='NAME', max_length=500)
class Meta:
managed = False
db_table = 'MF_NAV_DATA'
unique_together = (('isin', 'name'),)
How would I do that with Django's ORM? The idea is that I want a single query, using Django's ORM.
MutualFundPositions table is on TRADING_DB and MFNAVDATA is on MUTUAL_FUND_DB.
/r/django
https://redd.it/7eyvlm
I want to perform the equivalent SQL query using django's ORM:
USE TRADING_DB;
SELECT NAME,
BUY_UNITS, BUY_NAV,
SELL_UNITS, SELL_NAV,PANDL
FROM
MUTUAL_FUND_POSITIONS
INNER JOIN MUTUAL_FUND_DB.MF_NAV_DATA AS NAV ON NAV.ISIN =
MUTUAL_FUND_POSITIONS.MF_ISIN
WHERE STATUS='OPEN' AND CLIENT_ID="Z712A";
Let's assume I have the following models:
class MutualFundPositions(models.Model):
pos_id = models.AutoField(db_column='POS_ID', primary_key=True)
client_id = models.CharField(db_column='CLIENT_ID', max_length=45)
mf_isin = models.CharField(db_column='MF_ISIN', max_length=100)
buy_units = models.DecimalField(db_column='BUY_UNITS',
max_digits=10, decimal_places=5)
buy_nav = models.DecimalField(db_column='BUY_NAV', max_digits=10,
decimal_places=5)
sell_units = models.DecimalField(db_column='SELL_UNITS',
max_digits=10, decimal_places=5)
sell_nav = models.DecimalField(db_column='SELL_NAV', max_digits=10,
decimal_places=5)
status = models.CharField(db_column='STATUS', max_length=45)
product = models.CharField(db_column='PRODUCT', max_length=45,
blank=True, null=True)
pandl = models.DecimalField(db_column='PANDL', max_digits=10,
decimal_places=2, blank=True, null=True)
class Meta:
managed = False
db_table = 'MUTUAL_FUND_POSITIONS'
class MfNavData(models.Model):
scheme_code = models.IntegerField(db_column='SCHEME_CODE')
isin = models.CharField(db_column='ISIN', primary_key=True,
max_length=45)
name = models.CharField(db_column='NAME', max_length=500)
class Meta:
managed = False
db_table = 'MF_NAV_DATA'
unique_together = (('isin', 'name'),)
How would I do that with Django's ORM? The idea is that I want a single query, using Django's ORM.
MutualFundPositions table is on TRADING_DB and MFNAVDATA is on MUTUAL_FUND_DB.
/r/django
https://redd.it/7eyvlm
reddit
How to join two tables across DBs using Django ORM? • r/django
I want to perform the equivalent SQL query using django's ORM: USE TRADING_DB; SELECT NAME, BUY_UNITS, BUY_NAV, SELL_UNITS,...
CardIO - a rich python library for heart signals
https://medium.com/data-analysis-center/cardio-framework-for-deep-research-of-electrocardiograms-2a38a0673b8e
/r/Python
https://redd.it/7exmkn
https://medium.com/data-analysis-center/cardio-framework-for-deep-research-of-electrocardiograms-2a38a0673b8e
/r/Python
https://redd.it/7exmkn
Medium
CardIO framework for deep research of electrocardiograms
This article introduces a framework that allows to build end-to-end machine learning models for deep research of electrocardiograms and…
How do I make something actively run in the background?
Hi everyone. Currently I'm doing a project that is essentialy a web-browser game like the ones that used to be popular 10 years ago. It's going to be RPG-like thingy.
Each player has their own character with individual statistics. Those characters are stored as an extension of `User` model with use of `OneToOneField`. They have variety of stats like HP, max HP, EXP, EXP till next level, level, etc.
Everything so far is fine, but let's say a character is below max hp and his health regenerates over time. How do I do that? I mean, how do I make that something actively updates in the database? Same would go for experience and levelling up. How do I do that? Do I make some kind of Python script that would take care of it? Or is there some Django feature that helps handle those cases?
The only place where I can think of that handles different actions is views, but I can't imagine how I would put something there to run in the background since each view has to be rendered by request.
/r/djangolearning
https://redd.it/7eubgk
Hi everyone. Currently I'm doing a project that is essentialy a web-browser game like the ones that used to be popular 10 years ago. It's going to be RPG-like thingy.
Each player has their own character with individual statistics. Those characters are stored as an extension of `User` model with use of `OneToOneField`. They have variety of stats like HP, max HP, EXP, EXP till next level, level, etc.
Everything so far is fine, but let's say a character is below max hp and his health regenerates over time. How do I do that? I mean, how do I make that something actively updates in the database? Same would go for experience and levelling up. How do I do that? Do I make some kind of Python script that would take care of it? Or is there some Django feature that helps handle those cases?
The only place where I can think of that handles different actions is views, but I can't imagine how I would put something there to run in the background since each view has to be rendered by request.
/r/djangolearning
https://redd.it/7eubgk
reddit
How do I make something actively run in the... • r/djangolearning
Hi everyone. Currently I'm doing a project that is essentialy a web-browser game like the ones that used to be popular 10 years ago. It's going to...
Introducing CalPack - a python module to make it easy creating and parsing custom packets
https://github.com/KronoSKoderS/CalPack
/r/Python
https://redd.it/7eyyyc
https://github.com/KronoSKoderS/CalPack
/r/Python
https://redd.it/7eyyyc
GitHub
KronoSKoderS/CalPack
CalPack - Packets in Python Simplified
Celery subqueues? (implementing sequential message delivery)
Hey there!
I'm trying to implement a sort of chatbot system, and I need to have my celery tasks processed sequentially per user. That means each user needs to have their messages sent as FIFO, but the users need to be processed randomly or in round-robin.
I've been reading about task chains, groups and trees, but all of these celery features seem to require providing all tasks at once, whereas I need to add tasks dynamically.
My reasoning was to have a dedicated queue per user, and enable concurrency on the worker. That way I could assure the delivery order and avoid one user blocking the rest of the chats.
Is there a way I can route tasks in Celery so I get the desired behavior? Ideally, I'd set up a worker to process the `messages` queue, and then route tasks to something like `messages.contact.<contact_id>` as they arrive.
thanks, and happy Thanksgiving to all of you in the US!
/r/Python
https://redd.it/7ezap7
Hey there!
I'm trying to implement a sort of chatbot system, and I need to have my celery tasks processed sequentially per user. That means each user needs to have their messages sent as FIFO, but the users need to be processed randomly or in round-robin.
I've been reading about task chains, groups and trees, but all of these celery features seem to require providing all tasks at once, whereas I need to add tasks dynamically.
My reasoning was to have a dedicated queue per user, and enable concurrency on the worker. That way I could assure the delivery order and avoid one user blocking the rest of the chats.
Is there a way I can route tasks in Celery so I get the desired behavior? Ideally, I'd set up a worker to process the `messages` queue, and then route tasks to something like `messages.contact.<contact_id>` as they arrive.
thanks, and happy Thanksgiving to all of you in the US!
/r/Python
https://redd.it/7ezap7
reddit
Celery subqueues? (implementing sequential message... • r/Python
Hey there! I'm trying to implement a sort of chatbot system, and I need to have my celery tasks processed sequentially per user. That means each...
Django Rest Serializer or Model property.
When i need a custom field at REST API. I can use `serializers.SerializerMethodField` but Model property does the same.
Can you tell me which better or when we using each of them?
/r/django
https://redd.it/7exzfg
When i need a custom field at REST API. I can use `serializers.SerializerMethodField` but Model property does the same.
Can you tell me which better or when we using each of them?
/r/django
https://redd.it/7exzfg
reddit
Django Rest Serializer or Model property. • r/django
When i need a custom field at REST API. I can use `serializers.SerializerMethodField` but Model property does the same. Can you tell me which...
Download all episodes from https://talkpython.fm/episodes/all
Hey guys, i wrote this little script to easily download all the episodes of this amazing podcast
I hope it can be useful to some of you, obviously feel free to give me feedback on it
https://github.com/cece95/TalkPythonDownload/tree/master
/r/Python
https://redd.it/7ezttz
Hey guys, i wrote this little script to easily download all the episodes of this amazing podcast
I hope it can be useful to some of you, obviously feel free to give me feedback on it
https://github.com/cece95/TalkPythonDownload/tree/master
/r/Python
https://redd.it/7ezttz
talkpython.fm
Episodes - Talk Python To Me Podcast
Browse the Talk Python To Me podcast archive: 526+ episodes featuring Python tutorials, interviews, and expert insights on tools, libraries, and projects.
State of Version Control System of Python modules: 32.95% no link to VCS found
https://szabgab.com/state-of-version-control-in-python-modules.html
/r/Python
https://redd.it/7f02nh
https://szabgab.com/state-of-version-control-in-python-modules.html
/r/Python
https://redd.it/7f02nh
Python developers, what first got you into Python and where are you now?
/r/Python
https://redd.it/7ey8wb
/r/Python
https://redd.it/7ey8wb
reddit
Python developers, what first got you into Python and... • r/Python
16 points and 20 comments so far on reddit
Anyone can do a layman's guide to accessing a jupyter remotely from another computer?
do explain in simple terms!
/r/IPython
https://redd.it/7ezpe8
do explain in simple terms!
/r/IPython
https://redd.it/7ezpe8
reddit
Anyone can do a layman's guide to accessing a jupyter... • r/IPython
do explain in simple terms!
[Research] [Project] Leela Zero: a community open source project for machine learning in Go software. Call for help!
For all machine learning and AI enthusiasts, there is a great chance to take part to a project which is going to be a milestone in the history of Go software.
What can you do? You can offer your machine time and run a tiny self-playing software generating new games and data to be used for training Leela Zero and make it stronger and stronger.
We need your help! We need everyone's help in order to speed up the training process. Be part of a great open source and community driven project and let's all make history!
Please visit the links below to know more. Thank you.
https://github.com/gcp/leela-zero
http://zero.sjeng.org/
https://www.reddit.com/r/cbaduk/
General information about Go game: https://en.wikipedia.org/wiki/Go_(game)
General information about Go computing and software: https://en.wikipedia.org/wiki/Computer_Go
/r/MachineLearning
https://redd.it/7ezd1q
For all machine learning and AI enthusiasts, there is a great chance to take part to a project which is going to be a milestone in the history of Go software.
What can you do? You can offer your machine time and run a tiny self-playing software generating new games and data to be used for training Leela Zero and make it stronger and stronger.
We need your help! We need everyone's help in order to speed up the training process. Be part of a great open source and community driven project and let's all make history!
Please visit the links below to know more. Thank you.
https://github.com/gcp/leela-zero
http://zero.sjeng.org/
https://www.reddit.com/r/cbaduk/
General information about Go game: https://en.wikipedia.org/wiki/Go_(game)
General information about Go computing and software: https://en.wikipedia.org/wiki/Computer_Go
/r/MachineLearning
https://redd.it/7ezd1q
GitHub
GitHub - leela-zero/leela-zero: Go engine with no human-provided knowledge, modeled after the AlphaGo Zero paper.
Go engine with no human-provided knowledge, modeled after the AlphaGo Zero paper. - leela-zero/leela-zero
Overview of a Manhattan project's structure (Manhattan is a flask based web framework / CMS)
https://youtu.be/UOdbkQ2Gq5w
/r/flask
https://redd.it/7eytl3
https://youtu.be/UOdbkQ2Gq5w
/r/flask
https://redd.it/7eytl3
YouTube
A short overview of a Manhattan project's structure
Following on from my initial UI preview video (https://youtu.be/p8oAct-RW_0), in this video I try to give some insights into the underlying structure of the ...
Have any of you made money/have a passive income by automating a process with python?
/r/Python
https://redd.it/7f52lf
/r/Python
https://redd.it/7f52lf
reddit
Have any of you made money/have a passive income by... • r/Python
9 points and 4 comments so far on reddit
Does anyone have an example of a navbar with search?
I want to see how you did your routing.
/r/flask
https://redd.it/7ezjks
I want to see how you did your routing.
/r/flask
https://redd.it/7ezjks
reddit
Does anyone have an example of a navbar with search? • r/flask
I want to see how you did your routing.
A simple fire detector written with python
https://www.codemade.io/fire-detection-with-computer-vision/
/r/Python
https://redd.it/7f2bnj
https://www.codemade.io/fire-detection-with-computer-vision/
/r/Python
https://redd.it/7f2bnj
Converting HTML tags to custom code
For example i have following HTML code:
<p>Check our new website </p>
<p>at www.example.com and convert </p>
<p>more than this. </p>
<p> </p>
<p align='center'><b>Tester </b></p>
Now the old system is using some weird way of handling text to print and instead of HTML tags it uses word combination so the text should look like:
NLCheck our new website
NLat www.example.com and convert
NLmore than this.
NL
BCTester
So basically it uses combination of word for example NL(Normal Left), BC(Bold Center) so total of 6 combinations (NL,BL,NR,BR,NC,BC). What way would i take to convert this, is there any lib to parse the html tags and check their attributes or what way to choose?
/r/Python
https://redd.it/7f76ns
For example i have following HTML code:
<p>Check our new website </p>
<p>at www.example.com and convert </p>
<p>more than this. </p>
<p> </p>
<p align='center'><b>Tester </b></p>
Now the old system is using some weird way of handling text to print and instead of HTML tags it uses word combination so the text should look like:
NLCheck our new website
NLat www.example.com and convert
NLmore than this.
NL
BCTester
So basically it uses combination of word for example NL(Normal Left), BC(Bold Center) so total of 6 combinations (NL,BL,NR,BR,NC,BC). What way would i take to convert this, is there any lib to parse the html tags and check their attributes or what way to choose?
/r/Python
https://redd.it/7f76ns
reddit
Converting HTML tags to custom code • r/Python
For example i have following HTML code: Check our new website at www.example.com and convert more than this. ...