Code boxes seem to modify syntax

Status
Not open for further replies.
Member
Joined 2007
Paid Member
Greetings,

I have noticed that the
Code:
 boxes often change what I place in them!  Not desirable!

For example, I can not correctly display this particular line of python code - neither in body text nor in a code box:
GPIO.setup("P9_11", GPIO.OUT)

It looks correct until I post, and then when I read the post it has changed and if I copy/paste, it remains incorrect.

The above GPIO.setup line should have the syntax:
GPIO.setup-leftparen-doublequote-P9_11-doublequote-comma-space-GPIO.OUT-rightparen

Do you receive it correctly?

I am using the most recent Safari in OS X 10.10.5, if that matters.

Thanks for your work...

Frank
 
Last edited:
Waaait a minute! Now, 5-6 minutes later after posting from Chrome, the original post is displaying correctly! But if I reload the page it changes back to the wrong syntax. I will go back to Safari and check from there...
 
Last edited:
Courier new. I just checked my browser settings to confirm this because I can change it from there, but it's reasonable to assume it is the default in most browsers. It has been my preferred monospace font since it was in common use.
 
Showing this font without using the code tags.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import Adafruit_BBIO.GPIO as GPIO
import time
import smbus # needed if you later want to add i2c functions
# GPIO setup needed to address pins
GPIO.setup("P9_11", GPIO.OUT)
GPI😵utput("P9_11", GPIO.LOW)
GPIO.setup("P9_12", GPIO.OUT)
GPI😵utput("P9_12", GPIO.LOW)
GPIO.setup("P9_13", GPIO.OUT)
GPI😵utput("P9_13", GPIO.LOW)
rate = 0
rawrate = 0
 
Last edited:
...sorry, but THAT is what I'm talking about... At least the problem is being replicated! 😕 😕

I know of a few other examples where code was broken and can dig them up and supply them if it would help.

Frank
 
Last edited:
OK, I checked that twice before I left and it was OK, now I come back and it is parsed wrongly. I'm going to try it now with the -left bracket-noparse-right bracket- tags.


GPIO.setup("P9_11", GPIO.OUT)
GPIO.output("P9_11", GPIO.LOW)
GPIO.setup("P9_12", GPIO.OUT)
GPIO.output("P9_12", GPIO.LOW)
GPIO.setup("P9_13", GPIO.OUT)
GPIO.output("P9_13", GPIO.LOW)
 

Attachments

  • Untitled.png
    Untitled.png
    18.3 KB · Views: 70
Last edited:
OK, I took out the spaces and it changes, taking out the parentheses on the right (first and third lines). The fifth is OK if I take out the first few characters.


GPIO.setup("P9_11",GPIO.OUT)
GPI😵utput("P9_11",GPIO.LOW)
GPIO.setup("P9_12",GPIO.OUT)
GPI😵utput("P9_12",GPIO.LOW)
O.setup("P9_13", GPIO.OUT)
GPI😵utput("P9_13",GPIO.LOW)
 
Last edited:
It seems to get left alone using the special tags, I've seen this done before and until now didn't realise why

[special=GPIO.setup("P9_11", GPIO.OUT)
GPI😵utput("P9_11", GPIO.LOW)
GPIO.setup("P9_12", GPIO.OUT)
GPI😵utput("P9_12", GPIO.LOW)
GPIO.setup("P9_13", GPIO.OUT)
GPI😵utput("P9_13", GPIO.LOW)
]%[/special]
 
Status
Not open for further replies.