Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDaniel Santos
34,969 PointsWhat do you mean by 'something I can use from Flask'?
So, if I create an command line application I can integrate it to a web site? I am new to python and back-end development and I don't know where to start doing things.
stuartholland
10,773 PointsGiven some backend setup, yes you can. There are two later courses in Python: Flask Basics and Bulding a Social Network with Flask, that use Python and the Flask framework to integrate our command line work into a web app.
Daniel Santos
34,969 PointsNice! I have a couple of console application that might be good to have it in a web app.
2 Answers
Ricky Catron
13,023 PointsIt is very easy to turn a command line application into a website in Python. The tricky part is separating the logic from the display. By this I mean you won't be printing anymore you would be instead sending the variable to the webpage so HOW you are displaying it will change but the logic will not. You will likely be able to keep most of your functions the same but you will likely need to make some changes in the display.
Goodluck! --Ricky
Alx Ki
Python Web Development Techdegree Graduate 14,822 PointsJust adds if name == 'main' in case if we will import this file to anywhere for using functions and database. If we import it without that block it will 'execute'.
varun dixit
731 Pointsalexey kislitsin i have a query that if i import this file like "from diary.py import * " does it means it will execute automatically if i don't use the " if name = "__main" ", so can you tell me what is value of name in case when i import it in other file
Alx Ki
Python Web Development Techdegree Graduate 14,822 PointsVarun Dixit You always do it the same:
if __name__ == "__main__":
# Do the thing!!!
Chris Freeman
Treehouse Moderator 68,457 PointsChris Freeman
Treehouse Moderator 68,457 Pointstagging Kenneth Love