Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python how to be able to use any python file you made on all projects

# Step 1: Navigate to C:UsersrighAppDataLocalPackagesPythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0LocalCachelocal-packagesPython310site-packages
# Step 2: Create a new folder. The name of the folder will be what you want to call the module.
# Step 3: Inside the folder you created, create a file called "__init__.py" (Two leading underscores and two trailing underscores).
# Step 4: Inside __init__.py, store all functions and classes you will want to use for your project. You can import your module like this:
import my_module

# Tip: If you want to create more files for more functions, create another python file in the directory you created. Name it whatever you would like. (We will be using "test")
# Import your file like this:
import my_module.test
Comment

PREVIOUS NEXT
Code Example
Python :: capitalise.texts 
Python :: print("ola") 
Python :: add constant to all values of columns in dataframe python 
Python :: python scroll 
Python :: table is not creating in django 
Python :: IndexError: child index out of range in parsing xml for object detection 
Python :: how to use displacy 
Python :: should i learn c++ or python 
Python :: print numbers with underscores python 
Python :: How to pass a data frame as parameter to a SQL query in Python? 
Python :: how to keep old content when using write in python 
Python :: free function in python 
Python :: add a third dimension matrix dataset python 
Python :: generator expressions python 
Python :: python rename columns 
Python :: how to fix invalid salt in python flask 
Python :: py3 dict values 
Python :: recursively count string 
Python :: dd-mm-yy to yyyy-mm-dd in python 
Python :: qq plot using seaborn with regression line 
Python :: how to do fibonacci sequence in python 
Python :: find prime numbers in a given range for big input python 
Python :: how to use methods defined within class 
Python :: sum of values with none 
Python :: get decimal value of char python 
Python :: pseudo-random input signal python 
Python :: create list 
Python :: pandas str contains only true 
Python :: # generators 
Python :: average values in a list python 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =