nohup $python program.py &
-
first:
sudo nano /etc/ssh/sshd_config
-
add the following lines:
TCPKeepAlive no
import folium | |
ref_html = r'<a href="http://www.shenyang.gov.cn/" target="_blank"> I am here </a>' | |
pop_html = folium.Popup(folium.Html(ref_html, script=True)) | |
map_1 = folium.Map(location=[41.8057, 123.4315], zoom_start=12, | |
tiles='Stamen Terrain') | |
folium.Marker( | |
location = [41.8057, 123.4315], | |
popup = pop_html).add_to(map_1) |
import openpyxl | |
import numpy as np | |
import pandas as pd | |
def get_column_letter(col_idx): | |
"""Convert a column number into a column letter (3 -> 'C') | |
Right shift the column col_idx by 26 to find column letters in reverse | |
order. These numbers are 1-based, and can be converted to ASCII | |
ordinals by adding 64. | |
""" |
import sqlite3, os | |
def vacuum(db_name): | |
print("Filesize of {} before vaccum is {:,d} bytes.". | |
format(db_name, os.stat(db_name).st_size) | |
) | |
conn = sqlite3.connect(db_name) | |
isolation = conn.isolation_level | |
print(isolation) | |
conn.isolation_level = None |
def dict_inter(dict_in, flds): | |
dict_out = { | |
key: dict_in[key] for key in flds if key in dict_in.keys() | |
} | |
return dict_out | |
def dict_diff(dict_in, flds): | |
dict_out = { | |
key: dict_in[key] for key in dict_in.keys() if key not in flds | |
} |
using the csv
module from the standard library and the open method to avoid leaving the file open.
The key point is using 'a'
for appending when you open the file.
import csv
fields=['first','second','third']
with open(r'name', 'a') as f:
writer = csv.writer(f)
writer.writerow(fields)
mongodump --db=<old_db_name> --collection=<collection_name> --out=data_directory/
tar -zcvf archive.tar.gz data_directory/
mongorestore --db=<new_db_name> --collection=<collection_name> data/<db_name>/<collection_name>.bson
import pymongo, json
def db_connection(db_name, collection_name):
client = pymongo.MongoClient('mongodb://localhost:27017/')
In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.
The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.
In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.
The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.