Posts

Showing posts from December, 2023

Crop Screenshot Save Path (WinLogo+Shift+S)

 C:\Users\avinash\AppData\Local\Packages\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\TempState\ScreenClip

Tkinter Dragable Screen

     # Tkinter Dragable Screen     import tkinter as tk     def start_drag ( event ):         root.x = event.x         root.y = event.y     def stop_drag ( event ):         del root.x         del root.y     def drag ( event ):         try :             deltax = event.x - root.x             deltay = event.y - root.y             x = root. winfo_x () + deltax             y = root. winfo_y () + deltay             root. geometry ( f "+ { x } + { y } " )         except AttributeError :             pass     root = tk. Tk ()     root. geometry (" 400x300 ")     # Create a button to close the window...

how to create a executable (exe) file for GUI like tkinter command in python

how to create a executable (exe) file for GUI like tkinter command in python pyinstaller - w main.py

code copy paste

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Document</ title >     <!-- Replace agate with your theme - find themes at https://highlightjs.org/demo -->     < link rel =" stylesheet "         href =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/tomorrow-night-bright.min.css ">     <!-- For icons -->     < script type =" module " src =" https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js "></ script >     < script nomodule src =" https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js "></ script >     < style >         . code-block {             position: relative ...

syntax highlight using highlightjs

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Document</ title >     <!-- replace agate with your theme <-- for find theme use this website https://highlightjs.org/demo  -->     < link href =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/agate.min.css " rel =" stylesheet ">     </ link > </ head > < body >     < pre >     < code class =" language-html "> & lt ;!DOCTYPE html& gt ; & lt ;html& gt ; & lt ;head& gt ; & lt ;title& gt ;Hello World& lt ;/title& gt ; & lt ;/head& gt ; & lt ;body& gt ; & lt ;h1& gt ;Hello, World!& lt ;/h1& gt ; & lt ;/body& gt ; & lt ;/html& gt ; ...

Copy HTML Coped Text From User using javascript

  <! DOCTYPE html > < html lang =" en "> < head >     < meta charset =" UTF-8 ">     < meta name =" viewport " content =" width=device-width, initial-scale=1.0 ">     < title >Document</ title > </ head > < body >     < h1 >HTML Clipbaord</ h1 >     < script >         const init = async () => {             let clipboardData = await navigator . clipboard . read ();             const htmlData = await clipboardData [ 0 ]. getType (" text/html ");             console . log (" HTML Content: ", await htmlData . text ());         }         init ()     </ script > </ body > </ html >

Python send image using request

import requests def uplaod_image_on_server ( url , image_path ):     # Open the image file in binary mode     with open ( image_path , " rb ") as file :         # Create a dictionary with the file parameter and the image file         files = {" screenshot ": (image_path, file , " image/jpeg ")}         # post data         payload = {         " SystemName ": " DESKTOP112 ",         }         # Make the POST request with the image         response = requests. post ( url , files = files , data = payload )     # Print the response     print ( response . text ) uplaodImageUrl = " http://localhost/testing/ " image_path = " ./image.png " uplaod_image_on_server ( uplaodImageUrl , image_path )

Running a Python Script in the Background with .exe and Startup

Running a Python Script in the Background with .exe and Startup If you've ever wanted to run a Python script discreetly in the background and have it start automatically when your PC boots up, you can achieve this by converting your Python script into a standalone executable (.exe) using PyInstaller. Below is a step-by-step guide along with a sample Python script: Step 1: Install PyInstaller Ensure you have PyInstaller installed. If not, run the following command in your terminal or command prompt: pip install pyinstaller Step 1:  Convert Python Script to .exe Navigate to the directory containing your Python script and run the following command to convert it into a single executable file: pyinstaller -- onefile -- noconsole your_script_name.py Replace your_script_name.py with the actual name of your Python script. Step 3: Sample Python Script Here's a sample Python script that creates a shortcut in the Windows Startup folder, ensuring your script runs in the background when you...

Ensuring File Creation in the Current Directory when Converting Python (.py) Script to Executable (.exe).

Image
Ensuring File Creation in the Current Directory when Converting Python (.py) Script to Executable (.exe). When you create a file in Python within the current directory, everything works seamlessly. However, if you decide to convert your Python script into a standalone executable (.exe) using tools like PyInstaller, you might encounter a situation where the file is created in a temporary folder, and upon code execution completion, it mysteriously disappears. To overcome this challenge and ensure that your file appears in the current directory, consider using the following code snippet: Explanation: In the above code, we use sys.frozen to check if the script is running in a frozen (compiled into an executable) environment. This is particularly relevant when the script is converted to a standalone executable using tools like PyInstaller. When the script is running as a .py file, myPath is set to the absolute path of the script using os.path.abspath(__file__). When the script is running as...

Python add your current file in startup folder in windows (💀)

Image
 Add This Code Above Your Code An Then This Code Create A Shortcut On Your Windows Pc Automatically. You Can See Shorcut Added Or Not Using CTR+R And Then Enter This Text In Run Window shell:startup.   not recommended    if you want to run this file like a malware you can install Pyinstaller a using    pip install pyinstaller   and then make your code .exe to do this do like this    pyinstaller --onefile --noconsole your_script.py   if your run this it will make a file in your system dist/fie.exe  and then run this file it's if you run one time it's run your program in backgorund   add a while loop to run continues in background

How to your custom .exe file to startup folder to run when pc restart or shutdown

Image
 How to your custom .exe file to startup folder to run when pc restart or shutdown      using this code you can add your custom .exe file in the python startup folder      this file run automatically wen you restart or start you windows machine 

Create a custom shortcut using python code . ( lnk file )

Image
Create a custom shortcut using python code. ( lnk file )    Using this code you can add your custom shortcut of python program by your custom path   read code carefully   don't change code .lnk before the .lnk file add your shortcut destination

Find Startup Program Folder Using Python Code

Image
  using this code we can find what is locations of startup programs in windows you can also find using CTR+R then shell:startup

How To add .env file in vite + react.

Image

tailwind css get full config file command

Image
Image
  Fast Config Tailwindcss

window log + shift + s save location

 C:\Users\%username%\AppData\Local\Packages\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\TempState\ScreenClip

Retrieve Your Local WiFi IP Address in Node.js

Image
  Learn how to use Node.js to find your device's local IP address on a WiFi network. This guide provides a step-by-step solution for obtaining the local IP, enabling you to efficiently manage network-related tasks and enhance your Node.js applications.

How to run nodejs on router ip and localhost also

Image