ProjectInitializationAutomation icon indicating copy to clipboard operation
ProjectInitializationAutomation copied to clipboard

Traceback (most recent call last): File "v:/MAIN cause PY/ProjectInitializationAutomation/windows_OS/remote.py", line 5, in <module> foldername = str(sys.argv[1]) IndexError: list index out of range

Open terminal-guy opened this issue 4 years ago • 10 comments

this is the problem

terminal-guy avatar Jul 22 '20 17:07 terminal-guy

I made it a lot better, actually. Just trying to contact Kalle so he can merge it https://github.com/Red-CS/ProjectInitializationAutomation/tree/winOS_gen

redpwilliams avatar Jul 25 '20 02:07 redpwilliams

this is the problem

But the problem you're facing is how you run it. If you manually hit run, sys.argv will give that error. Doing it from cmd with additional parameter gives length of 2

redpwilliams avatar Jul 25 '20 06:07 redpwilliams

length

I can't understand what you are clearly saying....

terminal-guy avatar Jul 25 '20 08:07 terminal-guy

The sys module gets any additional arguments passed. If you run

create thisName
  • sys.argv[0] --> remote.py
  • sys.argv[1] --> thisName

This works if you open a terminal and enter the second line above, which is how the project is meant to work.

If you are in an editor, let's say VS Code, by clicking the green "run" icon, all you're really doing is entering

remote.py

In which case

sys.argv[0] --> remote.py And len(sys.argv) --> 1

2 fixes:

  • Write it from the command line
  • Clone the version I wrote. Doesn't bring you errors and you can do so much more.

redpwilliams avatar Jul 25 '20 14:07 redpwilliams

hey in your file it is not clear what to do can you explain me in a better way I don't know what to do with your file

terminal-guy avatar Jul 26 '20 06:07 terminal-guy

Did you read the Readme file? I thought I made it very clear, but let me reiterate:

  • Clone the repository (or you could literally just copy paste code)
  • Set User Variables "PWFA-Path" and "PWFA-Token" to the path of the Windows folder and the GitHub token, respectively.
  • Type "create" in the terminal. If you see output, them it worked

redpwilliams avatar Jul 26 '20 14:07 redpwilliams

I have created a same script as this to work on every machine DO NOT WORRY THIS SCRIPT WORKS ON EVERY MACHINE Link to the project: https://github.com/String-error-404/GIT-and-GTITHUB_automation

if you like the project give a star to the repo and follow me on github

terminal-guy avatar Aug 12 '20 06:08 terminal-guy

Just browsing through the code, it looks like it works. It's just that the original purpose of Kalle's project was to run the program with a simple command from the terminal, instead of either manually finding the script in the explorer, opening code, and running, or going to terminal, cd into folder of that script and running python git.py

redpwilliams avatar Aug 12 '20 15:08 redpwilliams

Did you read the Readme file? I thought I made it very clear, but let me reiterate:

  • Clone the repository (or you could literally just copy paste code)
  • Set User Variables "PWFA-Path" and "PWFA-Token" to the path of the Windows folder and the GitHub token, respectively.
  • Type "create" in the terminal. If you see output, them it worked

i try it but this doesn't work for me

terminal-guy avatar Aug 12 '20 16:08 terminal-guy

Just browsing through the code, it looks like it works. It's just that the original purpose of Kalle's project was to run the program with a simple command from the terminal, instead of either manually finding the script in the explorer, opening code, and running, or going to terminal, cd into folder of that script and running python git.py

Yeah what you are saying is correct but i made it more simpler for easy to understand for other's So thanks for replies

terminal-guy avatar Aug 12 '20 16:08 terminal-guy