Post Reply 
HP Prime Python runs consecutive programs
09-24-2023, 07:14 PM
Post: #4
RE: HP Prime Python runs consecutive programs
(09-24-2023 03:50 PM)toml_12953 Wrote:  After an import, NumWorks will automatically run a program that is not included in a function.

If you import the program below, Numworks will automatically run the code and print 7. If you remove the # and indent the print statement, then nothing will run automatically when this code is imported.

Code:
def addit(x,y):
  return x+y

#def main():
print(addit(5,2))
Yes, but in Numworks you can select for each program whether it will be imported or not. A Prime Python app doesn't allow to select which module to import and which not, import all or nothing (<shift><Plot>

This behavior is what my comment is directed at.
Günter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP Prime Python runs consecutive programs - Guenter Schink - 09-24-2023 07:14 PM



User(s) browsing this thread: 1 Guest(s)