Re: How to run python script by clicking a HTML button?

2018-06-22 Thread Julio Biason
Hi Subhendu,

To make this all work, you'll need to do this:

1. Create a Django app
2. Add some URL to a view (any view)
3. Inside the view, run your script.
4. Change the for on the "action" to point to the URL in point 2.

You may want to read the Django Tutorial[1] to grasp who those things are
implemented and connect to each other.

[1] https://docs.djangoproject.com/en/2.0/

On Thu, Jun 21, 2018 at 1:43 PM, SUBHENDU PANDA 
wrote:

> Below is my HTML code...
>
> 
> 
> 
>
> HTML Forms
>
> 
>   First name:
>   
>   
>   
>   
> 
>
> I want is : If you I the "Submit" button, the form-data will be sent to
> a page called "/myscript.py and will perform the operation".
>
> 
> 
>
>
>
>
>
>
> myscript.py:
>
> import os
>
> def  f1():
>print ("Below are the files present in your Directory { }"
> .format(os.listdir("C:\MyDir "))
>
> --
> 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/a4fd2aa4-b28a-465f-aaab-dc279c4647d3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Julio Biason*, Sofware Engineer
*AZION*  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101   |  Mobile: +55 51
*99907 0554*

-- 
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/CAEM7gE0CuGO2g%3DUTZsn7Hc9cC%2BzUreqCMTE8HiYzrB0r0SyCMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to run python script by clicking a HTML button?

2018-06-21 Thread Jani Tiainen
Hi,

Django doesn't exactly work that way.

Please do the official tutorial from Django docs to get grasp of basics how
things works and are tied together.

to 21. kesäk. 2018 klo 23.15 SUBHENDU PANDA 
kirjoitti:

> Below is my HTML code...
>
> 
> 
> 
>
> HTML Forms
>
> 
>   First name:
>   
>   
>   
>   
> 
>
> I want is : If you I the "Submit" button, the form-data will be sent to
> a page called "/myscript.py and will perform the operation".
>
> 
> 
>
>
>
>
>
>
> myscript.py:
>
> import os
>
> def  f1():
>print ("Below are the files present in your Directory { }"
> .format(os.listdir("C:\MyDir "))
>
> --
> 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/a4fd2aa4-b28a-465f-aaab-dc279c4647d3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAHn91of8RnW3t3AyhZnDB_QRBMQYAMAOWmhGVS6YQ8W1M50tag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to run python script by clicking a HTML button?

2018-06-21 Thread SUBHENDU PANDA
Below is my HTML code...





HTML Forms


  First name:
  
  
  
  
 

I want is : If you I the "Submit" button, the form-data will be sent to 
a page called "/myscript.py and will perform the operation".









myscript.py:

import os

def  f1():
   print ("Below are the files present in your Directory { }" 
.format(os.listdir("C:\MyDir "))

-- 
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/a4fd2aa4-b28a-465f-aaab-dc279c4647d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.