Fastest way to uniquify a list in Python >=3.6
https://www.peterbe.com/plog/fastest-way-to-uniquify-a-list-in-python-3.6
/r/Python
https://redd.it/7lqu97
https://www.peterbe.com/plog/fastest-way-to-uniquify-a-list-in-python-3.6
/r/Python
https://redd.it/7lqu97
Evolving Simple Organisms using a Genetic Algorithm and Deep Learning from Scratch with Python – nathanrooy.github.io
https://nathanrooy.github.io/posts/2017-11-30/evolving-simple-organisms-using-a-genetic-algorithm-and-deep-learning/?utm_source=mybridge&utm_medium=blog&utm_campaign=read_more
/r/Python
https://redd.it/7lshtb
https://nathanrooy.github.io/posts/2017-11-30/evolving-simple-organisms-using-a-genetic-algorithm-and-deep-learning/?utm_source=mybridge&utm_medium=blog&utm_campaign=read_more
/r/Python
https://redd.it/7lshtb
nathanrooy.github.io
Evolving Simple Organisms using a Genetic Algorithm and Deep Learning from Scratch with Python
Nathan A. Rooy | nathanrooy.github.io
How do I create a checkbox using model fields?
I have to create a field in a model, what field class can I use to represent the checkbox? How can I use this in the Modelform?
/r/django
https://redd.it/7lurgg
I have to create a field in a model, what field class can I use to represent the checkbox? How can I use this in the Modelform?
/r/django
https://redd.it/7lurgg
reddit
How do I create a checkbox using model fields? • r/django
I have to create a field in a model, what field class can I use to represent the checkbox? How can I use this in the Modelform?
notifiers 0.6.0 released. 4 new notifiers, a total of 9 and going strong
https://github.com/liiight/notifiers
/r/Python
https://redd.it/7luntc
https://github.com/liiight/notifiers
/r/Python
https://redd.it/7luntc
GitHub
GitHub - liiight/notifiers: The easy way to send notifications
The easy way to send notifications. Contribute to liiight/notifiers development by creating an account on GitHub.
The state of Python 3 adoption
https://rushter.com/blog/python-3-adoption/
/r/Python
https://redd.it/7lwxxf
https://rushter.com/blog/python-3-adoption/
/r/Python
https://redd.it/7lwxxf
[AF] SocketIO -- Server not opening websocket connection
Hi, I'm trying to run a (very) simple websocket server.
I'm trying to connect using a command line tool:
> $ wscat -c ws://localhost:5000/
Starting the server, and running the *wscat* request, I see:
* Serving Flask-SocketIO app "main"
* Forcing debug mode on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 243-427-340
(1983) wsgi starting up on http://127.0.0.1:5000
(1983) accepted ('127.0.0.1', 50372)
127.0.0.1 - - [24/Dec/2017 09:19:18] "GET / HTTP/1.1" 200 132 0.003266
It's making the http connection, but doesn't seem to be promoting to websockets. There's a debugging "print" doesn't print, and an "emit" that doesn't emit for the "connect".
I can use *wscat* to connect to echo servers just fine.
I'm clearly not doing something right, I'm just really not sure what!
I've tried with web pages too -- but here I'm trying to keep it simple.
[GitHub app](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/main.py)
[conda installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements_conda.txt)
[pip installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements.txt)
I'd really appreciate another pair of eyes, if anyone has troubleshooting advice or can see a bug.
Thanks, and Happy Christmas!
EDIT:
I just tried running Miguel Grinberg's Flask-SocketIO off of github, but with the same environment I was running my own test with.
It works!
Though some of the responses are labelled polling, and some are websockets, which seems funny to me that it's doing both in the same browser.
But this confirms it's me not seeing / understanding some concept.
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET / HTTP/1.1" 200 6028 0.001638
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET /socket.io/?EIO=3&transport=polling&t=1514144620687-0 HTTP/1.1" 200 381 0.001277
(2632) accepted ('127.0.0.1', 51051)
Client disconnected 19392765e6d8415f9c2654d2cf924186
127.0.0.1 - - [24/Dec/2017 14:47:18] "GET /socket.io/?EIO=3&transport=websocket&sid=19392765e6d8415f9c2654d2cf924186 HTTP/1.1" 200 0 217.415311
/r/flask
https://redd.it/7lvfuh
Hi, I'm trying to run a (very) simple websocket server.
I'm trying to connect using a command line tool:
> $ wscat -c ws://localhost:5000/
Starting the server, and running the *wscat* request, I see:
* Serving Flask-SocketIO app "main"
* Forcing debug mode on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 243-427-340
(1983) wsgi starting up on http://127.0.0.1:5000
(1983) accepted ('127.0.0.1', 50372)
127.0.0.1 - - [24/Dec/2017 09:19:18] "GET / HTTP/1.1" 200 132 0.003266
It's making the http connection, but doesn't seem to be promoting to websockets. There's a debugging "print" doesn't print, and an "emit" that doesn't emit for the "connect".
I can use *wscat* to connect to echo servers just fine.
I'm clearly not doing something right, I'm just really not sure what!
I've tried with web pages too -- but here I'm trying to keep it simple.
[GitHub app](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/main.py)
[conda installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements_conda.txt)
[pip installed requirements](https://github.com/hanhanhan/fake_bus_api/blob/ws_troubleshoot/requirements.txt)
I'd really appreciate another pair of eyes, if anyone has troubleshooting advice or can see a bug.
Thanks, and Happy Christmas!
EDIT:
I just tried running Miguel Grinberg's Flask-SocketIO off of github, but with the same environment I was running my own test with.
It works!
Though some of the responses are labelled polling, and some are websockets, which seems funny to me that it's doing both in the same browser.
But this confirms it's me not seeing / understanding some concept.
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET / HTTP/1.1" 200 6028 0.001638
127.0.0.1 - - [24/Dec/2017 14:43:40] "GET /socket.io/?EIO=3&transport=polling&t=1514144620687-0 HTTP/1.1" 200 381 0.001277
(2632) accepted ('127.0.0.1', 51051)
Client disconnected 19392765e6d8415f9c2654d2cf924186
127.0.0.1 - - [24/Dec/2017 14:47:18] "GET /socket.io/?EIO=3&transport=websocket&sid=19392765e6d8415f9c2654d2cf924186 HTTP/1.1" 200 0 217.415311
/r/flask
https://redd.it/7lvfuh
GitHub
hanhanhan/fake_bus_api
Contribute to fake_bus_api development by creating an account on GitHub.
Best of /r/Python 2017
This is our Best of 2017 thread.
Submit things that you loved about /r/Python this year. It can be people, posts, comments, or whatever you want, as long as it is something that is in this subreddit.
Going to keep this post stickied until January 2nd, then hand out some gold to the people that the votes tell us are the best!
Merry Christmas everyone!
/r/Python
https://redd.it/7lyxpw
This is our Best of 2017 thread.
Submit things that you loved about /r/Python this year. It can be people, posts, comments, or whatever you want, as long as it is something that is in this subreddit.
Going to keep this post stickied until January 2nd, then hand out some gold to the people that the votes tell us are the best!
Merry Christmas everyone!
/r/Python
https://redd.it/7lyxpw
reddit
Best of /r/Python 2017 • r/Python
This is our Best of 2017 thread. Submit things that you loved about /r/Python this year. It can be people, posts, comments, or whatever you...
Jupyter Auto Starting in Atom Terminal
Not sure if this is the right place to post this but I thought I'd try.
Whenever I run the terminal in atom, it automatically starts a jupyter notebook. Not sure why this happens but its really annoying.
I also opened just a terminal window directly. It opened fine but this was the second line in the window:
env: jupyter-notebook: No such file or directory
Not sure what's going on here... Any help would be appreciated!
/r/Python
https://redd.it/7lz9rm
Not sure if this is the right place to post this but I thought I'd try.
Whenever I run the terminal in atom, it automatically starts a jupyter notebook. Not sure why this happens but its really annoying.
I also opened just a terminal window directly. It opened fine but this was the second line in the window:
env: jupyter-notebook: No such file or directory
Not sure what's going on here... Any help would be appreciated!
/r/Python
https://redd.it/7lz9rm
reddit
Jupyter Auto Starting in Atom Terminal • r/Python
Not sure if this is the right place to post this but I thought I'd try. Whenever I run the terminal in atom, it automatically starts a jupyter...
How to read CSV file in Python
https://www.alexkras.com/how-to-read-csv-file-in-python/
/r/Python
https://redd.it/7m0164
https://www.alexkras.com/how-to-read-csv-file-in-python/
/r/Python
https://redd.it/7m0164
alexkras.com
How to read CSV file in Python
Let’s say we have the following CSV file, named . You can download this file here. The first method demonstrated in Python docs would read the file as follows: Open the file Create a CSV reader Skip…
context in class-based views
So I recently switched to class based views, and found this code to pass in additional context to template:
class DetailView(generic.DetailView):
model = Language
template_name = 'languages/detail.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['year'] = Details.objects.filter(year=2016)
return context
However, I fail to be able to display values/the variable in the HTML. How do i go about this in template.html?
/r/django
https://redd.it/7m01au
So I recently switched to class based views, and found this code to pass in additional context to template:
class DetailView(generic.DetailView):
model = Language
template_name = 'languages/detail.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['year'] = Details.objects.filter(year=2016)
return context
However, I fail to be able to display values/the variable in the HTML. How do i go about this in template.html?
/r/django
https://redd.it/7m01au
reddit
context in class-based views • r/django
So I recently switched to class based views, and found this code to pass in additional context to template: class...
[News] New NVIDIA EULA prohibits Deep Learning on GeForce GPUs in data centers.
According to German tech magazine golem.de, the new NVIDIA EULA prohibits Deep Learning applications to be run on GeForce GPUs.
Sources:
https://www.golem.de/news/treiber-eula-nvidia-untersagt-deep-learning-auf-geforces-1712-131848.html
http://www.nvidia.com/content/DriverDownload-March2009/licence.php?lang=us&type=GeForce
The EULA states:
"No Datacenter Deployment. The SOFTWARE is not licensed for datacenter deployment, except that blockchain processing in a datacenter is permitted."
EDIT: Found an English article: https://wirelesswire.jp/2017/12/62708/
/r/MachineLearning
https://redd.it/7ly5gi
According to German tech magazine golem.de, the new NVIDIA EULA prohibits Deep Learning applications to be run on GeForce GPUs.
Sources:
https://www.golem.de/news/treiber-eula-nvidia-untersagt-deep-learning-auf-geforces-1712-131848.html
http://www.nvidia.com/content/DriverDownload-March2009/licence.php?lang=us&type=GeForce
The EULA states:
"No Datacenter Deployment. The SOFTWARE is not licensed for datacenter deployment, except that blockchain processing in a datacenter is permitted."
EDIT: Found an English article: https://wirelesswire.jp/2017/12/62708/
/r/MachineLearning
https://redd.it/7ly5gi
Golem.de
Nvidia untersagt Geforces in Rechenzentren
Wer eine Geforce oder Titan verwendet, darf diese Nvidia-Karten der aktualisierten Endbenutzer-Lizenzvereinbarung zufolge nicht mehr in Rechenzentren, etwa für Deep Learning,
An example of Django project with login, registration, password change, log out, and password reset functionality [UPDATE 3.0]
https://www.reddit.com/r/django/comments/7kwy9w/an_example_of_django_project_with_login/
/r/djangolearning
https://redd.it/7m0yus
https://www.reddit.com/r/django/comments/7kwy9w/an_example_of_django_project_with_login/
/r/djangolearning
https://redd.it/7m0yus
reddit
An example of Django project with login, registration,... • r/django
Links: - Repository: https://github.com/egorsmkv/simple-django-login-and-register - Previous post about 2.0 version:...
Django's autoreload function is unusably slow
Hello.
I have never had this problem in the past, but I am starting a new project and Django's autoreload feature (where it restarts the server after a code change) has been ridiculously slow (15 seconds - never). I am using WSL. I think this is something new with Django 2.0.
/r/django
https://redd.it/7m0gqu
Hello.
I have never had this problem in the past, but I am starting a new project and Django's autoreload feature (where it restarts the server after a code change) has been ridiculously slow (15 seconds - never). I am using WSL. I think this is something new with Django 2.0.
/r/django
https://redd.it/7m0gqu
reddit
Django's autoreload function is unusably slow • r/django
Hello. I have never had this problem in the past, but I am starting a new project and Django's autoreload feature (where it restarts the server...
Python Programming Tutorial File handling part 18
https://www.youtube.com/attribution_link?a=-oXb0WRNZas&u=%2Fwatch%3Fv%3DE24pt9bE-NM%26feature%3Dshare
/r/Python
https://redd.it/7m117q
https://www.youtube.com/attribution_link?a=-oXb0WRNZas&u=%2Fwatch%3Fv%3DE24pt9bE-NM%26feature%3Dshare
/r/Python
https://redd.it/7m117q
YouTube
Python Programming Tutorial File handling part 18
In this python tutorial cloudyrathor expain about file handling in python iin easy way. this tutorial explain how to open the file in read,write and readwrit...
Open-source cryptocurrency portfolio manager written in Flask!
https://github.com/anfederico/cryptoview
/r/Python
https://redd.it/7m18d0
https://github.com/anfederico/cryptoview
/r/Python
https://redd.it/7m18d0
GitHub
GitHub - anfederico/cryptoview: Elegant portfolio management for multi-exchange traders
Elegant portfolio management for multi-exchange traders - GitHub - anfederico/cryptoview: Elegant portfolio management for multi-exchange traders
Wishing merry Christmas using Python Turtle Script
http://thepythondjango.com/python-script-6-wishing-merry-christmas-using-python-turtle/
/r/django
https://redd.it/7m62t9
http://thepythondjango.com/python-script-6-wishing-merry-christmas-using-python-turtle/
/r/django
https://redd.it/7m62t9
The Python Django
Python Script 6: Wishing Merry Christmas using Python Turtle - The Python Django
Python script to wish merry Christmas using python turtle. Using Python Turtle module to wish merry Christmas to your friends.
Django Rest API - writing to FK based
I have two models as below:
class University(models.Model):
name = models.CharField(max_length=50)
class Meta:
verbose_name = "University"
verbose_name_plural = "Universities"
def __str__(self):
return self.name
def __unicode__(self):
return self.name
class Student(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
university = models.ForeignKey(University, on_delete = models.SET_NULL, null = True)
class Meta:
verbose_name = "Student"
verbose_name_plural = "Students"
def __str__(self):
return '%s %s' % (self.first_name, self.last_name)
def __unicode__(self):
return '%s %s' % (self.first_name, self.last_name)
class UniversitySerializer(serializers.ModelSerializer):
class Meta:
model = University
fields = '__all__'
class StudentSerializer(serializers.ModelSerializer):
university = serializers.SlugRelatedField(slug_field = 'name', queryset = University.objects.all())
class Meta:
model = Student
fields = '__all__'
I want to be able to access the forms that are generated by the browsable API in angularJS or any of the front end frameworks.
Can someone please nudge me into the right direction?
It's something most likely very simple however, I am lost as I am very new to this.
Many thanks in advance
/r/djangolearning
https://redd.it/7lw5xb
I have two models as below:
class University(models.Model):
name = models.CharField(max_length=50)
class Meta:
verbose_name = "University"
verbose_name_plural = "Universities"
def __str__(self):
return self.name
def __unicode__(self):
return self.name
class Student(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
university = models.ForeignKey(University, on_delete = models.SET_NULL, null = True)
class Meta:
verbose_name = "Student"
verbose_name_plural = "Students"
def __str__(self):
return '%s %s' % (self.first_name, self.last_name)
def __unicode__(self):
return '%s %s' % (self.first_name, self.last_name)
class UniversitySerializer(serializers.ModelSerializer):
class Meta:
model = University
fields = '__all__'
class StudentSerializer(serializers.ModelSerializer):
university = serializers.SlugRelatedField(slug_field = 'name', queryset = University.objects.all())
class Meta:
model = Student
fields = '__all__'
I want to be able to access the forms that are generated by the browsable API in angularJS or any of the front end frameworks.
Can someone please nudge me into the right direction?
It's something most likely very simple however, I am lost as I am very new to this.
Many thanks in advance
/r/djangolearning
https://redd.it/7lw5xb
reddit
Django Rest API - writing to FK based • r/djangolearning
I have two models as below: class University(models.Model): name = models.CharField(max_length=50) class Meta: verbose_name =...
Any idea on how to implement forest with Function based views? (beginner here)
I want to implement formset to add manytomanyfield in one class table. how can i achieve it? I [found one](https://medium.com/@adandan01/django-inline-formsets-example-mybook-420cc4b6225d) but it is using class based views, and i don't understand it yet.
can you help me here?
/r/djangolearning
https://redd.it/7lv0um
I want to implement formset to add manytomanyfield in one class table. how can i achieve it? I [found one](https://medium.com/@adandan01/django-inline-formsets-example-mybook-420cc4b6225d) but it is using class based views, and i don't understand it yet.
can you help me here?
/r/djangolearning
https://redd.it/7lv0um
Medium
Django Inline formsets example: mybook
Recently I needed to use django formset for a work project. Django formset allows you to edit a collection of the same forms on the same…