Php vs Python gui (tkinter...) for small remote database app

2021-06-14 Thread Pascal B via Python-list
Hi,
I would like to know if for a small app for instance that requires a connection 
to a remote server database if php is more suitable than Python mainly 
regarding security.
Php requires one port for http and one port for the connection to the database 
open. If using Python with a tkinter gui, I understand a small app can connect 
to a database so only one port to the database would need to be accessed/open 
listening to connection. So I would need to worry less about security if using 
Python over Php for something small, like a small python app that I give over 
to users.

Am I missing something in this assertion?
-- 
https://mail.python.org/mailman/listinfo/python-list


python list files and folder using tkinter

2021-12-05 Thread Pascal B via Python-list
Hello,
I have already posted a message some time ago for this app. Since then, I 
didn't code in python or made any changes. I think before getting further with 
functionnalities a few things or the whole thing need to be changed.
For exemple, it would need a button to pick folders and maybe ask if the csv 
resulting file can be saved in the same folder.
And more important, files are listing ok in windows but not in linux after 
running it a few times.
https://github.com/barpasc/listfiles
code extract without indentation, see source script on github

elif vvchkboxF == 1: 
|   # *** FOLDERS AND FILES ONLY *** |
|


|   for root, dirs, files in os.walk(Lpath, topdown=False): |
|


|   ### calcul taille dossier |
|


|   size = 0 |
|


|   for x, y, z in os.walk(root): |
|


|   for i in z: |
|


|   ftmp_che = x + os.sep + i |
|


|   f_size += os.path.getsize(ftmp_che) |
|


|   ### ecriture taille dossier |
|


|   counter = root.count(os.path.sep) - counterPath |
|


|   vfile_name = root |
|


|   vfile_name = vfile_name + os.path.sep |
|


|   vfile_name = os.path.split(os.path.dirname(vfile_name))[1] |
|


|   vfile_name += os.path.sep |
|


|   if counter <= f_vscale: |
|


|   csv_contents += "%s;%s;%.0f;%.2f;%.2f;%.2f;%s\n" % (root, vfile_name, 
f_size, f_size/1024, f_size/1048576,f_size/1073741824, "folder") |
|


|  
 |
|


|   ### calcul +ecriture taille fichier |
|


|   for f in os.listdir(Lpath): |
|


|   path = os.path.join(Lpath, f) |
|


|   if os.path.isfile(path): |
|


|   f_size = 0 |
|


|   f_size = os.path.getsize(path) |
|


|   csv_contents += "%s;%s;%.0f;%.2f;%.2f;%.2f;%s\n" % (path, f, f_size, 
f_size/1024, f_size/1048576,f_size/1073741824, "file") |
|


|  
 |
|


|   fx_writeCSV_str(csv_contents) |
|

  print("job adv listing files ok")
-- 
https://mail.python.org/mailman/listinfo/python-list