Oct-29-2019, 02:55 PM
Hi guys,
I try to create a script with the following code but getting errors. Can some one help? Why the main() can't be used with the import?
Basically the script is to create a copy of file from "581_nestedclipsdrag.swf" with a new file name with the count of 10 files, e.g. file-1 to file-10.
root@lab:/tmp/create# python ./testDup.py
File "./testDup.py", line 5
import shutil
^
IndentationError: expected an indented block
#!/usr/bin/env python
def main():
import shutil
for i in range(10):
newPath = shutil.copy('581_nestedclipsdrag.swf', 'file-%s.swf' % i)
if __name__== "__main__":
main()
I try to create a script with the following code but getting errors. Can some one help? Why the main() can't be used with the import?
Basically the script is to create a copy of file from "581_nestedclipsdrag.swf" with a new file name with the count of 10 files, e.g. file-1 to file-10.
root@lab:/tmp/create# python ./testDup.py
File "./testDup.py", line 5
import shutil
^
IndentationError: expected an indented block
#!/usr/bin/env python
def main():
import shutil
for i in range(10):
newPath = shutil.copy('581_nestedclipsdrag.swf', 'file-%s.swf' % i)
if __name__== "__main__":
main()