Apr-19-2019, 08:30 AM
I have a little homework webpage. I'm trying to automate the production of the webpage each week.
I know very little about this. Wednesday I asked here about importing Python functions that I made. I think I have grasped the concept. I've tested everything in Idle. All the modules work.
In my Python shell, (I use Idle in Ubuntu), everything does what I want.
I first append the paths:
In Idle I just write, for example:
However, in bash, I cannot write
Each week things are different, I may need to run 2 or more of the modules, add the result strings, then write them in the webpage text string in the correct insertion point.
I run this in a
For any given week, I don't know which module I want to use, so I make them all available.
I have a list of all the modules:
I know very little about this. Wednesday I asked here about importing Python functions that I made. I think I have grasped the concept. I've tested everything in Idle. All the modules work.
In my Python shell, (I use Idle in Ubuntu), everything does what I want.
I first append the paths:
for i in range(0, len(pyPaths)): sys.path.append(pyPaths[i])then import the modules:
from makeRBsInlineV1 import makeHTMLrbsNums from makeCheckboxesInlineV1 import makeHTMLCBs from makeDropdownboxesInlineV1 import makeDropdownboxes from createhtmlTableInlineV1 import makeHTMLtable from makeRBsInlineV2 import makeHTML_RBs from readLinesTextboxesInlineV1 import readLinesmakeTBs from makeThankyouPHPInlineV1 import makeThankyouPHPAll these modules return a text string which is a mixture of html tags + my text. It displays nicely in Firefox.
In Idle I just write, for example:
myString = readLinesTextboxesInlineV3()it asks me a few questions and off it goes. Afterwards, myString is ready to be put in the webpage text string.
However, in bash, I cannot write
myString = readLinesTextboxesInlineV3()in bash, I cannot write
myString = input('Enter the name of the module you want. ')and then enter,
readLinesTextboxesInlineV3()because then myString is just the input text, not the function.
Each week things are different, I may need to run 2 or more of the modules, add the result strings, then write them in the webpage text string in the correct insertion point.
I run this in a
while True:loop, so I can add strings from various modules.
For any given week, I don't know which module I want to use, so I make them all available.
I have a list of all the modules:
pyFiles = ['makeCheckboxesInlineV1()', 'dropdownboxesInlineV1()', 'createhtmlTableInlineV1()', 'makeRBsInlineV2()', 'readLinesTextboxesInlineV3()', 'makeThankyouPHPInlineV1()']How do I assign myString to any 1 of the modules above when I run makeWebpage.py in bash?