1619514960
This example show us how to copy a bash script into docker and execute it while building the docker image.
This bash file just prints Hello
but you can install packages with apt
so on.
ubuntu@linux:~$ nano my-bash.sh
#!/bin/bash
set -e
echo "Hello"
#docker #dockerfile
1639778400
PySQL is database framework for Python (v3.x) Language, Which is based on Python module mysql.connector, this module can help you to make your code more short and more easier. Before using this framework you must have knowledge about list, tuple, set, dictionary because all codes are designed using it. It's totally free and open source.
Before we said that this framework is based on mysql.connector so you have to install mysql.connector first on your system. Then you can import pysql and enjoy coding!
python -m pip install mysql-connector-python
After Install mysql.connector successfully create Python file download/install pysql on the same dir where you want to create program. You can clone is using git or npm command, and you can also downlaod manually from repository site.
Go to https://pypi.org/project/pysql-framework/ or use command
pip install pysql-framework
git clone https://github.com/rohit-chouhan/pysql
Go to https://www.npmjs.com/package/pysql or use command
$ npm i pysql
Install From Here https://marketplace.visualstudio.com/items?itemName=rohit-chouhan.pysql
Table of contents
To connect a database with localhost server or phpmyadmin, use connect method to establish your python with database server.
import pysql
db = pysql.connect(
"host",
"username",
"password"
)
Creating database in server, to use this method
import pysql
db = pysql.connect(
"host",
"username",
"password"
)
pysql.createDb(db,"demo")
#execute: CREATE DATABASE demo
To drop database use this method .
Syntex Code -
pysql.dropDb([connect_obj,"table_name"])
Example Code -
pysql.dropDb([db,"demo"])
#execute:DROP DATABASE demo
To connect a database with localhost server or phpmyadmin, use connect method to establish your python with database server.
import pysql
db = pysql.connect(
"host",
"username",
"password",
"database"
)
To create table in database use this method to pass column name as key and data type as value.
Syntex Code -
pysql.createTable([db,"table_name_to_create"],{
"column_name":"data_type",
"column_name":"data_type"
})
Example Code -
pysql.createTable([db,"details"],{
"id":"int(11) primary",
"name":"text",
"email":"varchar(50)",
"address":"varchar(500)"
})
2nd Example Code -
Use can use any Constraint with Data Value
pysql.createTable([db,"details"],{
"id":"int NOT NULL PRIMARY KEY",
"name":"varchar(20) NOT NULL",
"email":"varchar(50)",
"address":"varchar(500)"
})
To drop table in database use this method .
Syntex Code -
pysql.dropTable([connect_obj,"table_name"])
Example Code -
pysql.dropTable([db,"users"])
#execute:DROP TABLE users
For Select data from table, you have to mention the connector object with table name. pass column names in set.
Syntex For All Data (*)
-
records = pysql.selectAll([db,"table_name"])
for x in records:
print(x)
Example - -
records = pysql.selectAll([db,"details"])
for x in records:
print(x)
#execute: SELECT * FROM details
Syntex For Specific Column
-
records = pysql.select([db,"table_name"],{"column","column"})
for x in records:
print(x)
Example - -
records = pysql.select([db,"details"],{"name","email"})
for x in records:
print(x)
#execute: SELECT name, email FROM details
Syntex Where and Where Not
-
#For Where Column=Data
records = pysql.selectWhere([db,"table_name"],{"column","column"},("column","data"))
#For Where Not Column=Data (use ! with column)
records = pysql.selectWhere([db,"table_name"],{"column","column"},("column!","data"))
for x in records:
print(x)
Example - -
records = pysql.selectWhere([db,"details"],{"name","email"},("county","india"))
for x in records:
print(x)
#execute: SELECT name, email FROM details WHERE country='india'
To add column in table, use this method to pass column name as key and data type as value. Note: you can only add one column only one call
Syntex Code -
pysql.addColumn([db,"table_name"],{
"column_name":"data_type"
})
Example Code -
pysql.addColumn([db,"details"],{
"email":"varchar(50)"
})
#execute: ALTER TABLE details ADD email varchar(50);
To modify data type of column table, use this method to pass column name as key and data type as value.
Syntex Code -
pysql.modifyColumn([db,"table_name"],{
"column_name":"new_data_type"
})
Example Code -
pysql.modifyColumn([db,"details"],{
"email":"text"
})
#execute: ALTER TABLE details MODIFY COLUMN email text;
Note: you can only add one column only one call
Syntex Code -
pysql.dropColumn([db,"table_name"],"column_name")
Example Code -
pysql.dropColumn([db,"details"],"name")
#execute: ALTER TABLE details DROP COLUMN name
To execute manual SQL Query to use this method.
Syntex Code -
pysql.query(connector_object,your_query)
Example Code -
pysql.query(db,"INSERT INTO users (name) VALUES ('Rohit')")
For Inserting data in database, you have to mention the connector object with table name, and data as sets.
Syntex -
data = {
"db_column":"Data for Insert",
"db_column":"Data for Insert"
}
pysql.insert([db,"table_name"],data)
Example Code -
data = {
"name":"Komal Sharma",
"contry":"India"
}
pysql.insert([db,"users"],data)
For Update data in database, you have to mention the connector object with table name, and data as tuple.
Syntex For Updating All Data
-
data = ("column","data to update")
pysql.updateAll([db,"users"],data)
Example - -
data = ("name","Rohit")
pysql.updateAll([db,"users"],data)
#execute: UPDATE users SET name='Rohit'
Syntex For Updating Data (Where and Where Not)
-
data = ("column","data to update")
#For Where Column=Data
where = ("column","data")
#For Where Not Column=Data (use ! with column)
where = ("column!","data")
pysql.update([db,"users"],data,where)
Example -
data = ("name","Rohit")
where = ("id",1)
pysql.update([db,"users"],data,where)
#execute: UPDATE users SET name='Rohit' WHERE id=1
For Delete data in database, you have to mention the connector object with table name.
Syntex For Delete All Data
-
pysql.deleteAll([db,"table_name"])
Example - -
pysql.deleteAll([db,"users"])
#execute: DELETE FROM users
Syntex For Deleting Data (Where and Where Not)
-
where = ("column","data")
pysql.delete([db,"table_name"],where)
Example -
#For Where Column=Data
where = ("id",1)
#For Where Not Column=Data (use ! with column)
where = ("id!",1)
pysql.delete([db,"users"],where)
#execute: DELETE FROM users WHERE id=1
[19/06/2021]
- ConnectSever() removed and merged to Connect()
- deleteAll() [Fixed]
- dropTable() [Added]
- dropDb() [Added]
[20/06/2021]
- Where Not Docs [Added]
The module is designed by Rohit Chouhan, contact us for any bug report, feature or business inquiry.
Author: rohit-chouhan
Source Code: https://github.com/rohit-chouhan/pysql
License: Apache-2.0 License
1622015491
Hey peeps, Hope you all are safe & going well
Many entrepreneurs & startups are interested to start a crypto exchange platform by using a cryptocurrency exchange script, you know why??? Let me explain. Before that, you need to know what is a cryptocurrency exchange script???
Cryptocurrency Exchange Script is an upgrade version of all exchange platforms, it is also called ready-made script or software. By using the crypto exchange script you can launch your crypto trading platform instantly. It is one of the easiest and fastest ways to start your crypto exchange business. Also, it helps to launch your exchange platform within 7 days.
The More Important one is “Where to get the best bitcoin exchange script?”
No one couldn’t answer the question directly because a lot of software/script providers are available in the crypto market. Among them, finding the best script provider is not an easy task. You don’t worry about that. I will help you. I did some technical inspection to find the best bitcoin exchange script provider in the techie world. Speaking of which, one software provider, Coinsclone got my attention. They have successfully delivered 100+ secured bitcoin exchanges, wallets & payment gateways to their global clients. No doubt that their exchange software is 100% bug-free and it is tightly secured. They consider customer satisfaction as their priority and they are always ready to customize your exchange based on your desired business needs.
Of course, it kindles your business interest; but before leaping, you can check their free live demo at Bitcoin Exchange Script.
Are you interested in business with them, then connect their business experts directly via
Whatsapp/Telegram: +919500575285
Mail: hello@coinsclone.com
Skype: live:hello_20214
#bitcoin exchange script #cryptocurrency exchange script #crypto exchange script #bitcoin exchange script #bitcoin exchange clone script #crypto exchange clone script
1617602685
Are you wanting to be an Entrepreneur? A Business using cryptocurrency? Then this article is for you.
As a beginner, always one prefers fair play. But to the least, initiating business in the streams of cryptocurrency carries a varying degree of risks. We all know that, Every business packs the profit only if we are ready to take risks. But flabbergast is, you can avoid unnecessary risk, If you choose our Twisted HYIP Investment script. You don’t need to play poker with your hard-earned Money.
Using minimal investment, You can start a beneficial business.
Craze for cryptocurrency is now seeming to be unlimited, Using the Twisted HYIP platform you will get funds for running the lending business- this is the one line of the process.
First, let me make plain, How our traditional HYIP works?
You can create a number of investment plans with attractive and promising Rate of interest. Investors will invest in those plans and get their interest periodically.
How you will provide them interest? You have to collect the investments and use them for your own project, Trading, Stock marketing and so on.
What if you don’t find a right platform to grow your investor’s funds. You will lack in processing their interest, and it will be filthy, right?
How it works?
So this Twisted HYIP platform clear this shady cloud and brings you the best place to grow your investors’ funds. With our platform you can run Investment as well as lending platform together. You will run a traditional HYIP script for your investors stating the fixed Rate of interest with validity for processing their principle back.
Instead of using the crowded funds in different platform, You can use it for lending to borrowers in your platform at an interest rate higher than promised to your investors. Now you can pay back the investors as well as you will get a constant flow of income for you.
Instead of generating promised interest rate daily or monthly, You can also make it as a doubler with long term duration. So you can use the investors fund as well as lenders repay again and again.
Every investor can monitor their investment growth in their dashboard. They will get back their invested amount plus additional ROI only when their investment gets matures. But they can see, how their wallet is loaded with profits without any risk.
Possibility of being a Profitable business
Crucial bits of Twisted HYIP
Cryptocurrency market is blooming one, as per the voices of many financial expertise, prediction for end of digital currency is a blue moon. This twisted HYIP will create its own market as a perception for profit is getting increased every day among the people.
Now are you ready to launch your own lending platform? then Connect with KIR HYIP to know more interesting features about the platform. There is always space to add your ideas.
Under a short span of time, launch your own turnkey based lending platform. The World is running behind Profit, what are you waiting for? Join the club now and get the free HYIP software demo!
#hyip script #hyip investment script #bitcoin hyip script #buy hyip script #best hyip script #hyip investment script
1625660940
Using variables and loops we can write scripts that work on a large set of files without writing it all out by hand.
Beyond Code:
(Learn to Code in 15 Minutes a Day)
Bootcamp Playlist: https://www.youtube.com/playlist?list=PLxki0D-ilnqZfyo2dZe11ZNGP7RJxJcoA
Subscribe on YouTube: https://youtube.com/channel/UC2KJHARTj6KRpKzLU1sVxBA
Join on Facebook: https://fb.com/beyondcodebootcamp
Follow on Twitter: https://twitter.com/@_beyondcode
AJ’s Live Streams:
Watch on Twitch: https://twitch.tv/coolaj86
Watch on Facebook: https://facebook.com/coolaj86
Subscribe on YouTube: https://youtube.com/coolaj86
Health, Wealth, Commitment
(My Morning Shower Thoughts as a Daily Lifestyle Vlog)
Join on Facebook: https://www.facebook.com/groups/5406824179391158
Subscribe on YouTube: https://www.youtube.com/channel/UCbw2SbqD0OofAEVF_T61wCQ
#softwaredevelopment #softwareengineer #webdevelopment #webdeveloper
#bash #practical bash #loops #scripts #variables and for loops in scripts #webdeveloper
1623225360
If you are using Linux, then you would definitely love the shell commands.
And if you are working with Python, then you may have tried to automate things. That’s a way to save time. You may also have some bash scripts to automate things.
Python is handy to write scripts than bash. And managing Python scripts are easy compared to bash scripts. You will find it difficult to maintain the bash scripts once it’s growing.
But what if you already have bash scripts that you want to run using Python?
Is there any way to execute the bash commands and scripts in Python?
Yeah, Python has a built-in module called subprocess which is used to execute the commands and scripts inside Python scripts. Let’s see how to execute bash commands and scripts in Python scripts in detail.
#development #python #how to run bash scripts using python #shell script from python #bash script #shell=