-4

I have following syntax in my python script.

x = Popen("\"C:/Program Files/7-zip/7z\" a -tzip " + new_file + " general/*")

Can anyone please explain the meaning of this syntax?

From some forums, I am explaining my understanding.

First the 7z application will be started from the command line interface from the mentioned path. Then the folder " general" in the current directory will be copied into new_file. Am I right?

Please note, I am totally new to Python. Hence please excuse my understanding.

  1. When I run this command, I am getting following Warning. Can anyone please let me know the issue in the syntax?

    7-Zip 17.01 beta (x64) : Copyright (c) 1999-2017 Igor Pavlov : 2017-08-28

    Open archive: <new_file>.zip

    Path = <new_file>.zip Type = zip Physical Size = 93678166

    Scanning the drive:

    WARNING: The system cannot find the file specified.

    general

  2. Writing the path like this: "<path>" is valid? What is the difference between "" and "<path>"? Frankly speaking, I have copied this from some forum for my application.

  3. What does " general/* " means? I know that if file name to be written with the space, it should be quoted with "". But what does it mean with wildcard characters " general/*"?

Please note, this scripts it going to be executed with Windows command line interface.

Thanks in advance.

Armali
  • 18,255
  • 14
  • 57
  • 171

1 Answers1

0
  1. When I run this command, I am getting following Warning. Can anyone please let me know the issue in the syntax?
    WARNING: The system cannot find the file specified.
    general
    

The reason for this warning is not in the syntax; it's because there is no folder named general.

  1. Writing the path like this: "<path>" is valid?

It seems so, but you probably don't really want to have the file name contain less-than or greater-than characters (angle brackets). Presumably where you've copied this from there's a line

new_file = "<new_file>"

- you were supposed to replace <new_file> with a file name of your choice, but you didn't.

  1. What does " general/* " means?

In this context it means that all files in the folder general are to be added to the zip file.

Armali
  • 18,255
  • 14
  • 57
  • 171