Forgive my ignorance but (in the modern era) my skills are limited to python and Wordpress with some HTML and a little bit of CSS.
I would like to demonstrate a software as a service idea by hosting a python script (I've already written) on the web. I'd like advice on the Platform and the user interface. At this stage I just want something quick and functional.
After some initial input from the user (basically a few key words and some other details) the Script searches the web and outputs a number of secondary keywords. I'd like the user to be able to choose which secondary keywords to take forward. Maybe drag and drop but could be just using arrow buttons to take a key word from one list/box to the next like in Microsoft Dynamics, for example. Flashy would be nice but not if it's going to slow me down and getting the thing up and running.
I'd really appreciate advice on how I could get the script up on the web. Apart from writing the Python script I've done nothing so I'm starting from a blank sheet of paper.
So far I have only been taught how to program/script at my school for console programs but wanted to start making some applications with an actual interface other then the command-line, unfortunately I have no idea where to begin. I tried to look it up but all I found were guides on how to "design" them not program them. As such I would like to ask you how exactly should I get started on this, I know this is a rather broad question but just a few links to some study material that can help me get started is enough. The languages I have been taught are Visual Basic and Python but I also know HTML and CSS, I am only slightly familiar with JavaScript.
(Bonus Question: so when looking at the website for Atom.io I saw that the editor was made in JavaScript, node.js, HTML and CSS. I was wondering how did they use HTML and CSS for a desktop app? Also, is it possible to do that without node.js and JavaScript, say for example with Python?)
Recommend begin with:
Visual Basic: Windows Forms(have a nice GUI editor, easier than TkInter)
Python: TkInter(Everything simple with pack()).
About HTML/CSS/JS desktop app use Electron http://electron.atom.io/
Given you already know python , you can use python library "Tkinter" to get started.
https://www.tutorialspoint.com/python/python_gui_programming.htm
https://wiki.python.org/moin/TkInter
Have a look at Graphics Py document created by John Zelle
http://mcsp.wartburg.edu/zelle/python/graphics/graphics.pdf
iam relativ new to Python and a noob in programming.
I wonder if there is a way to fill textfields
on a website?
Iam thinking about writing an python application for linux terminals where the user input will be send to the website, placed in the right webforms and then prints the formatted output back in the linux terminal. Is this possible?
It would be nice if such a thing is possible in python since I am just learning it and I like it so far.
I also tried looking for related stuff but I don't know where to start. Found this page here which seems like the right direction but I am not sure:
https://pymotw.com/2/socket/tcp.html
Also this seems right (https://splinter.readthedocs.io/en/latest/) but I am not sure if I can get the new page contents back on the terminal.
My question is how do i locate the form box to fill and fill it with text automatically using python for example I want to go to google and automatially search for "dogs" using python how would i locate the search box and put that into code to fill. New to python would appreciate a break down of how to do this.
If you just want to do some google searches and get the results, this other thread suggests Python libraries which exist specifically for this purpose like xGoogle, which would save you from having to write browser automation from scratch.
If you were just using Google as an example but want to do more extensive browser automation and run JavaScript and everything in a browser, you would want a more robust automation tool.
To get started as a beginner, you will want to figure out which Python browser/automation tools fit your needs best for what you want to accomplish, and then install the libraries and find some examples in the documentation - or ask a more specific question about the library on this site once you have tried to implement it!
I want to make a Python script available as a service on the net. The script, which is my first 'proper' Python program, takes a txt file as argument and writes an image into the work directory. So:
How difficult is it for somebody who is new to Python and web development?
How much work is it?
Do I need a framework (Django, cherryPy, web2py)?
Are there good tutorials?
How do I avoid the server to be compromised?
What are my next steps?
==> What is the easiest way?
In the end it is enough, if it is a white page, with some text, and a button, which when clicked, opens a file dialog. After the txt is processed, the server should just return the image, which was written on the hard drive. Already I have access to a server which has Ubuntu installed through a friend.
[update]
Thanks for all your answers. After reading them I want to stress again, that I want to have it as minimal as possible. Srikar's suggestion sounds like the easiest one:
Put it in executable directory of your OS (commonly known as CGI
path). Provide a simple HTML form & upon form submission hit this
script which executes & returns back the image you want to display.
Any objections or comments? Do you know any tutorials for that?
[udpate2]
I found this SO answer: File Sharing Site in Python Is this a sensible approach?
It's not too difficult. Actually, it sounds like a good first project.
That too subjective to answer. An hour to days.
No, you don't need one, but I'd use one if I were you. They abstract away some of the stuff you really don't care about, and you'll learn a tool you can use again in the future.
Plenty. If you want a real rundown of how Python works for the web, read the HOWTO from Python.org. If you just want to learn how to do this one project, pick a framework and do their tutorial.
This question is so broad and complex that I'm not going to try to answer it. Search this site, or Google, for questions like that.
Your next step should be to pick a framework; I've used Django successfully. Just download it, follow the installation instructions, and work your way through their tutorial; it should tell you everything you need to know to do what you want. If you still have questions once you've learned how to do the basics, come back and ask again!
Edit: The answer to that other question will certainly work for you. There, they just receive a GET request and respond with data from a Python file. You need to receive a GET request, respond with an HTML page (easy enough), then respond to a POST request that includes an uploaded file (slightly more complicated) and run your python routine on the uploaded file and then respond with the created image (or a link to it).
Take a look at this page which includes a simple Python script to do file uploads. You should easily be able to modify it to do what you want.
How difficult is it for somebody who is new to Python and web development?
Depends on your level of knowledge.
How much work is it?
Depends on which method you choose to solve the problem.
Do I need a framework (Django, cherryPy, web2py)?
Not necessarily - you could get started by using the CGI (http://docs.python.org/library/cgi.html)
Are there good tutorials?
Yes, there are plenty. The Python docs are an excellent place to start.
How do I avoid the server to be compromised?
Again, depends on the method you choose to solve the problem, although there are commonalities.
What are my next steps?
Dare I say it again, choose a method, read the docs, have a play!
If its just as simple as you have described it. Then you might not even need Django. You could simply use CGI scripting. All of these design decisions, depend on whether
You need (or foresee) a SQL storage?
or a Content-Management-System?
Will you need multiple-user support?
Do you need tight security?
Do you need different privileges for different users?
Do you need an Admin to manage your site?
If the answer to above questions is atleast 60% correct, then you might consider Django. otherwise, just write a python script. Put it in executable directory of your OS (commonly known as CGI path). Provide a simple HTML form & upon form submission hit this script which executes & returns back the image you want to display. So, it all depends on the features you need...
In the end, I created what I needed with Flask.
They have a well documented pattern / tutorial on Uploading Files. The tutorial is understandable even for people with little python and web expericence.
To get a first working version it took me 2h and the resulting code was only 50 lines. This includes, starting the webserver, having a html file/form with file upload and serving a file back to the user.