[Tutor] how to import python script in the django project

Xristos Sarantis sarantisx at hotmail.com
Thu Feb 18 18:25:16 EST 2016


hello

newbie:
i want to import python script(with calculator functions) to django app who is the better method to do that and how to do that step by step?
i want to create a web framework where the users give values take somes results from the python scripts
1.first
import the script in folder app like this ?

blog
-views.py
-urls.py
-models.py
-my_script.py
-admin.py

and with some way to connect with app ?

2.second import python script into to html form ?

3.thrird using form to take inputs ?

4.convert(request,response) my python script into to views.py ?(i think so is the better but my problem is how to connect 'input' and 'print' from my python script on the django i dont know how to do this)

5 or with some addons ?

my code fron script:
total_inputs= int(input("number of numbers to input: "))
   for i in range (total_inputs)
    Num = input("Enter a number: ")
    NList.append(int(Num))
    for i in NList:
     if i == 1:
         y=1
     elif (i>1)and(i<5):
        y=(i-1)+2
     .............
     a.append(y) 
    print(a) 		 	   		  


More information about the Tutor mailing list