Python Forum
Python with email forms, and frontend code in general
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python with email forms, and frontend code in general
#1
Hi guys.

I'm looking to try to teach myself python practically. For example, my goal for tonight is to create an email form through python... or something similar. I was just about to buy a linux hosting package - but I just thought I should ask; is there a way of linking html with python on a frontend level locally which is relatively easy? (I'm not the sharpest tool in the shed with code yet).
Reply
#2
(Feb-18-2018, 12:10 AM)MattH Wrote: is there a way of linking html with python on a frontend level locally which is relatively easy?
Use Flask it's a minimalist web-framework that's easy use and still powerful to scale from small web-app to large websites.
(Feb-18-2018, 12:10 AM)MattH Wrote: I was just about to buy a linux hosting package
Take a look at this post,talk a little about Python friendly host like DigitalOcean VPS, Heruko, PythonAnywhere, AWS Lambda.
Reply
#3
Hi snippsat, firstly thanks for your scaping tutorials - they've helped me out an awful lot.

Secondly, Flask looks perfect for me right now. I've installed flask which went through perfectly.

Now I try to run in terminal using:

FLASK_APP=hello.py flask run
Which has returned the error:

Error:
Error: The file/path provided (hello.py) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ensure the extension is .py Matts-MacBook-Pro:~ Matt$
I've created and put the code into hello.py as requested by Flask - does it need to be saved somewhere specific. Is that the reason for the error?

Thanks again :-)
Reply
#4
app.py
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "<h1><center>Hello World!</center></h1>"

if __name__ == '__main__':
   app.run(debug=True)
Now can just run it with python app.py
Example.
E:\1
λ python app.py
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 184-514-049
Go to localhost address in browser.
Look this post for a minimal setup.

The other way to run with flask run is described here
But the way shown over work fine.
Reply
#5
I'm in!

[Image: Screen_Shot_2018_02_18_at_03_27_25.png]

Thanks again.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  difference between forms of input a list to function akbarza 6 1,007 Feb-21-2024, 08:02 PM
Last Post: bterwijn
  python can - general question caslor 0 1,106 Jul-14-2022, 05:21 PM
Last Post: caslor
Question email code works in 2.7 but not in 3 micksulley 3 2,558 Nov-04-2021, 09:44 PM
Last Post: micksulley
  How can I get Python Bulk Email Verification Script With API? zainalee 1 2,485 Jun-06-2021, 09:19 AM
Last Post: snippsat
  Need Outlook send email code using python srikanthpython 3 8,194 Feb-28-2021, 01:53 PM
Last Post: asyswow64
Video Python Bulk Email Verification Script With API Aj1128 0 2,613 Nov-28-2020, 11:38 AM
Last Post: Aj1128
  Sending Out Email via Python JoeDainton123 1 4,753 Aug-31-2020, 12:54 AM
Last Post: nilamo
  How to send email using python? Gigux 2 2,833 Jul-04-2020, 07:53 AM
Last Post: Gigux
  I am trying to send an email with python nick235 9 5,273 Jun-29-2020, 06:40 PM
Last Post: nick235
  General question about serialization/deserialization in python local 1 1,833 Jan-28-2020, 04:35 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020