Python Forum
Make bash call my own Python modules
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make bash call my own Python modules
#8
This is how I did it!

choices = ['checkboxes', 'dropdownboxes', 'htmltable', 'radiobuttons', 'textboxes', 'makethankyouphp']
pathToFile = '/home/pedro/myHWpageSummer2019/18BE/html/'
pathToParagraph = '/home/pedro/myHWpageSummer2019/textTohtml/paragraph/paragraph'
file = '18BEblanko.html'

while True:
    print('This is to make the paragraph string, this weeks content html.')
    carryon = input('Enter y to continue, enter nothing to stop. ')
    if not carryon == 'y':
        break
    print('What do you want first? The choices are: ')    
    for choice in choices:
        print(choice)    
    myChoice = input('What do you want? Enter your choice. ')
    while myChoice not in choices:
        for choice in choices:
            print(choice)
        myChoice = input('What do you want? Enter your choice. ')
            
    if myChoice == 'checkboxes':
        myString = makeHTMLCBs()
    elif myChoice == 'dropdownboxes':
        myString = makeDropdownboxes()
    elif myChoice == 'htmltable':
        myString = makeHTMLtable()
    elif myChoice == 'radiobuttons':
        myString = makeHTML_RBs()
    elif myChoice == 'textboxes':
        myString = readLinesmakeTBs()
    elif myChoice == 'makethankyouphp':
        myString = makeThankyouPHP()
Works ok, I get what I need.
Reply


Messages In This Thread
RE: Make bash call my own Python modules - by Pedroski55 - Apr-22-2019, 06:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 767 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  How to see the date of installation of python modules. newbieAuggie2019 4 1,890 Mar-31-2023, 12:40 PM
Last Post: newbieAuggie2019
  Python modules for accessing the configuration of relevant paths Imago 1 1,503 May-07-2022, 07:28 PM
Last Post: Larz60+
  Call a bash script from within a Python programme Pedroski55 6 2,622 Dec-06-2021, 01:53 PM
Last Post: DeaD_EyE
  Showing and saving the output of a python file run through bash Rim 3 2,684 Oct-06-2021, 10:48 AM
Last Post: gerpark
  Python modules to extract data from a graph? bigmit37 5 22,926 Apr-09-2021, 02:15 PM
Last Post: TysonL
  Where to add own python modules in WinPython? HinterhaeltigesSchlaengelchen 1 2,391 Jan-21-2021, 07:45 PM
Last Post: snippsat
  Including modules in Python using sys.path.append JoeDainton123 1 3,069 Aug-24-2020, 04:51 AM
Last Post: millpond
  How to kill a bash script running as root from a python script? jc_lafleur 4 6,194 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  how to get PID's of linux commands executed through python modules? Manikandan_PS 4 3,211 Mar-12-2020, 07:16 AM
Last Post: Manikandan_PS

Forum Jump:

User Panel Messages

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