<gh_stars>1-10
import sys
from plumbum import local

def makeMyPYJ():
    """
    When RapydScript is asked to import x,
    it looks for x.pyj.  Therefore, 
    to facilitate RapydScript compiles, we
    * remove pyj and py-cached
    * copy the calling x.py to x.pyj
    """
    cp = local['cp']
    rm = local['rm']
    ls = local['ls']

    myName = sys.argv[0] #the calling py
    PYJname = myName.replace('.py', '.pyj')

    #remove all the ".pyj-cached'files
    fileNames=ls().split()
    for fileName in fileNames:
        if fileName.endswith('.pyj-cached'):
            rm(fileName)

    cp(myName, PYJname)
    print(f'makemyPYJ copied {myName} to {PYJname} and removed *.pyj-cached')

def makeDummyPYJ(baseName, funcNames=[]):
    if not type(funcNames) == type([]):
        funcName = [funcNames]
        
    f=open(baseName+'.pyj','w')
    for funcName in funcNames:
        f.write(f"""
def {funcName}(*args, **kwargs):
    pass

#this dummy PYJ file ({baseName+'.pyj'}) was generated by makePYJs.py at request of {sys.argv[0]}
""")
        print(f"makemyPYJs.py executed makeDummPYJ('{baseName}', '{funcName}')")
    f.close()

if __name__== '__main__':
    myName = sys.argv[0]
    baseName=myName.replace('.py', '')
    makeDummyPYJ(baseName, funcNames = ['makeMyPYJ', 'makeDummyPYJ']) 
 
import sys
from plumbum import local

def makeMyPYJ():
    """
    When RapydScript is asked to import x,
    it looks for x.pyj.  Therefore, 
    to facilitate RapydScript compiles, we
    * remove pyj and py-cached
    * copy the calling x.py to x.pyj
    """
    cp = local['cp']
    rm = local['rm']
    ls = local['ls']

    myName = sys.argv[0] #the calling py
    PYJname = myName.replace('.py', '.pyj')

    #remove all the ".pyj-cached'files
    fileNames=ls().split()
    for fileName in fileNames:
        if fileName.endswith('.pyj-cached'):
            rm(fileName)

    cp(myName, PYJname)
    print(f'makemyPYJ copied {myName} to {PYJname} and removed *.pyj-cached')

def makeDummyPYJ(baseName, funcNames=[]):
    if not type(funcNames) == type([]):
        funcName = [funcNames]
        
    f=open(baseName+'.pyj','w')
    for funcName in funcNames:
        f.write(f"""
def {funcName}(*args, **kwargs):
    pass

#this dummy PYJ file ({baseName+'.pyj'}) was generated by makePYJs.py at request of {sys.argv[0]}
""")
        print(f"makemyPYJs.py executed makeDummPYJ('{baseName}', '{funcName}')")
    f.close()

if __name__== '__main__':
    myName = sys.argv[0]
    baseName=myName.replace('.py', '')
    makeDummyPYJ(baseName, funcNames = ['makeMyPYJ', 'makeDummyPYJ'])
When RapydScript is asked to import x,     it looks for x.pyj.  Therefore,      to facilitate RapydScript compiles, we     * remove pyj and py-cached     * copy the calling x.py to x.pyj #the calling py #remove all the ".pyj-cached'files def {funcName}(*args, **kwargs):     pass  #this dummy PYJ file ({baseName+'.pyj'}) was generated by makePYJs.py at request of {sys.argv[0]}