Oh and adding on one more questions - is it more common to write the full name of the flags or the short names of the flags?Eg. cmds.camera(q=True) or cmds.camera(query=True)
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/98e1fd5c-1591-4736-b4f1-ac0725cdb4c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Oh and adding on one more questions - is it more common to write the full name of the flags or the short names of the flags?Eg. cmds.camera(q=True) or cmds.camera(query=True)
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
I did chance upon that particular link you have put, while I am able to document it as follows, I am still having confusions on how to 'break' up my lines (kindly see the paste bin link in my first post)
I have seen some whom break it it by placing it 4 spaces after the first bracket while some places it directly at the same 'column' under the first flag
Truth be told, rather than saying I am not a fan of _underscore_variable, like what you have mentioned, I am still very much in scripting and hence I have been creating some new functions in camel case since I am used to that and easier to type but those will soon be changed to pep8 for such as variable_name
Have just modified the code to use the long names for easier clarification but that simply means making my lines longer which is not part of pep8 style and as mentioned in my reply to Justin, currently I am having troubles 'breaking' the lines up, not doc strings
I'd recommend installing a linter in your favorite editor/IDE to serve as a guide on how to format your code. For PEP8 and the line breakings you mention I'm using "flake8". I use that in Sublime Text and I highly recommend it for anyone writing Python. Flake8 is available in most advanced editors where you would typically write Python code.
I figured I'd also mention that PEP8 says you should only use camelCase "in contexts where that's already the prevailing style". And by that I do not mean to bash anyone's coding style, but if you were under my code review, I would kindly ask you to fix it ;)
Cheers!
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/815d97df-9832-4480-ab07-f85e2c8e77af%40googlegroups.com.
In my view it's almost always better to stick to the style of the API your code interact with the most, so it all looks homogeneous and familiar.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPamJi85EiFY%2BXT7%3D6X_3gomXUgi-5%2Btq2eZV44pDzcsaeF%3Dmw%40mail.gmail.com.
In my view it’s almost always better to stick to the style of the API your code interact with the most
…
I tend to make it conform with the existing predominant api
That could work, but personally, I think one should write code that conforms to surrounding code. Such as, other projects in an organisation. Regardless of which libraries which happen to be used internally.
Put another way, I think that one should write code such that it creates the least amount of friction for whomever is most likely to read it apart from yourself.
On this mailing list for example, there is really only one choice; PEP08. Likewise for open source projects. Simply because without a pervasive style, there is only one style that matters apart from your opinion. And unless you are working alone, your opinion doesn’t matter.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2KHvhS-8fBcvCEF5SO5xFuGiM8fhw39m%3D1pAboNdy02A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBqGLEynDVZcc%2BXd4ux0nx3%3DMbW2PCgpAXSVHOwBTDgzQ%40mail.gmail.com.
Hi all, very much appreciated for the replies.
Like some have mentioned, I am having issues whether to use camelCase or not, though at certain pep8 docs seem to be implying that I can mix those underscores etc. such as
class pepTest(object):
def _init_(self):
self.randomValue = 10
...
def getMayaVersion(self):
maya_version = str(mc.about(v = True))
And that is probably the root of my confusion...
Still not sure what is right or wrong...
Also an off topic question - how complicated will it be to change all maya ui layout commands into pyqt format (just so you know, I have an entire ui that is made up of maya commands)
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f051c7bf-18ba-4dc5-8a30-eb6450260912%40googlegroups.com.
yep, that is what I am referring to, especially those single or double underscores right at the front of the function name etc.However can I mix around, like what I did for that code example?
I used to do a bit of pyqt coding... just debating if I should change it to pyqt or not
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/27f2879f-635b-4331-8c44-ff111a1a4428%40googlegroups.com.