Posts

How To Install & setup Python 3.8 Version on Windows 10

Image
  1- Installing Python from Python.org Go on Python.org at the section where you can download the windows executables: https://www.python.org/downloads/windows/ Go down in the page and download the following executable (if your computer is 64 bits): Windows x86-64 executable installer Double click on the executable and install it 2- Add Python 3 to the windows 10 environment variable path I will suppose that you didn’t check the “add python to the path” checkbox when you installed it. Let’s see now how to add this new python 3 version to the path By default, it installs in the path: C:\Users\cypri\AppData\Local\Programs\Python ( cypri  will be replaced by your windows user name of course…) This is not convenient, because AppData is a hidden folder and it may cause problems with some python modules such as jupyter if you leave it here The move is to C:/ Change the name of the executable to python3.exe for convenience Let’s now edit the environment variables to add this new pyth...

Remove URL Field on Wordpress Comments Sections

  Log in to WordPress blog Go to  Dashboard Click on the  Appearance  tab from the left pane. Click on  Edit  under the Appearance tab. Select theme to be edited from the drop-down at right upper corner. Click on  functions.php  from the right pane. Copy and paste the below code at the bottom of all others and click on Submit/ Save. Below the filter code that needs to be added in  functions.php  file: add_filter('comment_form_default_fields', 'remove_url');  function remove_url($fields)  {  if(isset($fields['url']))  unset($fields['url']);  return $fields;  } Once this code is added, clear your cache plugin and refresh the article or blog post page. There will be no website URL field in the comment form.

JSON Library In Python - Loads/dumps/load/dump

 Using JSON library we can perform this main operation Method Description dumps() encoding to JSON objects dump() encoded string writing on file loads() Decode the JSON string load() Decode while JSON file read Python to JSON (Encoding) JSON Library of Python performs following translation of Python objects into JSON objects by default Python JSON dict Object list Array unicode String number - int, long number – int float number – real True True False False None Null JSON to Python (Decoding) JSON string decoding is done with the help of inbuilt method  loads()  &  load()  of JSON library in Python. Here translation table show example of JSON objects to Python objects which are helpful to perform decoding in Python of JSON string. JSON Python Object dict Array list String unicode number – int number - int, long number – real float True True False False Null None How to Convert String to JSON Object? When they send using request.data { "data": { "title":"tes...

How to Connect Firebase Using Pyrebase In Python

pyrebase python documentation or how to Connect Firebase For Authenticate and Database Usage If you do not Install then install using "pip install Pyrebase" Add Pyrebase to your application For use with only user based authentication we can create the following configuration : import pyrebase config = { "apiKey" : "apiKey" , "authDomain" : "projectId.firebaseapp.com" , "databaseURL" : "https://databaseName.firebaseio.com" , "storageBucket" : "projectId.appspot.com" } firebase = pyrebase.initialize_app(config) We can optionally add a service account credential to our configuration that will allow our server to authenticate with Firebase as an admin and disregard any security rules. create project using Firebase -- https://console.firebase.google.com/ import pyrebase config = { "apiKey" : "apiKey" , "authDomain" : "projectId.firebaseapp.com" , ...