How to open a network folder with a password in Windows?
📁 Advanced Python Topics
I need to open a network folder in File Explorer from a Python script.
I know how to open network folders without a password using startfile:
os.startfile(r""\\\\192.168.1.2\\folder"")The problem is that I need to open a network folder with a password, and then startfile gives an error:
OSError: [WinError 86] The network password is not correct: '\\\\\\\\192.168.1.3\\\\folder'First, where do I specify the network password?
Second, is it possible to display the standard File Explorer password input dialog and let the user enter the password in Explorer without touching the Python script? I tried opening explorer.exe
You can add API connection to Telegram in a function; if there's a connection error, call this function again
def api(): try: m = 'Here the remaining bot' except: api()api()If you don't want to do it this way, you'll have to use a database - store variables. This can be done with either import json or import sqlite3. If you don't want to store variables in a database, store them in Python itself using a Python dictionary (dict). p.s In any case, you need import time. When processing a user's message, first check if they are not in the list; if they are, write
Log in to leave an answer
Blogs