This worked in both python 2.7 and 3.6.4
sum([[1, 2, 3], [4, 5, 6]], [])This worked in both python 2.7 and 3.6.4
sum([[1, 2, 3], [4, 5, 6]], [])Use urlencode from urllib for encoding and parse_qs from urlparse for decoding. urlencode takes a dict while parse_qs takes a string. I learned from this awesome link.
Use urlencode from urllib.parse for encoding and parse_qs from urllib.parse for decoding. urlencode takes a dict while parse_qs takes a string.
Install future package version 0.16.0. Import urlencode and parse_qs from future.moves.urllib.parse.
let username = 'john';
let password = 'doe';
let url = `https://httpbin.org/basic-auth/${username}/${password}`
let authString = `${username}:${password}`
let headers = new Headers();
headers.set('Authorization', 'Basic ' + btoa(authString))
fetch(url,{method: 'GET', headers: headers})
.then(function (response) {
console.log (response)The following is a life-saver if you test request objects in django frequently and you don't necessarily need to hit a specific endpoint
from django.test import RequestFactory
request_factory = RequestFactory()
request = request_factory.get('/path', data={'name': u'test'})I noticed the following warning being triggered when launching the terminal in my Visual Studio app a couple of times but I had ignored it:
β nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
Run `npm config delete prefix` or `nvm use --delete-prefix v8.0.0 --silent` to unset it.I got the exact same warning when launching tmux locally and that caught my attention. I use nvm locally to manage node versions so initially I thought that was the problem. A quick search on google and I found out that a couple of people had experienced the same problem. I found my solution here in a github
Before line break
subkeyword = Session.query(
Subkeyword.subkeyword_id, Subkeyword.subkeyword_word
).filter_by(
subkeyword_company_id=self.e_company_id
).filter_by(
subkeyword_word=subkeyword_wordPeople
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |