Py2App How to use - python

How does one exactly use Py2App, which creates standalone applications for python. I downloaded it, but have no idea what to do next, what to install, etc...

All the documentation is here, found with a simple Google search:
http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html
Why not read that first, before you ask other people to spend time helping you out?

Related

What do I need to do for adding python executable to HTML?

I made my own game in python using turtle graphics and I want to convert it to an executable file to run in HTML, is there any additional information I should know
Edit: An executable is not likely what you're looking for per Chris' answer. He also provides info about making an installer, if you do want to accomplish that. My answer addresses getting your Python game running in the browser.
When I initially saw this question, I thought it wasn't a thing. However, Python is just a language. Anything can interpret and run Python logic. It's just a matter if someone has built something that works in the browser and interprets Python.
After some Google searching, I found Skulpt: http://www.skulpt.org/. It appears to be a Javascript implementation of a Python interpreter. This is important because browsers only understand Javascript, not Python.
Something worth noting is that Skulpt appears to only have partial support for Python 3. It mostly focuses on Python 2. This could be a major concern because Python 2 is scheduled for end of life January 1st, 2020 (at least, that's what pip told me).
There are examples of using Skulpt on its page. Heads up that you'll likely need to learn some amount of Javascript, but if you're comfortable with Python already, that shouldn't be terrible.
Edit:
There also appears to be Brython: https://brython.info/. This is a Python 3-focused implementation. At first glance, it looks a little easier to use, too.
Hope this helps!
Please know that executables (.exe) & browsers tend not to work together.
See this stackoverflow question referring to .exe's & html The long & short of it is that you can setup .exe's so they can be downloaded, but not rendered in the browser.
If you want to convert your script to a .exe file, you'll need something like pyinstaller. Here's a link to some info about installing & using it.
TheBeege's answer is on point with rendering in the browser with python when you already have code written with turtle. I just wanted to make sure anyone coming here looking for info on python with executables could find it.

How do I deliver ready-to-run software?

Recently I've been developing Python code as a freelancer. I've mostly worked on social media bots, my usual way of delivering the code is as a Python script for people to run on their compilers. However, I've started to run into people that lack the technical knowledge of installing modules and running the code that way. How do I create a package like software and deliver it in a way that can be ready-to-run and users don't have to download anything extra? Thank you in advance for your feedback.
Check out py2exe. It is a wrapper that converts your script into an executable, so the user can run it without needing to install any python libraries.
Alternatives to py2exe are:
PyInstaller - the advantage of using this is that it lets you build executables in formats other than exe, if you want to make your program run on non-Windows platforms, for example.
cx_Freeze - this is also another cross-platform alternative.
One method would be (as stated in the previous answer) is to use exe converters, but that wouldn't be as effective if you target Mac and Linux users as well.
My solution is going to take you a little more time, but it will be worth it. Here goes:
Please learn Angular JS, or some other framework (I prefer Angular). Once you know that, you can easily develop a web app for your project, and add your Python to that.
The good news is, there are lots of tutorials for this, such as https://codehandbook.org/creating-a-web-app-using-angularjs-python-mongodb/ (also teaches you mongodb) Anyways, you can find other tutorials on your own.
You could of course, I guess, build it into a mobile app, but I think web app would be easier.

Tablesnap not working

I'm trying to use tablesnap to make backups but without success. I'm using Ubuntu 12.04 and after trying the installation of tablesnap as it is described in github, I'm not able to do it. I guess this is due to fact that the package is for Maverick, so I have tried to copy the code and execute it but again without success. It always display the message "INFO Starting up" and seems nothing happen.
I'm sure the problem is my ignorance but, could you help me? Do you know about any document or example of installing and using for backup and recovery?
UPDATE:
The problem was me. Tablesnap was working but there was no IN_MOVED_TO event. So, now, what I'm trying to do is to backup a complete keyspace. I have tried with the "-B" option of tablesnap but still nothing is uploaded to S3. Any idea?
I'm sure the problem is my ignorance of linux, python and cassandra, but I haven't found enough information to make it work or a step by step document
Being blunt here: yes. You've got the answer to your own question. It's complicated to get used to all of that at once, but a step-by-step document won't help you a bit. Really. You need to be familiar with what you're doing, or else you won't be able to do something useful.
To compare: Installing cassandra is like buying a dentist's chair. Even with a very precise step-by-step information on how to set it up and how to place a patient on it, you'll be a terrible terrible threat to your patient's teeth if you have no education as a dentist before.
Cassandra is a mighty tool for large, ditributed systems. Someone who develops for that or even just administrates that needs to have very solid understanding of how to work with his computer in the environment that cassandra runs in. Get yourself used to linux. Then read a lot about cassandra. Then that project is on your level, and you will have success!
Ok, what I was looking for is very easy. Here is what I have done to make a complete backup of my keyspaces:
python tablesnap -k MY_AWS_KEY -s MY_AWS_SECRET -B my_s3_bucket /opt/cassandra/data/my_keyspace/*
Just replace /opt/cassandra/data/ with the path to your keyspace and that's all. As simple as this is what I was asking for, so I leave it here in case someone finds it useful.

How to package a python program for distribution on a network

I'm not sure if I'm even asking this question correctly. I just built my first real program and I want to make it available to people in my office. I'm not sure if I will have access to the shared server, but I was hoping I could simply package the program (I hope I'm using this term correctly) and upload it to a website for my coworkers to download.
I know how to zip a file, but something tells me it's a little more complicated than that :) In fact, some of the people in my office who need the program installed do not have python on their computers already, and I would rather avoid asking everyone to install python before downloading my .py files from my hosting server.
So, is there an easy way to package my program, along with python and the other dependencies, for simple distribution from a website? I tried searching for the answer but I can't find exactly what I'm looking for. Oh, and since this is the first time I have done this- are there any precautions I need to take when sharing these files so that everything runs smoothly?
PyInstaller or py2exe can package your Python program.
Both are actively maintained. PyInstaller is actively maintained. py2exe has not been updated for at least a year. I've used each with success.
Also there is cx_Freeze which I have not used.
Take a look at http://www.py2exe.org/

Python build/release system

I started using Pyant recenently to do various build/release tasks but have recently discovered that development for this project has ended.
I did some research and can't seem to find any other Python build scripts that are comparable. Just wondering if anyone can recommend one? I basically need it to do what ANT does - do SVN updates, move/copy files, archive etc using an XML file.
Thanks,
g
Probably the best answer is to use Ant as-is... that is, use the Java version. My second suggestion would be to use scons. It won't take much time using scons before you're asking, "Who ever thought of using XML to script a build?"
Its not completely comparable but I tend to use fabric. Its more geared towards deployment with support for ssh to production host and runing things as root there etc.
Some people use Paver for build/deployment of Python packages. While I know it works, it does not appeal to me that much.
what about maven? (http://maven.apache.org/) With the right plugins it can do much more then ant, it can even use ant for building if you configure it so.
It's very flexible and supports the full product life cycle. I really recommend you take a look at it.

Categories

Resources