How do I run a Python script on my web server? [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I've just started learning Python, and I'm pretty lost right now. I want to run my script on my server that is hosted through hosting24.com. Their FAQ says they support Python, but I have no clue where to put my script for it to run.
There is a folder called cgi-bin in my root, I'm guessing that is where I put my script? Can someone explain to me how this works?

Very simply, you can rename your Python script to "pythonscript.cgi".
Post that in your cgi-bin directory, add the appropriate permissions and browse to it.
This is a great link you can start with.
Here's another good one.
Hope that helps.
EDIT (09/12/2015): The second link has long been removed. Replaced it with one that provides information referenced from the original.

Related

Can Python create a self contained package that can be deployed where python and pip is not installed? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Some programming languages provide capability t create a self contained packages that can run on any machine.
For example, dotnet core can self-contained apps per below:
https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained
The C# self-contained apps can be single large file, or a directory of all files required to run the application. The package can target Linux, mac or Windows.
In Python, what is the closest feature to self-contained app packages described above?
PyInstaller seems to be the current go to, and it works well in my experience. However, some people have reported that it has very large file sizes, but I've personally never found that to be a major issue.
If you use that, you would also probably need some kind of UI, but that's a separate issue in itself.

Input is available in VS Code? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I heard that it is not possible to give input to the python program In VS Code and for this issue We should open the python file on Command Prompt.
I wonder is it really true? Because Sometimes I write code on VS Code it asks for Input but sometimes It doesn't show anything. So what is going on?
The official python extension of VSCode provides Run and Debugging, almost like a IDE. It's impossible not to support input.
As for the source of your misunderstanding, it may be an extension like Code Runner, which does not support input, just quickly help you run the code and display the output.

Weird question, but how do I make a python script to check if python is installed? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Before you get confused, I am going to compile it with the auto-py-to-exe module after, its just the source code is in python. How do I do this?
If Python is not installed you wouldn't even be able to run a script to check if it's installed.
I'm pretty sure there isn't from inside the Python script. Because the interpreter isn't installed, so it'll never be able to understand HOW to execute the script at all.
You'll have to check outside in whatever is initiating the Python script and the compilation (bash script?) and do it there.

How does django call the .py files at root directory? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am working on a Django project that someone else started, and I'm new to Django, so I'm not sure about the workflow.
I see that there is a file called load_fixtures.py in the root directory (so the file is a sibling of manage.py) , but I don't understand why (and when) is that file called.
When? Does it get called only during syncdb?
Why? i.e. which file includes / calls it? Is it called just because it's in the root directory? Or does a line from settings.py include it?
Thanks in advance !
That is not a part of a standard Django project and is not automatically called by Django itself. I guess it's just a standalone file that the developer created, to run from the command line to populate the db.

Write a script that generates several directories, makes empty files, and then lists all file under the current directory [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm extremely new to linux and I have very very little experience with it.
The work I want to do:
write a script that generates a few directories, then
makes at least 5 empty files, and then
lists them all under the current directories.
I don't know how to start doing this.
check shell script for writing a linux script then use:
mkdir [folder name] : command to create directory
touch [file name] : to create a file
ls : to list file and directories
learning is fun and welcome to linux :D
Try to use the benefits of Linux itself.
Use a bash script instead of python, and use touch.
Google for both to know what to do.

Categories

Resources