Python Forum
New header in "Python coding" - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: New header in "Python coding" (/thread-136.html)



New header in "Python coding" - Ofnuts - Sep-22-2016

The header says:

Quote:Put any of your code in BBCode to preserve Python's indentation

I was going to say that the linked help doesn't mention the [code] tags... but that just because I overlooked it... So if someone like me, knowing what he is looking for, doesn't see it, I wonder what the newcomers will see. I think the example code should be made bigger (a small function body) to be easier to spot (and better show the merits of the [code] tags)


RE: New header in "Python coding" - metulburr - Sep-22-2016

Ill modify this...thanks.


RE: New header in "Python coding" - snippsat - Sep-22-2016

I do not think that code button should be mention as to be used preserve Python's indentation.
Now that modification has been done(no PHP),i want all to use Python code button(look a lot better).
So here a picture that you may use.
[Image: vkYoys.jpg]


Python code block.
import requests
from bs4 import BeautifulSoup

url = 'url'
url_get = requests.get(url)
soup = BeautifulSoup(url_get.content, 'lxml')
tag = soup.find('title')
print(tag.text)
print(soup)
Original Code block.
import requests
from bs4 import BeautifulSoup

url = 'url'
url_get = requests.get(url)
soup = BeautifulSoup(url_get.content, 'lxml')
tag = soup.find('title')
print(tag.text)
print(soup)



RE: New header in "Python coding" - metulburr - Sep-22-2016

Quote:Now that modification has been done(no PHP),i want all to use Python code button(look a lot better).
The python code block is just php syntax highlighter though.... where the button is reskin'd to look like python. That personally drives me nuts to look at a syntax highlighter that skips some keywords, but not others. I would rather use the original.

EDIT:
and i thought that was still being worked on to integrate shcode (if at all it ever gets fixed) and/or to change the php syntax highlighter to regex python keywords and ignore php's.


RE: New header in "Python coding" - snippsat - Sep-22-2016

Quote:The python code block is just php syntax highlighter though. where the button is reskin'd to look like python.
Yes i should now,spend some time on it to do the reskin ;)
The whole point is that that is preserver Python indentation and look a lot better than regular Code block.

from flask import Flask
app = Flask(__name__)

#Route to browser
@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()
Quote:EDIT:
and i thought that was still being worked on to integrate shcode (if at all it ever gets fixed) and/or to change the php syntax highlighter to regex python keywords and ignore php's.
Yes still working on it,had to take a break after spending a lot of time on it.
I need Help from my MyBB staff,i will make that post myself to explain all the stuff i have tried.
So if get it to work there will two buttons to choose from.