This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Optional | |
import aiosqlite | |
from fastapi import FastAPI, HTTPException, Depends | |
from sqlalchemy import Column, Integer, String, Table, ForeignKey, select, UniqueConstraint | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_scoped_session, async_sessionmaker | |
from sqlalchemy.orm import relationship, mapped_column, Mapped, backref, DeclarativeBase, selectinload | |
from pydantic import BaseModel as BaseSchema, ConfigDict | |
from contextlib import asynccontextmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table | |
from sqlalchemy.orm import sessionmaker, relationship, backref, declared_attr, Mapped | |
from sqlalchemy.orm import declarative_base, Mapped, mapped_column | |
from sqlalchemy.orm.exc import NoResultFound | |
from sqlalchemy.sql.expression import and_ | |
from sqlalchemy import select, func, union_all, text | |
import asyncio | |
from sqlalchemy.ext.asyncio import ( | |
AsyncSession, | |
create_async_engine, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey | |
from sqlalchemy.orm import declarative_base, relationship, selectin_polymorphic | |
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine | |
from sqlalchemy.orm import Mapped | |
from sqlalchemy.future import select | |
from sqlalchemy.ext.asyncio import ( | |
AsyncSession, | |
create_async_engine, | |
async_sessionmaker, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey | |
from sqlalchemy.orm import declarative_base, relationship, selectin_polymorphic | |
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine | |
from sqlalchemy.orm import Mapped | |
from sqlalchemy.future import select | |
from sqlalchemy.ext.asyncio import ( | |
AsyncSession, | |
create_async_engine, | |
async_sessionmaker, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine, ForeignKey, Column, Integer, String | |
from sqlalchemy.orm import declarative_base, relationship, sessionmaker | |
from sqlalchemy.orm import Mapped, mapped_column | |
Base = declarative_base() | |
class Entity(Base): | |
__tablename__ = 'entities' | |
id = Column(Integer, primary_key=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy import create_engine, ForeignKey, Column, Integer, String | |
from sqlalchemy.orm import declarative_base, relationship, sessionmaker | |
from sqlalchemy.orm import Mapped, mapped_column | |
Base = declarative_base() | |
class Entity(Base): | |
__tablename__ = "entities" | |
id = Column(Integer, primary_key=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install pycharm v1 ------------------------------------------ | |
sudo add-apt-repository ppa:mystic-mirage/pycharm | |
sudo apt-get update | |
sudo apt-get install pycharm | |
# install pycharm v2 ------------------------------------------ | |
cd ~/Downloads/ | |
# change version | |
pycharm_version='2016.2' | |
pycharmurl='http://download-cf.jetbrains.com/python/pycharm-professional-'${pycharm_version}'.tar.gz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.OpenMaya as om | |
from imath import * | |
from alembic.Abc import * | |
from alembic.AbcGeom import * | |
import math | |
import alembic | |
def get_mesh_data(): | |
selection = om.MSelectionList() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import socketio | |
sio = socketio.AsyncClient(logger=True, engineio_logger=True) | |
async def fun(): | |
await sio.connect( | |
"http://127.0.0.1:8001/ws", | |
transports=['websocket'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Start independed process | |
Dont use env argument | |
""" | |
import os, subprocess | |
cmd = ['executable', 'arg1', 'arg2', 'arg3'] | |
devnull = open(os.devnull, 'wb') | |
DETACHED_PROCESS = 0x00000008 | |
subprocess.Popen(cmd, stdout=devnull, stderr=devnull, creationflags=DETACHED_PROCESS) |
NewerOlder