- For Windows
python -m venv --prompt <venv_promt> <venv_directory> - For Linux
python3 -m venv --prompt <venv_promt> <venv_directory>
- For Windows
<venv_directory>\Scripts\activate.bat - For Linux
source <venv_directory>/bin/activate
| import os | |
| import sys | |
| import inspect | |
| currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | |
| #print(currentdir) | |
| parentdir = os.path.dirname(currentdir) | |
| lib_path = os.path.join(parentdir,'src') | |
| #print(parentdir, lib_path) | |
| sys.path.insert(0,lib_path) |
| from dataclasses import dataclass, field | |
| from pprint import pprint | |
| import inspect | |
| @dataclass(frozen=True, init= False) | |
| class Dimension: | |
| height: float | |
| width: float | |
| depth: float |
| @dataclass(frozen=True, init= False) | |
| class Dimension: | |
| height: float | |
| width: float | |
| depth: float | |
| def __init__(self,height,width,depth ): | |
| object.__setattr__(self, "height", int(round(height))) | |
| object.__setattr__(self, "width", int(round(width))) | |
| object.__setattr__(self, "depth", int(round(depth))) |
| from dataclasses import dataclass, field | |
| from pprint import pprint | |
| import inspect | |
| @dataclass(frozen=True) | |
| class Dimension: | |
| height: float | |
| width: float | |
| depth: float |
| /* | |
| [dependencies] | |
| sqlx = { version = "0.5.9", features = [ "runtime-async-std-native-tls", "sqlite" ] } | |
| async-std = { version = "1.6", features = [ "attributes" ] } | |
| futures = "0.3.18" | |
| */ | |
| use std::result::Result; | |
| use sqlx::{sqlite::SqliteQueryResult, Sqlite, SqlitePool, migrate::MigrateDatabase}; |
| private registerListeners() { | |
| appWindow.listen('config-init', event => { | |
| console.log('registerListeners :', event.payload, event.event) | |
| }) | |
| appWindow.listen('page-loaded', event => { | |
| //console.log('page-loaded :', event.payload, event.event) | |
| appWindow.show() | |
| }) | |
| appWindow.once('tauri://close-requested', this.window_close_handeler) | |
| appWindow.once('tauri://destroyed', this.window_close_handeler) |
| use tauri::{plugin::Plugin, Runtime, Invoke, State, Window, PageLoadPayload, Manager}; | |
| use tauri::async_runtime::Mutex; | |
| use std::sync::Arc; | |
| use super::AppConfig; | |
| type Tconfig = Arc<Mutex<AppConfig>>; | |
| pub struct ConfigPlugin<R: Runtime> { | |
| invoke_handler: Box<dyn Fn(Invoke<R>) + Send + Sync>, | |
| } |
| use std::path::PathBuf; | |
| use std::default::Default; | |
| use std::{fs::File, fs}; | |
| use std::io::{prelude::*,Error,ErrorKind}; | |
| use serde::{Serialize, Deserialize}; | |
| use tauri::{Size,PhysicalSize, Position, PhysicalPosition}; | |
| pub mod config_plugin; |
python -m venv --prompt <venv_promt> <venv_directory>python3 -m venv --prompt <venv_promt> <venv_directory><venv_directory>\Scripts\activate.batsource <venv_directory>/bin/activate