Python Forum
What should I name these vars
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What should I name these vars
#1


import os
import os.path
import sys
import readline


def modcmd(arg):
  # I want to declare the the sys.executable+" "+sys.prefix+"/bin/"
  # as a constant but don't know what to name it.
  os.system(sys.executable+" "+sys.prefix+"/bin/" +arg)

# I would also like to declare sys.prefix+"/bin/pip as a constant
# but again I'm not sure what to name it.
if not(os.path.exists(sys.prefix+"/bin/pip")):
  print("You need to install pip first.")
  
print("Input pip commands, ie: pip install {module}")
while(True):
  cmd=input("-->")
  if (cmd==""): break;
  modcmd(cmd)
This script is part of qpython3 for Android.
Reply
#2
Call it whatever it is.  bin_path, pip_path, etc.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  vars() can't be used in list interpretation? Cheng 3 2,122 Jun-22-2021, 11:59 AM
Last Post: snippsat
  using vars from one file to match lines in another gt76_noobster 3 2,634 Jan-30-2019, 05:34 PM
Last Post: ichabod801
  Vars and getattr problem catosp 5 4,066 Aug-28-2018, 02:54 PM
Last Post: buran
  A help whit vars and strings dhoyosg 10 5,391 May-05-2018, 08:52 AM
Last Post: dhoyosg

Forum Jump:

User Panel Messages

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