Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
PERL or PYTHON, or something else you can recommend for this ...?

I've got a text file that I need to parse and break up.

​

I'm already familiar with PERL but that has no windows interface I think, just command line. PERL is great at parsing and breaking down lines of text.

Is Python equally as good? I am thinking of Python because I want the user to use windows file explorer to search for a file to parse.

Or can you recommend something else other than Perl or Python for this simple task ?

​

/r/Python
https://redd.it/ay349t
#djangotip make orm long lines beautiful

/r/django
https://redd.it/ay1k09
How to set up your Python project for success with tests, CI, and code coverage

Just published a step-by-step guide to set up your Python package with pytest, TravisCI, Coveralls and PyUp. Hope you find it helpful!

[https://towardsdatascience.com/10-steps-to-set-up-your-python-project-for-success-14ff88b5d13?source=friends\_link&sk=df8634c99b3e5c6d9fa96b51aba1a4cd](https://towardsdatascience.com/10-steps-to-set-up-your-python-project-for-success-14ff88b5d13?source=friends_link&sk=df8634c99b3e5c6d9fa96b51aba1a4cd)

Feedback appreciated :)

​

​

/r/Python
https://redd.it/ay69qr
Python script to Jupyter notebook

Just published a Python package on PyPI called **p2j**. Run

`pip install p2j`

and

`p2j script.py`

to get a Jupyter notebook script.ipynb. Example shown below:

​

PyPI: [https://pypi.org/project/p2j/](https://pypi.org/project/p2j/)

GitHub: [https://github.com/raibosome/python2jupyter](https://github.com/raibosome/python2jupyter)

​

PRs and feedback are greatly appreciated!

[Converting Python script to Jupyter notebook using a Python package](https://i.redd.it/3nmbjeo2omk21.jpg)

/r/JupyterNotebooks
https://redd.it/ay8rxd
How to create toggle buttons for input cells in html output?

Using rmarkdown, one can create html output like this [example](https://murray-cecile.github.io/labor-market-trends/). I've seen some hacky ways to do this some months ago with jupyter notebooks. Is there an easy way to do this now?

/r/JupyterNotebooks
https://redd.it/aybj4e
Learning flask, but stuck on wtforms

(tldr below)I'm an entry level front-end dev trying to understand what happens with the data after I send it from forms. So I've been learning flask, from Miguel Grinberg's The Flask Mega-Tutorial which is great so far but I've hit a roadblock at chapter 3: web forms.

My problem is:

Pretend I work as a front-end dev for a company. I'll make the HTML or possibly react, and pass the file(s) to the back-end dev. If they use flask, and want the csrf protection and validation from wtforms, they have to re-write all the forms using wtforms.

tl;dr: front-end dev writes page in html(or react), passes files to back-end dev who has to re-write in wtforms. Seems like wasted time.

/r/flask
https://redd.it/aybuv3
[N] Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning

Hi,

Coursera released new course with focus on Tensorflow and its best practices and I thought some of you may find it useful. I realise most of you guys are experienced engineers or researchers and already settled for PyTorch or Tensorflow or know both, however every time "PyTorch vs. Tensorflow" post pops up, there are some people unsure where to start with TF.

[https://www.coursera.org/learn/introduction-tensorflow](https://www.coursera.org/learn/introduction-tensorflow)

​

>If you are a software developer who wants to build scalable AI-powered algorithms, you need to understand how to use the tools to build them. This Specialization will teach you best practices for using TensorFlow, a popular open-source framework for machine learning.
>
> The Machine Learning course and Deep Learning Specialization from Andrew Ng teach the most important and foundational principles of Machine Learning and Deep Learning. This new deeplearning.ai TensorFlow Specialization teaches you how to use TensorFlow to implement those principles so that you can start building and applying scalable models to real-world problems. To develop a deeper understanding of how neural networks work, we recommend that you take the Deep Learning Specialization.
>
>The full deeplearning.ai TensorFlow Specialization will be available later this year, but you can get started with Course 1,

/r/MachineLearning
https://redd.it/ayap05
Supervisor for running multiple dynamically started python scripts?

Hey guys, I'm looking for a supervisor that will take care of dynamically created/started/stopped/destroyed python script processes, can you reccomend a good one?

/r/Python
https://redd.it/aycr6t
converting from flask to aiohttp

I'm looking into converting to aiohttp but in flask there is `@app.before_request` and `@app.after_request` that get called before and after each request. I also get as global `g` object. Not sure how to translate this over to aiohttp. Does aiohttp have similar features? I saw a context object possibly for `g` but didn't see anything for before/after request hooks.

/r/Python
https://redd.it/ayd0yn
[P] I built Lambda's $12,500 deep learning rig for $6200

See: http://l7.curtisnorthcutt.com/build-pro-deep-learning-workstation

Hi Reddit! I built a 3-GPU deep learning workstation similar to Lambda's 4-GPU ( RTX 2080 TI ) rig for half the price. In the hopes of helping other researchers, I'm sharing a time-lapse of the build, the parts list, the receipt, and benchmarking versus Google Compute Engine (GCE) on ImageNet. You save $1200 (the cost of an EVGA RTX 2080 ti GPU) per ImageNet training to use your own build instead of GCE. The training time is reduced by over half. In the post, I include 3 GPUs, but the build (increase PSU wattage) will support a 4th RTX 2080 TI GPU for $1200 more ($7400 total). Happy building!

/r/MachineLearning
https://redd.it/ayd01o
Flask + Celery In Docker Container but sharing files.

Hey All,

Know I am asking a lot of questions here lately. But I am learning in leaps and bounds.
Currently I have A Docker Compose file that boots up my flask app. and my celery worker into two different containers. My understanding is this is good practice. However I have a slight problem.

My Flask Application takes a file upload. This file gets uploaded into the static directory of the flask application. Then once the file is written to the host the celery worker picks up the file and processes it in the background. All this works perfectly on my local machine outside of docker.

One small issue. Which I am sure you can already foresee. When I containerise my application. Put the app and the worker into container. The user uploads the file and it goes into the flask containers file system. Then as expected the Celery Worker, In its container picks up the job. However the Celery Worker Cannot Locate the uploaded file for processing cause the file exists in the file system of the Flask App Container and not the Celery Worker Container.

Does any one have any experience working this one out? Any ideas

/r/flask
https://redd.it/aygfbt
Can Atom help tell me what parameters are needed?

/r/django
https://redd.it/ayeoim
First Python Script! Who knew old dogs can learn new tricks!

Woooo!

https://pastebin.com/ASmeZhRm

It's just a small script that tells me how much tea I need to buy for the month based on cup size and number or cups I drink daily...lol

The exercize did say keep the first one simple...

p.s. started with python2 and got shit on at stackexchange for trying to get a more exact output number...
was told flat out to use python3 LOL

https://i.imgur.com/KSfzK0P.jpg

python2 = old and busted

python3 = new hotness

/r/Python
https://redd.it/ayj6ge