This colab notebook named catafest_050.ipynb will let you to get images from imdb.com by the name of the actor/actress.
You can find this notebook on my GitHub project.
Is a blog about python programming language. You can see my work with python programming language, tutorials and news.
import time
from plyer import notification
if __name__ == "__main__":
while True:
notification.notify(title="Test",message="Text message",timeout=10)
time.sleep(3000)
import pyautogui
import time
# Display a short notification to prompt the user to activate the modal dialog window
print("Please activate the modal dialog window.")
# Wait for the user to activate the modal dialog window (you can click in the dialog window)
time.sleep(10) # Wait 10 seconds or enough time to activate the window
# Get the coordinates where you want to read the text on the label
x_label = 200 # Replace with the correct x coordinates
y_label = 300 # Replace with the correct y coordinates
# Move the mouse cursor to the coordinates of the label
pyautogui.moveTo(x_label, y_label)
# Select the text in the label using the mouse
pyautogui.dragTo(x_label + 200, y_label, duration=1) # Substitute the appropriate coordinates and duration
# Copies the selected text to the clipboard
pyautogui.hotkey("ctrl", "c")
# You can use the clipboard to access the read text
import clipboard
text_copied = clipboard.paste()
bl_info = {
"name": "Tools by catafest",
"blender": (3, 0, 0),
"category": "3D View",
}
import bpy
from bpy.types import Operator, Panel
from bpy.props import StringProperty
try:
import importlib
importlib.import_module("Pillow")
PIL_installed = True
except ImportError:
PIL_installed = False
def install_pillow():
import subprocess
try:
subprocess.run([bpy.app.binary_path, '--python-exit-code', '1', '-m', 'ensurepip'])
subprocess.check_call([bpy.app.binary_path, '-m', 'pip', 'install', 'Pillow'])
except subprocess.CalledProcessError as e:
print("Eroare la instalarea Pillow:", e)
# Operator pentru a afișa fereastra modală cu informații despre instalarea Pillow
class CATAFEST_IMAGES_OT_show_pillow_message(Operator):
bl_idname = "catafest.show_pillow_message"
bl_label = "Show Pillow Message"
def execute(self, context):
global PIL_installed
message = "Pillow este instalat." if PIL_installed else "Pillow nu este instalat."
# Dacă Pillow nu este instalat, încercați să-l instalați
if not PIL_installed:
install_pillow()
try:
import importlib
importlib.import_module("Pillow")
PIL_installed = True
message = "Pillow a fost instalat cu succes!" if PIL_installed else "Eroare la instalarea Pillow."
except ImportError:
PIL_installed = False
# Afișați fereastra modală în centrul ecranului
bpy.ops.catafest.show_modal_message('INVOKE_DEFAULT', title="Starea Pillow", message=message)
return {'FINISHED'}
def invoke(self, context, event):
return self.execute(context)
# Operator pentru a afișa fereastra modală personalizată
class CATAFEST_IMAGES_OT_show_modal_message(Operator):
bl_idname = "catafest.show_modal_message"
bl_label = "Show Modal Message"
title: bpy.props.StringProperty(default="Message")
message: bpy.props.StringProperty(default="")
def execute(self, context):
return {'FINISHED'}
def invoke(self, context, event):
wm = context.window_manager
return wm.invoke_props_dialog(self, width=400)
def draw(self, context):
layout = self.layout
layout.label(text=self.message)
# Panel pentru bara laterală din 3D View
class VIEW3D_PT_tools_image(Panel):
bl_label = "Images"
bl_idname = "VIEW3D_PT_tools_image"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = 'Tools by catafest'
def draw(self, context):
layout = self.layout
layout.operator(CATAFEST_IMAGES_OT_show_modal_message.bl_idname)
layout.operator(CATAFEST_IMAGES_OT_show_pillow_message.bl_idname)
def register():
bpy.utils.register_class(CATAFEST_IMAGES_OT_show_modal_message)
bpy.utils.register_class(CATAFEST_IMAGES_OT_show_pillow_message)
bpy.utils.register_class(VIEW3D_PT_tools_image)
def unregister():
bpy.utils.unregister_class(CATAFEST_IMAGES_OT_show_modal_message)
bpy.utils.unregister_class(CATAFEST_IMAGES_OT_show_pillow_message)
bpy.utils.unregister_class(VIEW3D_PT_tools_image)
if __name__ == "__main__":
register()
python.exe
Could not find platform independent libraries <prefix>
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python.exe'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = 'C:\Python311\Lib'
sys._base_executable = 'C:\\Users\\catafest\\AppData\\Local\\Programs\\Python\\Python311\\python.exe'
sys.base_prefix = 'C:\\Python311'
sys.base_exec_prefix = 'C:\\Python311'
sys.platlibdir = 'DLLs'
sys.executable = 'C:\\Users\\catafest\\AppData\\Local\\Programs\\Python\\Python311\\python.exe'
sys.prefix = 'C:\\Python311'
sys.exec_prefix = 'C:\\Python311'
sys.path = [
'C:\\Users\\catafest\\AppData\\Local\\Programs\\Python\\Python311\\python311.zip',
'C:\\Python311\\DLLs',
'C:\\Python311\\Lib',
'C:\\Users\\catafest\\AppData\\Local\\Programs\\Python\\Python311',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00000020 (most recent call first):
<no Python frame>
NameError: name 'sys' is not defined. Did you forget to import 'sys'?
$ pip install PyGobject
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
$ whereis sway
$ env/bin/pytest --sway=/usr/bin/sway
$ sudo env/bin/pytest --sway=/usr/bin/sway
mkdir rsconnect-python-001
cd rsconnect-python-001
pip install rsconnect-python --user
Collecting rsconnect-python
rsconnect add --account catafest --name catafest --token YOUR_TOKEN --secret YOUR_SECRET
Detected the following inputs:
name: COMMANDLINE
insecure: DEFAULT
account: COMMANDLINE
token: COMMANDLINE
secret: COMMANDLINE
Checking shinyapps.io credential... [OK]
Added shinyapps.io credential "catafest".
library(shiny)
# Definirea interfeței utilizatorului
ui <- fluidPage(
titlePanel("Aplicație Shiny Simplă"),
sidebarLayout(
sidebarPanel(
numericInput("num", "Introduceți un număr:", value = 1),
actionButton("goButton", "Generează")
),
mainPanel(
textOutput("rezultat")
)
)
)
# Definirea serverului
server <- function(input, output) {
observeEvent(input$goButton, {
num <- input$num
output$rezultat <- renderText({
paste("Numărul introdus este:", num)
})
})
}
# Crearea aplicației Shiny
shinyApp(ui, server)
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
# Creați o aplicație Dash
app = dash.Dash(__name__)
# Definiți aspectul și structura aplicației
app.layout = html.Div([
html.H1("Aplicație Dash Simplă"),
dcc.Graph(id='grafic'),
dcc.Input(id='input-numar', type='number', value=1),
html.Div(id='rezultat')
])
# Definiți funcția callback pentru actualizarea graficului
@app.callback(
Output('grafic', 'figure'),
Input('input-numar', 'value')
)
def actualizare_grafic(numar):
# Implementați logica de actualizare a graficului aici
# Exemplu simplu: Un grafic cu o linie dreaptă cu panta egală cu numărul introdus
import plotly.express as px
import pandas as pd
data = pd.DataFrame({'x': range(10), 'y': [numar * x for x in range(10)]})
fig = px.line(data, x='x', y='y', title='Graficul personalizat')
return fig
# Rulează aplicația
if __name__ == '__main__':
app.run_server(debug=True)
shiny::runApp("C:/PythonProjects/rsconnect-python-001/")
Listening on http://127.0.0.1:7036
>rsconnect deploy shiny . --name catafest --title test
[WARNING] 2023-09-01T22:28:10+0300 Can't determine entrypoint; defaulting to 'app'
Warning: Capturing the environment using 'pip freeze'.
Consider creating a requirements.txt file instead.
...
Task done: Stopping old instances
Application successfully deployed to https://catafest.shinyapps.io/test/
...
deploying - Starting instances
Task done: Stopping old instances
Application successfully deployed to https://catafest.shinyapps.io/rsconnect-python-001/
←[32;20m [OK]
←[0m←[0mSaving deployed information...←[0m←[32;20m [OK]
←[0m
[notice] A new release of pip is available: 23.1.2 -> 23.2.1
[notice] To update, run: /srv/connect/venv/bin/python3 -m pip install --upgrade pip
[2023-09-01T22:43:31.378864990+0000] Copying file manifest.json
←[31;20m [ERROR]: Application deployment failed with error: Unhandled Exception: Child Task 1332185768 error:
Unhandled Exception: 599
←[0mError: Application deployment failed with error: Unhandled Exception: Child Task 1332185768 error:
Unhandled Exception: 599
pip install capstone --user
Collecting capstone
Obtaining dependency information for capstone from https://files.pythonhosted.org/packages/d0/dd/b28df50316ca193
dd1275a4c47115a720796d
9e1501c1888c4bfa5dc2260/capstone-5.0.1-py3-none-win_amd64.whl.metadata
Downloading capstone-5.0.1-py3-none-win_amd64.whl.metadata (3.5 kB)
Downloading capstone-5.0.1-py3-none-win_amd64.whl (1.3 MB)
---------------------------------------- 1.3/1.3 MB 1.6 MB/s eta 0:00:00
Installing collected packages: capstone
Successfully installed capstone-5.0.1
pip install pefile --user
Collecting pefile
Downloading pefile-2023.2.7-py3-none-any.whl (71 kB)
---------------------------------------- 71.8/71.8 kB 564.7 kB/s eta 0:00:00
Installing collected packages: pefile
Successfully installed pefile-2023.2.7
format PE64 GUI 5.0
entry start
include 'INCLUDE\win64a.inc'
section '.text' code readable executable
start:
push rbp
invoke GetModuleHandle,0
invoke DialogBoxParam,rax,37,HWND_DESKTOP,DialogProc,0
invoke ExitProcess,0
proc DialogProc uses rbx rsi rdi,hWnd,wMsg,wParam,lParam
mov [hWnd],rcx
mov [wMsg],rdx
mov [wParam],r8
mov [lParam],r9
cmp [wMsg],WM_COMMAND
je wmcommand
cmp [wMsg],WM_CLOSE
je wmclose
cmp [wMsg],WM_SYSCOMMAND
je wmsyscommand
xor rax,rax
jmp finish
wmsyscommand:
cmp [wParam],SC_RESTORE
je sc_restore
invoke DefWindowProc,[hWnd],[wMsg],[wParam],[lParam]
ret
sc_restore:
invoke AnimateWindow,[hWnd],DWORD 1000,0x00040004 ;HERE IT IS
invoke ShowWindow,[hWnd],SW_RESTORE
mov rax,1
ret
wmcommand:
cmp [wParam],BN_CLICKED shl 16 + IDOK
jne processed
invoke ShowWindow,[hWnd],SW_MINIMIZE
ret
wmclose:
invoke EndDialog,[hWnd],0
processed:
mov rax,1
ret ; this no need and use cmp to get error
; cmp rax,0
; je show_error
; show_error:
; invoke GetLastError ;must call this first and save the result before doing anything else
; invoke wsprintf,...
; invoke MessageBox,...
finish:
ret
endp
section '.idata' import data readable writeable
library kernel,'KERNEL32.DLL',\
user,'USER32.DLL'
import kernel,\
GetModuleHandle,'GetModuleHandleA',\
ExitProcess,'ExitProcess'
import user,\
DialogBoxParam,'DialogBoxParamA',\
CheckRadioButton,'CheckRadioButton',\
GetDlgItemText,'GetDlgItemTextA',\
IsDlgButtonChecked,'IsDlgButtonChecked',\
MessageBox,'MessageBoxA',\
DefWindowProc,'DefWindowProcA',\
EndDialog,'EndDialog',\
AnimateWindow,'AnimateWindow',\
ShowWindow,'ShowWindow'
section '.rsrc' resource data readable
directory RT_DIALOG,dialogs
resource dialogs,\
37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration
dialog demonstration,'Create message box',70,70,190,175,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME
dialogitem 'BUTTON','OK',IDOK,85,150,45,15,WS_VISIBLE+WS_TABSTOP+BS_DEFPUSHBUTTON
enddialog
import pefile
from capstone import *
exe_file = 'test_001_no_err_imp.EXE'
pe = pefile.PE(exe_file)
# find text section
offset = False
for section in pe.sections:
if section.Name == b'.text\x00\x00\x00':
offset = section.VirtualAddress
codePtr = section.PointerToRawData
codeEndPtr = codePtr+section.SizeOfRawData
break
code = pe.get_memory_mapped_image()[codePtr:codeEndPtr]
# start disassembling text section
md = Cs(CS_ARCH_X86, CS_MODE_32)
md.detail = True
if offset:
for i in md.disasm(code, offset):
print('0x%x:\t%s\t%s' % (i.address, i.mnemonic, i.op_str))
python capstone_test_001.py
0x1000: push ebp
0x1001: dec eax
0x1002: sub esp, 0x20
0x1005: dec eax
0x1006: mov ecx, 0
0x100c: call dword ptr [0x105e]
0x1012: dec eax
0x1013: add esp, 0x20
0x1016: dec eax
0x1017: sub esp, 0x30
0x101a: dec eax
0x101b: mov ecx, eax
0x101d: dec eax
0x101e: mov edx, 0x25
0x1024: dec ecx
0x1025: mov eax, 0
0x102b: dec ecx
0x102c: mov ecx, 0x40105a
0x1032: dec eax
0x1033: mov dword ptr [esp + 0x20], 0
0x103b: call dword ptr [0x109f]
0x1041: dec eax
0x1042: add esp, 0x30
0x1045: dec eax
0x1046: sub esp, 0x20
0x1049: dec eax
0x104a: mov ecx, 0
0x1050: call dword ptr [0x1022]
0x1056: dec eax
0x1057: add esp, 0x20
0x105a: push ebp
0x105b: dec eax
0x105c: mov ebp, esp
0x105e: dec eax
0x105f: sub esp, 8
0x1062: push ebx
0x1063: push esi
0x1064: push edi
0x1065: dec eax
0x1066: mov dword ptr [ebp + 0x10], ecx
0x1069: dec eax
0x106a: mov dword ptr [ebp + 0x18], edx
0x106d: dec esp
0x106e: mov dword ptr [ebp + 0x20], eax
0x1071: dec esp
0x1072: mov dword ptr [ebp + 0x28], ecx
0x1075: dec eax
0x1076: cmp dword ptr [ebp + 0x18], 0x111
0x107d: je 0x1110
0x1083: dec eax
0x1084: cmp dword ptr [ebp + 0x18], 0x10
0x1088: je 0x1135
0x108e: dec eax
0x108f: cmp dword ptr [ebp + 0x18], 0x112
0x1096: je 0x10a0
0x1098: dec eax
0x1099: xor eax, eax
0x109b: jmp 0x115a
0x10a0: dec eax
0x10a1: cmp dword ptr [ebp + 0x20], 0xf120
0x10a8: je 0x10cd
0x10aa: dec eax
0x10ab: sub esp, 0x20
0x10ae: dec eax
0x10af: mov ecx, dword ptr [ebp + 0x10]
0x10b2: dec eax
0x10b3: mov edx, dword ptr [ebp + 0x18]
0x10b6: dec esp
0x10b7: mov eax, dword ptr [ebp + 0x20]
0x10ba: dec esp
0x10bb: mov ecx, dword ptr [ebp + 0x28]
0x10be: call dword ptr [0x1024]
0x10c4: dec eax
0x10c5: add esp, 0x20
0x10c8: pop edi
0x10c9: pop esi
0x10ca: pop ebx
0x10cb: leave
0x10cc: ret
0x10cd: dec eax
0x10ce: sub esp, 0x20
0x10d1: dec eax
0x10d2: mov ecx, dword ptr [ebp + 0x10]
0x10d5: mov edx, 0x3e8
0x10da: dec ecx
0x10db: mov eax, 0x40004
0x10e1: call dword ptr [0x1011]
0x10e7: dec eax
0x10e8: add esp, 0x20
0x10eb: dec eax
0x10ec: sub esp, 0x20
0x10ef: dec eax
0x10f0: mov ecx, dword ptr [ebp + 0x10]
0x10f3: dec eax
0x10f4: mov edx, 9
0x10fa: call dword ptr [0x1000]
0x1100: dec eax
0x1101: add esp, 0x20
0x1104: dec eax
0x1105: mov eax, 1
0x110b: pop edi
0x110c: pop esi
0x110d: pop ebx
0x110e: leave
0x110f: ret
0x1110: dec eax
0x1111: cmp dword ptr [ebp + 0x20], 1
0x1115: jne 0x114e
0x1117: dec eax
0x1118: sub esp, 0x20
0x111b: dec eax
0x111c: mov ecx, dword ptr [ebp + 0x10]
0x111f: dec eax
0x1120: mov edx, 6
0x1126: call dword ptr [0xfd4]
0x112c: dec eax
0x112d: add esp, 0x20
0x1130: pop edi
0x1131: pop esi
0x1132: pop ebx
0x1133: leave
0x1134: ret
0x1135: dec eax
0x1136: sub esp, 0x20
0x1139: dec eax
0x113a: mov ecx, dword ptr [ebp + 0x10]
0x113d: dec eax
0x113e: mov edx, 0
0x1144: call dword ptr [0xfa6]
0x114a: dec eax
0x114b: add esp, 0x20
0x114e: dec eax
0x114f: mov eax, 1
0x1155: pop edi
0x1156: pop esi
0x1157: pop ebx
0x1158: leave
0x1159: ret
0x115a: pop edi
0x115b: pop esi
0x115c: pop ebx
0x115d: leave
0x115e: ret
0x115f: add byte ptr [eax], al
0x1161: add byte ptr [eax], al
0x1163: add byte ptr [eax], al
0x1165: add byte ptr [eax], al
0x1167: add byte ptr [eax], al
0x1169: add byte ptr [eax], al
0x116b: add byte ptr [eax], al
0x116d: add byte ptr [eax], al
0x116f: add byte ptr [eax], al
0x1171: add byte ptr [eax], al
0x1173: add byte ptr [eax], al
0x1175: add byte ptr [eax], al
0x1177: add byte ptr [eax], al
0x1179: add byte ptr [eax], al
0x117b: add byte ptr [eax], al
0x117d: add byte ptr [eax], al
0x117f: add byte ptr [eax], al
0x1181: add byte ptr [eax], al
0x1183: add byte ptr [eax], al
0x1185: add byte ptr [eax], al
0x1187: add byte ptr [eax], al
0x1189: add byte ptr [eax], al
0x118b: add byte ptr [eax], al
0x118d: add byte ptr [eax], al
0x118f: add byte ptr [eax], al
0x1191: add byte ptr [eax], al
0x1193: add byte ptr [eax], al
0x1195: add byte ptr [eax], al
0x1197: add byte ptr [eax], al
0x1199: add byte ptr [eax], al
0x119b: add byte ptr [eax], al
0x119d: add byte ptr [eax], al
0x119f: add byte ptr [eax], al
0x11a1: add byte ptr [eax], al
0x11a3: add byte ptr [eax], al
0x11a5: add byte ptr [eax], al
0x11a7: add byte ptr [eax], al
0x11a9: add byte ptr [eax], al
0x11ab: add byte ptr [eax], al
0x11ad: add byte ptr [eax], al
0x11af: add byte ptr [eax], al
0x11b1: add byte ptr [eax], al
0x11b3: add byte ptr [eax], al
0x11b5: add byte ptr [eax], al
0x11b7: add byte ptr [eax], al
0x11b9: add byte ptr [eax], al
0x11bb: add byte ptr [eax], al
0x11bd: add byte ptr [eax], al
0x11bf: add byte ptr [eax], al
0x11c1: add byte ptr [eax], al
0x11c3: add byte ptr [eax], al
0x11c5: add byte ptr [eax], al
0x11c7: add byte ptr [eax], al
0x11c9: add byte ptr [eax], al
0x11cb: add byte ptr [eax], al
0x11cd: add byte ptr [eax], al
0x11cf: add byte ptr [eax], al
0x11d1: add byte ptr [eax], al
0x11d3: add byte ptr [eax], al
0x11d5: add byte ptr [eax], al
0x11d7: add byte ptr [eax], al
0x11d9: add byte ptr [eax], al
0x11db: add byte ptr [eax], al
0x11dd: add byte ptr [eax], al
0x11df: add byte ptr [eax], al
0x11e1: add byte ptr [eax], al
0x11e3: add byte ptr [eax], al
0x11e5: add byte ptr [eax], al
0x11e7: add byte ptr [eax], al
0x11e9: add byte ptr [eax], al
0x11eb: add byte ptr [eax], al
0x11ed: add byte ptr [eax], al
0x11ef: add byte ptr [eax], al
0x11f1: add byte ptr [eax], al
0x11f3: add byte ptr [eax], al
0x11f5: add byte ptr [eax], al
0x11f7: add byte ptr [eax], al
0x11f9: add byte ptr [eax], al
0x11fb: add byte ptr [eax], al
0x11fd: add byte ptr [eax], al
# clone repository and navigate to root directory
git clone https://github.com/roboflow/supervision.git
cd supervision
# setup python environment and activate it
python3 -m venv venv
source venv/bin/activate
# headless install
pip install -e "."
# desktop install
pip install -e ".[desktop]"