If you installed PyTorch-nightly on Linux via pip between December 25, 2022 and December 30, 2022, please uninstall it and torchtriton immediately, and use the latest nightly binaries (newer than Dec 30th 2022).
Read more on the official website.
Is a blog about python programming language. You can see my work with python programming language, tutorials and news.
id,firstname,lastname,email,email2,profession
100,Maud,Callista,Maud.Callista@yopmail.com,Maud.Callista@gmail.com,police officer
101,Justinn,Rona,Justinn.Rona@yopmail.com,Justinn.Rona@gmail.com,worker
102,Gabriellia,Robertson,Gabriellia.Robertson@yopmail.com,Gabriellia.Robertson@gmail.com,police officer
103,Gwenneth,Payson,Gwenneth.Payson@yopmail.com,Gwenneth.Payson@gmail.com,firefighter
104,Lynea,Robertson,Lynea.Robertson@yopmail.com,Lynea.Robertson@gmail.com,developer
import sys
import csv
from PyQt6.QtWidgets import QApplication, QMainWindow, QTableWidget, QTableWidgetItem
from PyQt6.QtCore import Qt
# the main window class
class MainWindow(QMainWindow):
# the init definition of the class
def __init__(self):
super().__init__()
# the window title
self.setWindowTitle('Table Viewer for any CSV file.')
# this create the table widget
self.table = QTableWidget(self)
# the table dimensions is set default
self.table.setColumnCount(0)
self.table.setRowCount(0)
# this read the CSV file named my.csv
with open('my.csv', 'r') as file:
# use the reader for file
reader = csv.reader(file)
# this get the column labels from the first row
headers = next(reader)
# this set the number of columns based on the number of headers
self.table.setColumnCount(len(headers))
# this set the horizontal header labels
self.table.setHorizontalHeaderLabels(headers)
# for each row iterate the rows in the CSV file
for row in reader:
# add a row to the table
row_index = self.table.rowCount()
self.table.insertRow(row_index)
# add data to cells
for col_index, cell in enumerate(row):
self.table.setItem(row_index, col_index, QTableWidgetItem(cell))
# setting for the table as the central widget
self.setCentralWidget(self.table)
# this run the application
if __name__ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec())
from sentinelsat import SentinelAPI, read_geojson, geojson_to_wkt
from datetime import date
# Connect to the Sentinel API
api = SentinelAPI('___', '___', 'https://scihub.copernicus.eu/dhus')
#
api.download('___from_copernicus_website___')
# Search for Sentinel-2 images covering a specific area
footprint = geojson_to_wkt(read_geojson('area_of_interest.geojson'))
products = api.query(footprint,
date=('20211201', '20211205'),
platformname='Sentinel-1')
# convert to Pandas DataFrame
products_df = api.to_dataframe(products)
print(products_df)
# sort and limit to first 5 sorted products
products_df_sorted = products_df.sort_values(['link'], ascending=[True])
products_df_sorted = products_df_sorted.head(5)
# download sorted and reduced products
api.download_all(products_df_sorted.index)
python test001.py
title ... productconsolidation
8f12995e-8f4b-4634-91bb-4971a1bdd0c3 S1B_IW_SLC__1SDV_20211201T160049_20211201T1601... ... NaN
c62ceac6-c9ac-409d-bea9-d1bc23b1b183 S1B_IW_GRDH_1SDV_20211201T160050_20211201T1601... ... NaN
2d1319c5-60af-468b-904a-5dfbdd5f205c S1B_IW_RAW__0SDV_20211201T160046_20211201T1601... ... SLICE
[3 rows x 36 columns]
Downloading S1B_IW_GRDH_1SDV_20211201T160050_20211201T160115_029834_038FB2_A390.zip: 100%|█| 929M/929M [02:44<00:00, 5.
Downloading products: 33%|██████████████████▋ | 1/3 [02:58<05:57, 178.58s/product]
Downloading S1B_IW_RAW__0SDV_20211201T160046_20211201T160119_029834_038FB2_D35D.zip: 83%|▊| 1.31G/1.58G [03:21<00:26,
Downloading S1B_IW_SLC__1SDV_20211201T160049_20211201T160116_029834_038FB2_AC13.zip: 31%|▎| 1.33G/4.35G [03:18<04:16,
...
pip3 install MoviePy --user
import moviepy.editor as moviepy
clip = moviepy.VideoFileClip("anime_effect_001.avi")
clip.write_videofile("MP4_anime_effect_001.mp4")
python moviepy_001.py
Moviepy - Building video MP4_anime_effect_001.mp4.
Moviepy - Writing video MP4_anime_effect_001.mp4
...
Moviepy - Done !
Moviepy - video ready MP4_anime_effect_001.mp4
pip3 install --user scamp
from scamp import *
import random
s = Session()
guitar = s.new_part("Guitar")
text = "this is a test text"
for char in text:
if char == " ":
wait(0.2)
elif char.isalnum():
for x in range (0,10):
guitar.play_note(ord(char) - random.randrange(50, 75), random.randint(0,5), random.random()/5)
else:
wait(0.2)
guitar.play_note(ord(char), 0.8, 0.06)
wait(0.2)
import bpy
# Set the object that the camera will orbit around
target_object = bpy.data.objects["MyObject"]
# Set the starting position for the camera
camera = bpy.data.objects["Camera"]
camera.location = (0, 0, 5)
# Set the number of degrees to rotate the camera around the object
degrees = 360
# Set the distance that the camera should be from the object
distance = 5
# Set the speed at which the camera should orbit
speed = 1
# Set the direction in which the camera should orbit (1 for clockwise, -1 for counter-clockwise)
direction = 1
# Calculate the number of frames needed for the camera to orbit
# around the object by the desired number of degrees
num_frames = degrees / speed
# Set the camera to track the object
bpy.ops.object.select_all(action="DESELECT")
camera.select_set(True)
bpy.context.view_layer.objects.active = camera
bpy.ops.object.track_set(type="TRACKTO")
# Animate the camera orbiting around the object
for frame in range(0, num_frames):
# Set the current frame
bpy.context.scene.frame_set(frame)
# Calculate the new position for the camera based on its distance from the object
x = distance * math.sin(math.radians(frame*speed*direction))
y = distance * math.cos(math.radians(frame*speed*direction))
camera.location = (x,y,0)
Python: Traceback (most recent call last):
...
TypeError: 'float' object cannot be interpreted as an integer
pip install streamlit
python -m streamlit hello
import streamlit as st
st.write("""
#testing streamlit
""")
python -m streamlit run myapp001.py
Welcome to Streamlit!
If you’d like to receive helpful onboarding emails, news, offers, promotions,
and the occasional swag, please enter your email address below. Otherwise,
leave this field blank.
Email: catafest@yahoo.com
You can find our privacy policy at https://streamlit.io/privacy-policy
Summary:
- This open source library collects usage statistics.
- We cannot see and do not store information contained inside Streamlit apps,
such as text, charts, images, etc.
- Telemetry data is stored in servers in the United States.
- If you'd like to opt out, add the following to %userprofile%/.streamlit/config.toml,
creating that file if necessary:
[browser]
gatherUsageStats = false
You can now view your Streamlit app in your browser.
...
. venv/bin/activate
git clone https://github.com/openai/openai-quickstart-python.git
cd openai-quickstart-python
pip install Flask
pip install -r requirements.txt --user
openai.api_key = "your_token"
python -m flask run
* Restarting with stat
* Debugger is active!
* Debugger PIN: 102-938-829
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [11/Dec/2022 16:13:06] "POST / HTTP/1.1" 302 -
127.0.0.1 - - [11/Dec/2022 16:13:06] "GET /?result=+The+Flash%2C+Speedy%2C+Sonic+the+Hedgehog HTTP/1.1" 200 -
127.0.0.1 - - [11/Dec/2022 16:13:06] "GET /static/main.css HTTP/1.1" 304 -
127.0.0.1 - - [11/Dec/2022 16:13:06] "GET /static/dog.png HTTP/1.1" 304 -
127.0.0.1 - - [11/Dec/2022 16:13:06] "GET /static/dog.png HTTP/1.1" 304 -
127.0.0.1 - - [11/Dec/2022 16:13:11] "POST / HTTP/1.1" 302 -
127.0.0.1 - - [11/Dec/2022 16:13:11] "GET /?result=+Speedy%2C+The+Flash%2C+Sonic HTTP/1.1" 200 -
127.0.0.1 - - [11/Dec/2022 16:13:12] "GET /static/main.css HTTP/1.1" 304 -
127.0.0.1 - - [11/Dec/2022 16:13:12] "GET /static/dog.png HTTP/1.1" 304 -