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?
#21
(Sep-10-2023, 04:14 PM)snippsat Wrote:
(Sep-10-2023, 02:03 PM)TheMouseAvenger Wrote: Of course, if there are any errors, PLEASE do let me know. :-) It would also be very much appreciated if you could put any corrections IN the code, so I don't have to worry about placing them.
All is ok.
Now can give path or simpler just put .json files in folder G:\div_code\suspender_env then no path is needed.
Navigate works like with c: and cd if want go eg desktop.
G:\div_code\suspender_env                                                         
λ G:\div_code\suspender_env\Scripts\activate.bat                                  
 
# Over to c:                                                                                 
(suspender_env) G:\div_code\suspender_env                                         
λ c:                                                                              
           
# Go back                                                                       
(suspender_env) C:\Users\Tom                                                      
λ cd ..                                                                           
    
# Go back                                                                                 
(suspender_env) C:\Users                                                          
λ cd ..                                                                           
     
# Go to Desktop                                                                             
(suspender_env) C:\                                                               
λ cd Users/Tom/Desktop    

# List files 
(suspender_env) C:\Users\Tom\Desktop
λ ls
'010 Editor.lnk'*
 'tabs.json'
'tabs_new.json'
.....                                                      
       
# Do the command                                                                           
(suspender_env) C:\Users\Tom\Desktop                                              
λ restore-the-great-suspender-urls --in-file=tabs.json --out-file=tabs_new.json   
# No error ok
So now i this navigate demo i have a tabs.json in Destop folder,
then no Path is needed,same for all just navigate to folder where .json files are,or just move the files to suspender_env folder.

OK, here I go! ^_^ Hopefully, I won't have any more problems! :D (crosses fingers)

P.S.: OK, OK, *one* last question: I don't see a "G" drive anywhere on my computer! What should I do?
Reply
#22
(Sep-17-2023, 03:28 PM)TheMouseAvenger Wrote: P.S.: OK, OK, *one* last question: I don't see a "G" drive anywhere on my computer! What should I do?
Ahh so in post#19 you just copy my code whiteout using quote.
I did think that you did same as me.

Just follow what exactly what do in post#16,post back if you have trouble and show you output.
You really struggle with basic understating of basic OS stuff and Python.
the-great-suspender-restore-urls is a really simple tool and is CLI tool which means you use from command line also you open cmd,
then do command in folder where you have your .json files.

Here from start in cmd
Microsoft Windows [Version 10.0.19045.3448]

C:\Users>cd ..

# Install
C:\>pip install the-great-suspender-restore-urls
Requirement already satisfied: the-great-suspender-restore-urls in c:\python311\
lib\site-packages (0.4)

# Use help
C:\>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_SUFF
IX]
                                        [--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.

# cd to folder code,you cd to your folder where .json files are
C:\>cd code

# In folder code i have tabs.json
C:\code>restore-the-great-suspender-urls --in-file=tabs.json --out-file=tabs-restored.json
# No errors 

C:\code>
Reply
#23
Well, I was hoping to use Python alone, because I have the complete code written for that, & you said earlier that everything in it checked out perfectly, so I should be able to run it without any problems. :-(

All I simply want to know is, do I actually have to create a G drive for my computer? (If so, I can look up how to create a new drive.) And is there anything else I need to do AFTER that task in particular?
Reply
#24
(Sep-17-2023, 06:45 PM)TheMouseAvenger Wrote: Well, I was hoping to use Python alone
it's all Python,just that is written to use from command line CLI tool
(Sep-17-2023, 06:45 PM)TheMouseAvenger Wrote: All I simply want to know is, do I actually have to create a G drive for my computer? (If so, I can look up how to create a new drive.) And is there anything else I need to do AFTER that task in particular?
No no,G: is physicals drive on my computer,i have not used G: in my latest posts.
There i use C: drive(which you also have),just open cmd and follow what i done yourself.
It's a frustrating that you don't post what you have tried.
Reply
#25
So just replace G with C, got it. :-) OK, *now*, I'm going to finally do it! ^_^ I'll let you know if anything still goes wrong, though. :-)
Reply
#26
(Sep-17-2023, 07:58 PM)snippsat Wrote:
(Sep-17-2023, 06:45 PM)TheMouseAvenger Wrote: Well, I was hoping to use Python alone
it's all Python,just that is written to use from command line CLI tool
(Sep-17-2023, 06:45 PM)TheMouseAvenger Wrote: All I simply want to know is, do I actually have to create a G drive for my computer? (If so, I can look up how to create a new drive.) And is there anything else I need to do AFTER that task in particular?
No no,G: is physicals drive on my computer,i have not used G: in my latest posts.
There i use C: drive(which you also have),just open cmd and follow what i done yourself.
It's a frustrating that you don't post what you have tried.

So, I started doing my Python code...& I've already run into a problem. :-(

https://i.ibb.co/bRyCxQ0/Something-Went-Wrong.png

What should I do to fix this?
Reply
#27
You have started the Python interactive shell(then see >>>),bye typing just python you shall not do that.
You shall not type λ that just my shell cmder shell that make this signs automatic(it not part of the command).

Just python -V, pip -V,if work then install pip install the-great-suspender-restore-urls
You seems completely lost on all basic stuff,if you know someone that in person could help you that would be fine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how do I successfully use PDO with my ODBC for MSSQL? cyberion1985 3 6,594 Jun-26-2018, 04:44 PM
Last Post: Maverick494
  Cannot successfully install NumPy aniketmone2017 3 7,371 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