Create irmek_apps.py
Browse filescreated a way to open Power BI
- irmek_tools/irmek_apps.py +17 -0
irmek_tools/irmek_apps.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
impot os
|
| 2 |
+
|
| 3 |
+
# if power bi was installe din default path using a windows.exe
|
| 4 |
+
power_bi_path = r"C:\Program Files\Microsoft Power Bi Desktop\bin\PBIDesktop.exe"
|
| 5 |
+
|
| 6 |
+
if os.path.exists(power_bi_path):
|
| 7 |
+
os.startfile(power_bi_path)
|
| 8 |
+
print("Opening Power BI Desktop...")
|
| 9 |
+
else:
|
| 10 |
+
try:
|
| 11 |
+
# if power bi was installed using windows store
|
| 12 |
+
subprocess.run(["cmd", "/c", "start", "PBIDesktop.exe"], shell=True)
|
| 13 |
+
print("Opening Power BI...")
|
| 14 |
+
|
| 15 |
+
except Exception as error:
|
| 16 |
+
print(f"Failed to open Power BI: {e}")
|
| 17 |
+
|