You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Charlie edited this page Jun 13, 2023
·
1 revision
welcome to the jungle of files!
Nah i'm just kidding, it's just file.py
file.py hosts the file paths of files that you can call from in your scripts.
How to use file.py
just import file.py like this:
importfile
then when you want to import a file just call the file path like this:
fromfileimportpy
then when you want to use the file to say, create a file icon in the desktop, just call the file path like this:
# get the folder contentsfolder_path=os.path.join(os.getcwd(),"system", text[:-1])
folder_contents=os.listdir(folder_path)
# Create a label for each item in the folderforiteminfolder_contents:
# Split the file name and extensionname, ext=os.path.splitext(item)
# Create a label for the itemlabel=tk.Label(folder_contents_frame, text=item)
# Add an image icon to the left of the label based on the file extensionifext=='.txt':
icon=tk.PhotoImage(file=py)
do note that all the files in file.py are in the system/bin folder and the files listed here
py
pyc
html
css
js
php
java
c
cpp
csharp
ruby
perl
go
swift
sql
xml
json
txt
md
bat
sh
exe
dll
jar
folder
are in the .PNG file format.
however the system icons are in the .ICO file format.
hey! how are you?
welcome to the forum! hope your having a great time!