#pip install pythonnet pyinstaller

Note: in the code where ever you are using a file directly , use the below function to call that file.

import os

def resource_path(relative_path):
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")

return os.path.join(base_path, relative_path)
# resultObj = parseXML(resource_path(xmlName))
# instead of #resultObj = parseXML(xmlName)

then:
pyinstaller — onefile hello.py

Or to add files in the same .exe

pyinstaller — onefile — add-data “*.xml;.” hello.py


//pip install pkg –save

Go to package.json and add these

“bin”:”bin/www”,

“pkg”:{

“assets”:[“public/**/*”,”views/**/*”],

“targets”:[“node10-win-x64”]

}

goto folder containing package.json

run: pkg package.json

Done…


button:active{

transform: scale(0.98)

}

Note: The buttons size will shrunk a little and gives the feel of a button click.

That.it


How to handle redirects in react on netlify

Inside the public folder in react, create a file called _redirects and add the below content.

/* /index.html 200

Thats it.


Photo by Umberto on Unsplash

I believe that whoever wants to run their server on Heroku is having their server.js file ready and running on their local machine.

Steps

# Goto the package.json file and node version you are using like shown below.


Just type :

document.designMode = "on"

on browser devtools and see the magic.

It will make any website editable.

Enjoy.


lamb+da
Photo by Sam Carter on Unsplash

I came from GCP where using cloud function is as easy as ordering a pizza from restaurant with required amount of cheese and toppings.

But in AWS it was bit trickier so when we have to use python preinstalled dependencies it is fine but for external dependencies it takes a bridge to be constructed (how’s this one in regard with the pizza analogy…just kidding).

HOW I USED THE EXTERNAL LIBRARIES

  • I created a virtual environment in windows using below commands.

=>python3 -m venv myVirtualEnv
=>myVirtualEnv\scripts\activate

  • Called the pip warrior to to install my dependencies
  • Then created a requirements.txt as below:

=> pip freeze > requirements. txt


I have been using GCP from past year and worked on cloud functions extensively ( mostly on python ).

In a project came a requirement to use aws lambda function to be used. I thought the task to run a program with some external dependencies ( the one which we install using pip i.e pip install requests) would be easy but guess what, no it wasn’t that straight froward.

How it would be done with GCP

Just create the fuction in python

In requirements file give what dependencies are to be used

Thats it when you run the function it downloads the package at the backend and…

Mohammad Farman Abbasi

Learning each day without giving up.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store