Skip to content

Instantly share code, notes, and snippets.

from langchain_openai import ChatOpenAI
from browser_use import Agent
import asyncio
import ipdb
import csv
llm = ChatOpenAI(model="gpt-4o")
async def main():
search_agent = Agent(
task="""
@Aameer
Aameer / overlay_text_over_image.py
Last active March 1, 2018 17:51
watermark text over images using Python with PIL and textwrap, by tweaking the widths you can control the max length of text allowed and it also does the word wrap and shows extra text in next line
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
import textwrap
base_image_location = "/home/aameer/Desktop/test.png" #base image location
W,H=(900, 100) #width and height of base image
font_location = "/home/aameer/Desktop/verdanab.ttf" #font used
output_image_location='/home/aameer/Desktop/' #location where output file will be stored
@Aameer
Aameer / linuxcp
Last active August 29, 2015 14:11
Implementation of the functionality of copy (cp) command in python. We are be able to copy files we are able to copy directories using a similar -r option, we are able to copy files forcefully using -f option and do not use any predefined libs that do the same like shutil, subprocess, etc.
import os
import sys
import stat
def copyfile(file_path, targer_dir):
if not (os.path.exists(file_path) and os.path.exists(target_dir) and os.path.isdir(target_dir)):
print "Enter valid arguments"
sys.exit()
if os.path.isdir(file_path):
os.chdir(file_path[:file_path.rindex('/')])