Python Forum
How to create def for sorted() from list of versioning files (filename+datetime)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create def for sorted() from list of versioning files (filename+datetime)
#10
(Jan-13-2017, 01:27 PM)Kebap Wrote: Please be more specific, which error message do you see, or which unexpected output, which other would you expect?

I had/have file permission issues, because even though I am Domain Admin, majority of files have only Original Owner, SYSTEM and PC\Administrators group in file permissions (Where PC is PC where backup files are stored).
Manifestation is that I get empty file list "lista", so there is nothing to do.
Output:
Exists dir: True Directory name lenght: 108 Directory is: e:/Backup-racunara/Novi_Sad/Dole_napred/JASMINA-PC/Revizije/C/Users/jasmina/AppData/Local/Microsoft/Windows/ lista: [] lista2: [] lista3 sorted: [] .................. deletelist: [] +++++++++++++++++ Process finished with exit code 0
I will either have to add my user/Domain Admins group full rights for every file on the server,
or to run this script as PC\Administrators member, or SYSTEM account.

EDIT: I decided to just run whole script as Administrator of that PC. Running Pycharm as Administrator allows me to debug so I will not be complicating python script.



(Jan-13-2017, 01:27 PM)Kebap Wrote:
Quote:Also, at this time, your code is rather difficult to review. Do you already know about python functions or maybe even classes to help bring more structure and readability to the code?

This way, you can also easier update and improve some portions of the code and test them separately. You may also be thankful in a few months or years when you come back and try to understand what you coded. ;)

I haven't had the time to finish reading book about Python, but I know Delphi/pascal and VB so I know about functions in general.

I plan to clean this code as soon as everything works as planed. Since I need to cycle through directories, I will be employing functions at least for that.
Reply


Messages In This Thread
RE: How to create def for sorted() from list of versioning files (filename+datetime) - by DrLove73 - Jan-16-2017, 08:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete strings from a list to create a new only number list Dvdscot 8 1,593 May-01-2023, 09:06 PM
Last Post: deanhystad
  list the files using query in python arjunaram 0 691 Mar-28-2023, 02:39 PM
Last Post: arjunaram
  Create new folders and copy files cocobolli 3 1,529 Mar-22-2023, 10:23 AM
Last Post: Gribouillis
  Failing to print sorted files tester_V 4 1,313 Nov-12-2022, 06:49 PM
Last Post: tester_V
  [split] why can't i create a list of numbers (ints) with random.randrange() astral_travel 7 1,572 Oct-23-2022, 11:13 PM
Last Post: Pedroski55
  How to download a list of files from FTP? schnarkle 0 1,027 Jun-21-2022, 10:35 PM
Last Post: schnarkle
  Rename part of filename in multiple files atomxkai 7 7,430 Feb-18-2022, 10:03 PM
Last Post: atomxkai
  Python code to read second line from CSV files and create a master CSV file sh1704 1 2,433 Feb-13-2022, 07:13 PM
Last Post: menator01
  Append files and add column with last part of each filename NiKirk 0 2,645 Feb-04-2022, 07:35 AM
Last Post: NiKirk
  set and sorted, not working how expected! wtr 2 1,304 Jan-07-2022, 04:53 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020