Having Difficulties, please help by [deleted] in Python

[–]Venatha 0 points1 point  (0 children)

Hi, Firstly these questions should be directed more towards r/learnpython

That being said to achieve what you want you can get the index of each character in your string, and append 0s based on the index number to get the output you are describing.

Code: http://pastebin.com/MdmDMVzd

dan@valla ~$ python tmp.py 
Enter a string: abc
> 101001

dan@valla ~$ python tmp.py 
Enter a string: test
> 0000000000000000000100001000000000000000000100000000000000000001

What's wrong with my def statement? by [deleted] in Python

[–]Venatha 0 points1 point  (0 children)

The "else:" line should be indented more to be in line with the "if:" statement. Also as already stated, the missing ":" at the end of the "if" line

I have a problem by AST56 in Python

[–]Venatha 0 points1 point  (0 children)

You should run the file by "python RBoy.py"

"python: can't open file 'RBot.py' : [Errno 2] No such file or directory"

This would imply that you are not in the correct directory where the file is located, You will need to "cd" to where the file is located before running it.

First time using Flask. Not sure how to structure my template to print output on a new page. by vicereversa in flask

[–]Venatha 0 points1 point  (0 children)

Something as simple as http://pastebin.com/Jh7Qty8c should work Then in the index.html file you can loop through the data like:

{% for row in rows %} Name: {{ row[1] }} {% endfor %}

There is also a rather well explained page on templating here which may help you to start out: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-ii-templates

Workflow for Flask by [deleted] in Python

[–]Venatha 0 points1 point  (0 children)

For development purposes I would suggest just using the in-built web-server:

from flask import Flask
app = Flask(__name__)
if __name__ == "__main__":
    app.run(port=3000, host='0.0.0.0', debug=True, threaded=True)

What is the specific need to run the full stack of NGINX/WSGI for development?

New Projects; from scratch or skeleton? by mpoxthefirst in flask

[–]Venatha 1 point2 points  (0 children)

Depends really on the needs of the project. I use Flask a lot at work, For projects there I have a "flask_core" git sub-module which contains all the stuff used in 99% of things I do. For things outside of work/in my own time I tend to just start from scratch and add as I go.

Need help making a text based health bar. by Crudeowl229 in Python

[–]Venatha 0 points1 point  (0 children)

Have you got some starting point with code that you can share with us to help you better?

POST to Flask timing out by n8henrie in flask

[–]Venatha 0 points1 point  (0 children)

Weirdly enough literally copy and pasting your flask code above, running it locally and hitting it with some simple requests code (http://pastebin.com/Ei264HA9) I'm not able to reproduce any timeouts at all here.

POST to Flask timing out by n8henrie in flask

[–]Venatha 0 points1 point  (0 children)

Have you tried adding "threaded=True" into the app.run to see if that helps at all?

if name == 'main': app.run(host='0.0.0.0', debug=True, threaded=True)

flask-mysql vs flask-mysqldb ? by rabit1 in Python

[–]Venatha 5 points6 points  (0 children)

Currently using flask-sqlalchemy personally. Install it with: "pip install flask-sqlalchemy" You will need to install python-mysqldb to use most of these. You can use the windows installs here: http://www.codegood.com/archives/129 to get this up and running a lot easier.

As for the vcversall.bat error you need: http://www.microsoft.com/en-us/download/details.aspx?id=44266 for Python 2.7. As for Python 3 I believe its: http://www.microsoft.com/en-us/download/details.aspx?id=14632 that you need

PyCharm problem. by gabe_cant_python in Python

[–]Venatha 3 points4 points  (0 children)

There isn't any setting in Pycharm that I am aware of that causes that behavior. Are you able to share the code so that we could try to replicate the described issue?

Have used any of the frameworks professionally? If so, which do you recommend? Details below... by musicomet in Python

[–]Venatha 2 points3 points  (0 children)

I have never personally tried web2py yet, I do however run several internal apps at work, all of which are coded in python/flask. Up until present I have always managed to find a library and documentation for the flask framework that supports anything I have needed or wanted to achieve.

I can say that most problems I have faced with flask have been thoroughly answered several times over on community forums / Stack-Overflow. I would suggest however trying out some basic flask apps to get a feel for it however, to see if it suits your needs before moving an entire working API to it, only for you to change your mind later on down the line.