I’m trying to run this script called “Great Suspender Restore URLS” in order to, well, restore the broken Great Suspender links to my tabs from my Google Chrome session, the windows of which have been exported into a JSON file. Now, the instructions from GitHub appear to be quite simple, & I was successfully able to download & install the Great Suspender Restore URLs Python package, but I have had NO luck getting the actual script to work so that my links can actually be restored.
I tried fixing the environment variables by adding a user path to the folder where Python itself is located, but the Python terminal gives me “Invalid Syntax”. I have the list of tabs located in the “Great Suspender Restore URLs” subfolder in ‘Python – Scripts’, & I try to run the script that I need to fix said list, but it’s not working. I don’t know how to type in the path where the GSRU script is, & I still don’t have any luck when I try out path-&-file input methods mentioned on other websites. And I’m certain there’s several other methods I tried, but I can’t remember any of them – that’s how long I’ve been running myself ragged trying to run this one simple script! Here’s some illustrative screencaps that should elucidate my troubles pertaining to what I’m trying to accomplish.
Hi, Stack Overflow regular here. As a heads up, questions like this one are not appropriate for Stack Overflow. The key point is that SO is for questions about programming, not about using someone else’s program. The fact that it’s written in Python doesn’t make this a programming question - every program is written in some programming language - and this program isn’t a tool that you would use to help write other programs, it’s just something to help clean up your web browser’s data.
We also don’t normally want images on Stack Overflow for anything that doesn’t absolutely need an image to be understood. In particular, programmers should normally have a basic understanding of how paths work on their computer, so they would be able to copy and paste the text versions of the paths (usually we format these like single-line code, because it’s text that you would see in a terminal window).
As it happens, the underlying problem you encountered is one for which we have a reference question: as Terry explained, the Python interpreter is separate from the command line. (The reference question shows a very different command, but it’s the same conceptual problem.) So I have closed the question as a duplicate to get it out of the way.
(NOTE: Nobody has answered my post on StackOverflow so far, & I’m really impatient to figure this problem out, so I thought I would have better luck here.)
Well, that’s the thing – on other pages that I consulted to try & solve the problem myself, I kept encountering conflicting language & methods that either involved Command Prompt, Python, or both. And several of these pages used the exact phrase “command line”, so I was additionally confused; I mean, like, are you referring to Command PROMPT, or something in Python that I’m not understanding?
So, I need to run all these commands in Command Prompt, I presume? And…is there anything else I’m required to do? Because I’m sure I’m missing a lot of those – for instance, how to properly tell Command Prompt where my “Great Suspender Restore URLs” script & JSON tabs list are located. Would you &/or anyone else care to enlighten me on that?
“command line” means the system’s command prompt. The Python REPL (interpreter prompt) is not a “command line”, because the things you type there are not “commands” - they are code, which consists (roughly speaking) of statements and expressions.
If you want to use Python to write your own code, it is a good idea to get familiar with what Python code looks like, and what commands for the command line look like. They are quite different, and it will take only a little practice before it’s obvious what’s what.
In the example you highlighted, see where it says --in-file=tabs.json ? That is the part you use to explain where the JSON tabs list is. If it’s in the current directory, you can just put the name; otherwise you will need to specify a path (either absolute or relative).
You do not need to tell the Command Prompt where the script is - when you installed it, pip will have copied it to a place that your system will automatically look for programs, when you use their name for a command (like restore-the-great-suspender-urls, in the example). These places are listed in an environment variable called PATH. When you install Python, the Python installer will add a folder path from inside the Python installation to the PATH; and when pip installs programs (i.e., if the package has an entry point script), it will put them in that path.
It will be better if you study a command-line tutorial to understand the fundamentals here.
Though I’m still a little confused…In that case, what’s the best command-line tutorial online that you would recommend? (Preferably one with text &/or images, if that’s all right.)
Also, I took the advice of another site, & changed the path directory from my Python folders in AppData/Local/Programs/Python, instead of the Python section in Programs(x86). Would that affect what I’m trying to do in any way?
Again: the command goes at the command line, not within Python. Do not first run python before running the script. When it says C:\Users>, you should use cd commands in order to go into the folder that contains tabs.json, and then use the restore-the-great-suspender-urls command. Do not use the python command at any point in this process.