Python Forum
Can anyone help me successfully run this code?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can anyone help me successfully run this code?
#10
(Aug-17-2023, 02:50 PM)TheMouseAvenger Wrote:
(Jun-21-2023, 07:28 PM)snippsat Wrote: Just need to add Scripts folder (where pip.exe is) in System Variables.
C:\Users\User\AppData\Local\Programs\Python\Python311
C:\Users\User\AppData\Local\Programs\Python\Python311\Scripts
It easier if you make folder that has shorther Path eg C:\div_code.
Here a quick run with virtual enviromnet,and rember restore-the-great-suspender-urls it's a command line tool.
So now need to run it with python.
G:\div_code
λ python -V
Python 3.11.3

I selected the third mini-code, as it's precisely what I need to use! ^_^ Just one more question: Where exactly do I put the mini-code in the main code?

G:\div_code
λ pip -V
pip 23.1.2 from C:\python311\Lib\site-packages\pip (python 3.11)

# Make enviroment
G:\div_code
λ python -m venv suspender_env

G:\div_code
λ cd suspender_env\

G:\div_code\suspender_env
λ G:\div_code\suspender_env\Scripts\activate.bat

# Install
(suspender_env) G:\div_code\suspender_env
λ pip install the-great-suspender-restore-urls
Collecting the-great-suspender-restore-urls
  Downloading the_great_suspender_restore_urls-0.4-py3-none-any.whl (5.8 kB)
Installing collected packages: the-great-suspender-restore-urls
Successfully installed the-great-suspender-restore-urls-0.4

# As it's a command line tool --help will work
(suspender_env) G:\div_code\suspender_env
λ restore-the-great-suspender-urls --help
usage: restore-the-great-suspender-urls [-h] --in-file IN_FILE --out-file OUT_FILE [--session-name-suffix SESSION_NAME_SUFFIX]
                                        [--extension-id EXTENSION_ID] [--verbose]

Restore the broken URLs of the Great Suspender browser extension

options:
  -h, --help            show this help message and exit
  --in-file IN_FILE     Input file. Could be relative (to current directory)
  --out-file OUT_FILE   Output file. Could be relative (to current directory)
  --session-name-suffix SESSION_NAME_SUFFIX
                        Session name suffix. Defaults to ` - cleaned`.
  --extension-id EXTENSION_ID
                        ID of ``The Great Suspender`` extension. If left blank, regularexpression match will be used.
  --verbose             Verbose output.
Now would i need to have tabs.json in this folder the run command and it will work.

Only one more question: If my "tabs.json" & "tabs_oldercopywithalternatelinks.json" files, & my "the-great-suspender-urls-restore" script, are all located in C:\Users\User\Desktop\the-great-suspender-restore-urls-0.4, how should I specifically type/input those specific file names & folder paths into the code? (It would help if you could repost the code with those file names & folder paths incorporated within, so I'll know exactly what to type. :-) )
Reply


Messages In This Thread
RE: Can anyone help me successfully run this code? - by TheMouseAvenger - Sep-08-2023, 02:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how do I successfully use PDO with my ODBC for MSSQL? cyberion1985 3 6,718 Jun-26-2018, 04:44 PM
Last Post: Maverick494
  Cannot successfully install NumPy aniketmone2017 3 7,477 Dec-29-2016, 02:14 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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