Maybe you need to refactor your script, I suggest you something like this:
def my_math_func(your_input): your_input = your_input.replace(" ", "") # prevent "1, 2" list_input = [int(x) for x in your_input.split(",")] # others comprobations could be do list_output = [] for x in list_input: ... progress ... result1=result result2=listresult list_output.append( ( str(result1), str(result1) ), ) return list_output if __name__ == "__main__": your_input = input("Insert a list of number sepatated by ,") print(my_math_func(your_input)) If you see now you have and script that could be called by terminal and the function could be used in a django view 2016-02-10 13:49 GMT-06:00 Xristos Xristoou <saxr...@gmail.com>: > for example: > myscipt > that my input for example the user define the number to want for input and > next input integer numbers on the list(NList) that list go to progress and > exported one variable result outpout and list of variables results. i dont > upload the progress code because i think not is nesecery for my questions. > > total_inputs= int(input("number of numbers to input: ")) > for i in range (total_inputs) > Num = input("Enter a number: ") > NList.append(int(Num)) > .................................. > progress > ................................. > result1=result > result2=listresult > print(result1) > print(result2) > > > Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos > Xristoou έγραψε: >> >> hello, >> >> >> i create some python mathematical function on python idle, >> i want to create website where the user import value numbers on the >> function >> and take the results from that. >> question one,how to connect my mathematical function on the django? >> question two,how to connect input and output from the scipts in the >> website ? >> the second question i ask because input and output from the function is a >> dynamic define from the user >> >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/2903b19d-aa7d-41ba-abcb-6f1aada7f9f4%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/2903b19d-aa7d-41ba-abcb-6f1aada7f9f4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- "La utopía sirve para caminar" Fernando Birri -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAG%2B5VyMR1N_QyR6cMvw%3DKDguvapNHrc4o%2BM0g4Co%2BarGmVEehA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.