Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New header in "Python coding"
#1
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)
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#2
Ill modify this...thanks.
Recommended Tutorials:
Reply
#3
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)
Reply
#4
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.
Recommended Tutorials:
Reply
#5
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  malformed header from script 'main.py': Bad header: * Serving Flask app "main" anuragsapanbharat 2 4,542 Jun-12-2019, 07:26 AM
Last Post: anuragsapanbharat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020