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
Videos in HTML

Hello,

I am working on a project, and I am trying to get a video playing in the DOM but I am having lots of trouble.

I have done a lot of researching but I cannot find the actual problem. The videos I am trying to play are MP4 but I can convert them if needed.

Everything works fine in non-Chromium based browsers like Safari or FireFox. But in Chromium browsers, the video loads fine but anytime seeking is requested, the video restarts.

I have tried with the video controls in the browser as well as programmatically with JavaScript, both just jump to the beginning of the video.

Also, I do not know if this is supposed to happen, but in all browsers it makes three total requests.

(Copied from Google Chrome Dev Tools as fetch):


1st:

GET /media/inspection_media/test.mp4 HTTP/1.1
Accept: */*
Accept-Encoding: identity;q=1, *;q=0
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Cookie: csrftoken=token; sessionid=id
Host: localhost:8000
Range: bytes=0-
Referer: http://localhost:8000/home/%5Eredirected/(%3FP1%5Cd+)/$
Sec-Fetch-Dest: video
Sec-Fetch-Mode: no-cors
Sec-Fetch-Site: same-origin
User-Agent:

/r/django
https://redd.it/xppsmw
Running Python Script Online

Hey Guys

I made a script and its running perfectly. The script logs in to a webpage and checks something after that it sends me an email. I used selenium for it.

Now is my question if there is a service where I can run this script like once a hour. Whats the best service to do this?

My first guess was to just use the win10 taskscheduler but it was not reliable.

/r/Python
https://redd.it/xpoxrh
How to use remote jupyter kernel with vscode in my local pc?

Hi, I want to use a python environment in remote server together vscode jupyter notebook extension in my local pc. I used remote extension in vscode and added remote jupyter server but I don't want to use the file in remote machine. I wanna use the files in my local pc with remote jupyter kernel. So, I just wanna use remote computing with jupyter kernel and store my data in my local pc. Is it possible?

https://preview.redd.it/llcfupk8d0o91.png?width=631&format=png&auto=webp&s=e15858ed524d133daf17c24c686af83ec631c4e0

/r/JupyterNotebooks
https://redd.it/xeu1pl
How to use SageMath use Jupyter

I was wondering how to use sagemath with jupyter. I am not experienced with jupyter or sagemath though I was able to install jupyter and get it running. However I am not sure if I have installed sagemath correctly and wasn’t sure how to setup it up so my notebooks can use sagemath. Any help or resources are greatly appreciated thanks!

/r/JupyterNotebooks
https://redd.it/xejik2
D Any Python Code available for Visualizing Named-Entities and Relations?

I'm looking to visualize named-entities and relations over a very large set of documents and saving this in some external document (like a PDF or HTML file). Specifically, given that I have the document locations corresponding to the entities and relations, I am looking for something to label every entity with a specific color corresponding to its entity type and colored arrows corresponding to relation type between related entities. Is there any python code available to do this?

I tried generating a PDF using PyFPDF but it won't easily let me color individual words. For now, I am giving up on PyFPDF and trying to use python to generate HTML and CSS.


UPDATE: Turns out I can use PyFPDF to color individual words (using the write function rather than the cell/multicell functions). However, still trying to figure out how to draw arrows between words. Any suggestions for libraries that can do this easily would be appreciated!

/r/MachineLearning
https://redd.it/xq61zi
Is there a way to use Store Magic across 2 Jupyter notebooks (one running Python & one running R)?

I've used the store magic for 2 python notebooks and that worked well. Just curious if there is a way to share data between a R notebook and a Python notebook.

Thanks in advance.

/r/JupyterNotebooks
https://redd.it/x578xu
I built a platform for helping Django developer to find a new job.. and it's work pretty well !

Hey r/Django :),

I'm a freelance Django dev and I'm making some side projects (Big fan of the indie hacking movement)

My last one is a platform for helping Django developers to find a new job or a new freelance contract (https://www.djangotop.com).It's 100% free. I put it online 1 month ago and I already have 70 devs that are signed up :D (and 2 found a job !)

Do not hesitate to give feedback and if you are interested, create your profile ! It helps me to be able to bring back more traffic from companies interested in Django developers !

/r/django
https://redd.it/xq7jlx
D DALL·E Now Available Without Waitlist

https://openai.com/blog/dall-e-now-available-without-waitlist/

It appears to work as advertised, not any special workflow. (as a bonus, it does work with organizations too, with credits shared)

/r/MachineLearning
https://redd.it/xqhho8
Made a private social network with flask.

Here is the landing page: vomindo.pythonanywhere.com

If you want to test it out you can dm me and I will send you an invite link.

Any feedback on the landing page is welcomed. I kinda need some help to figure out how to make it better.

/r/flask
https://redd.it/xq5nyq
Related object is literally being saved immediately above but still getting "ValueError("save() prohibited ... unsaved related object 'url'.")

Django==4.0.7 (I can't use 4.1 yet because of django-celery-beat not working with 4.1)


Getting this error for a updateorcreate() using a related object (code line 392). Django thinks it's unsaved but it's literally being saved right above it. This only happens when the get() fails and I'm creating the object after URL.DoesNotExist is caught. If the get() works the updateorcreate() is handled without issue.

How can I save it more than it's already being saved? :-)

(Traceback is at the bottom of this post)

Code:


378 # Handle URL key
379

/r/djangolearning
https://redd.it/xqs3m4
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python education!

This thread is not for recruitment, please see r/PythonJobs or the thread in the sidebar for that.

/r/Python
https://redd.it/xqsk02
How to reformat IPYNB files for JSON compatability?

When dragging and dropping the .IPYNB file in Jupyter Notebooks, I get an error...

The error was: SyntaxError: Unexpected end of JSON input

when inspecting the properties I see:

\-------------

Type of file: IPYNB

Location: 04/demos/demo/titanic/notebooks/

size: 82 KB

compressed: 25 KB

Method: Deflated

CRC-32: 5570B0C4

Index: 420

\--------------

How can I reformat these files with the correct JSON input so I can use IPYNB files in Jupyter Notebook?

/r/JupyterNotebooks
https://redd.it/xqm13a
Update DB with new table with SQLAlchemy

So I'm using SQLAlchemy with my Flask web app for database stuff. I tried adding another class to my "models.py" file to make another table for the database, but that didn't work. So, I'd like to ask the proper way of adding new tables to databases with SQLAlchemy.

/r/flask
https://redd.it/xr34f8
Cross Data-Base joins on Jupyter Notebook?

Hey all!

I want to create a data extract by joining multiple tables from different databases in order to create a Tableau dashboard. The problem is on Tableau it takes painfully long time to do so. My teammate suggested Jupyter Notebook.


How to do it?? Can someone provide an example?? This will be greatly appreciated! Thanks.

/r/JupyterNotebooks
https://redd.it/x55sif
Is it time for Python to have a statically-typed, compiled, fast superset?

I love Python. Really enjoy writing code and cracking problems with Python. I’m by no means an expert (not even close), but have been writing Python for the past 7 years or so (happily).

Now, a few things caught my attention during this time. The first was Rust. It’s amazing how much of a difference it makes to have a powerful compiler and static types and low memory consumption and speed. Sure, Rust is the extreme, but still, a lot to learn here. Not to criticize Python, since the errors have improved drastically, MyPy has evolved significantly, the language is getting faster. But yeah, Rust in a whole new level in several aspects (reinforcing: this is NOT a comparison, but rather a reference).

The other thing that was interesting to me, was the potential of type annotations to help make for a faster, safer experience on the compiler end of things. One example is seen in Meta’s Cinder project, on the docs it explains how typing can be used to reduce the number of steps for the compiler ([cinder/static_python.rst at cinder/3.8 · facebookincubator/cinder · GitHub\](https://github.com/facebookincubator/cinder/blob/cinder/3.8/CinderDoc/static\_python.rst)), making it more effective.

The ecosystem definitely is not lacking on projects: Cinder, MyPyC, Nuitka, PyPy, Pyston,

/r/Python
https://redd.it/xragzg
R Meta-FAIR releases Make-a-Video, a model that generates videos from texts or images

A dog wearing a Superhero outfit with red cape flying through the sky

https://makeavideo.studio/

/r/MachineLearning
https://redd.it/xrdc88
What do you use to run Jupyter notebook?

I just started learning ML with Jupyter notebook, I am not sure which IDE to use

Jupyter notebook with anaconda seems the simplest but lack intellisense, so I am kinda gravitating toward PyCharm or VS studio code. any suggestion?

/r/JupyterNotebooks
https://redd.it/x2a5r2
Can't undo, redo, copy or paste

It seems other shortcuts work in edit mode, but any of these does nothing. I'm getting so frustrated, why is Google so useless nowadays?? Please help

/r/JupyterNotebooks
https://redd.it/xrshpu