Import the module and create an object of the class LocalVariable.

Overview

LocalVariable

Import the module and create an object of the class LocalVariable. Call the save method with the name and the value of a variable as argument to store your data locally and call any of the methods from the list below to read the value.

  • read_int (var_name)
  • read_float (var_name)
  • read_str (var_name)
  • read_bool (var_name)
  • read_list (var_name)
  • read_tuple (var_name)
  • read_set (var_name)
  • read_dict (var_name)


## Sample 01:
import PyVariable
data = Variables.LocalVariable()
data.save("Name", "John")  # This will store the variable Name with the value John
LocalName = data.read_str("Name")  # This will read the value of Name from cloud and store in LocalName
print(LocalName)  # This will print John
##Sample 02: This program counts how many times you runned this program.
import PyVariable
count = 0
data = Variables.LocalVariable()
count = data.read_int("count")  # This will read the value of count and store in count variable
count = count + 1
data.save("count", count)  # This will store the variable count with the value John
print("This program ran" + str(count) + "times")
# do something below ;)






CloudVariable


Step1:   Go to https://console.firebase.google.com/
Step2:   Login with your google account.
Step3:   Click on Add Project
Step4:   Enter any name (The name doesn't matter at all).
Step5:   Disable Google Analytics and click on continue.
Step6:   After the the database creation is finished, click on continue and you'll see a window like this.
Step7:   Click on Realtime Database on the left.
Step8:   Click on Create Database and select your nearest location.
Step9:   After clicking Next, Select Start in test mode and click on Enable
Step10:   Finally, just copy this url as shown in the image.

Step 10

Step11:   Now go to your code and import the module Variables.
Step12:   After that create an object of the class CloudVariable with the url you copied as argument.

Everything is now ready. Simply call the save method with the name and the value of a variable as argument to store your data online and call the read method with the name of your variable as argument to read the value. Note: The returned value will automatically be in your desired data type.


Here is a sample code -

import PyVariable
data = Variables.CloudVariable(The_Url_You_Copied)
data.save("Name", "John")  # This will store the variable Name with the value John
LocalName = data.read("Name")  # This will read the value of Name from cloud and store in LocalName
print(LocalName)  # This will print John
You might also like...
Pyfunctools is a module that provides functions, methods and classes that help in the creation of projects in python

Pyfunctools Pyfunctools is a module that provides functions, methods and classes that help in the creation of projects in python, bringing functional

This project is a set of programs that I use to create a README.md file.
This project is a set of programs that I use to create a README.md file.

This project is a set of programs that I use to create a README.md file.

Create a Web Component (a Custom Element) from a python file

wyc Create a Web Component (a Custom Element) from a python file (transpile python code to javascript (es2015)). Features Use python to define your cu

🦩 A Python tool to create comment-free Jupyter notebooks.

Pelikan Pelikan lets you convert notebooks to comment-free notebooks. In other words, It removes Python block and inline comments from source cells in

Create C bindings for python automatically with the help of libclang

Python C Import Dynamic library + header + ctypes = Module like object! Create C bindings for python automatically with the help of libclang. Examples

A utility tool to create .env files

A utility tool to create .env files dump-env takes an .env.template file and some optional environmental variables to create a new .env file from thes

A tool to create the basics of a project

Project-Scheduler Instalação Para instalar o Project Maker, você necessita está em um ambiente de desenvolvimento Linux ou wsl com alguma distro debia

This is a package that allows you to create a key-value vault for storing variables in a global context

This is a package that allows you to create a key-value vault for storing variables in a global context. It allows you to set up a keyring with pre-defined constants which act as keys for the vault. These constants are then what is stored inside the vault. A key is just a string, but the value that the key is mapped to can be assigned to any type of object in Python. If the object is serializable (like a list or a dict), it can also be writen to a JSON file You can then use a decorator to annotate functions that you want to have use this vault to either store return variables in or to extract variables to be used as input for the function.

Create password - Generate Random Password with Passphrase

Generate Random Password with Passphrase This is a python code to generate stron

Owner
Sajedur Rahman Fiad
Hello, this is Fiad. I'm Interested in Python and currently learning it
Sajedur Rahman Fiad
Python bytecode manipulation and import process customization to do evil stuff with format strings. Nasty!

formathack Python bytecode manipulation and import process customization to do evil stuff with format strings. Nasty! This is an answer to a StackOver

Michiel Van den Berghe 5 Jan 18, 2022
Script to decrypt / import chromium (edge/chrome) cookies

Cloonie Script to decrypt / import chromium (edge/chrome) cookies. Requirements Install the python dependencies via pip: pip install -r requirements.t

Lorenzo Bernardi 5 Sep 13, 2022
Export watched content from Tautulli to the Letterboxd CSV Import Format

Export watched content from Tautulli to the Letterboxd CSV Import Format

Evan J 5 Aug 31, 2022
Make some improvements in the Pizza class and pizzashop file by refactoring.

Make some improvements in the Pizza class and pizzashop file by refactoring.

James Brucker 1 Oct 18, 2021
A Python class for checking the status of an enabled Minecraft server

mcstatus provides an easy way to query Minecraft servers for any information they can expose. It provides three modes of access (query, status and ping), the differences of which are listed below in usage.

Nathan Adams 1.1k Jan 6, 2023
A time table app to notify the user about their class timings

kivyTimeTable A time table app to notify the user about their class timings Features This project incorporates some features i wanted to see in a time

null 2 Dec 15, 2021
An extremely simple package with a single utillity class used for gracefully handling POSIX shutdown signals.

graceful-killer An extremely simple package with a single utillity class used for gracefully handling POSIX shutdown signals. Installation Use pip to

Sven Ćurković 1 Dec 9, 2021
Create powerful passwords easily and with many options with this program

Password_Generator About the Program: You can create powerful passwords with this program with many options easily! Features: You can copy the generat

Sina.f 0 Jul 14, 2022
A script copies movie and TV files to your GD drive, or create Hard Link in a seperate dir, in Emby-happy struct.

torcp A script copies movie and TV files to your GD drive, or create Hard Link in a seperate dir, in Emby-happy struct. Usage: python3 torcp.py -h Exa

ccf2012 105 Dec 22, 2022
Python module and its web equivalent, to hide text within text by manipulating bits

cacherdutexte.github.io This project contains : Python modules (binary and decimal system 6) with a dedicated tkinter program to use it. A web version

null 2 Sep 4, 2022