Python director / file access in TABLET | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Python director / file access in TABLET

I plan to store my Python codes in a server and through WIFI access this code in TABLET. can we write in such a way that, code look out for a File in Android path of TABLET though running at Server.. currently our POC shows , it always expect file to be ( or folder to be) available at server where we kept our executable code

26th Sep 2023, 11:15 AM
vibhava Technology
vibhava Technology - avatar
1 Resposta
+ 1
Where your python code is stored is the ā€œcurrent working directoryā€, short for cwd. If you want to store your code in the server, and working with files OUTSIDE that directory (commonly known as folder), you need a way to tell your code to ā€œchangeā€ the cwd. I suggest you search for ā€œpathlib.Pathā€ and ā€œosā€ modules. They have methods to change the cwd.
26th Sep 2023, 12:57 PM
Wong Hei Ming
Wong Hei Ming - avatar