1

I want to get a variable naming in a consistent way

I think cgi is an abbreviation,so it should be CGI

Should I change the set_camera_cgi to set_camera_CGI

But what if cgi_set_prefix to CGI_set_prefix,

Therefore the variable will start with a upcase, will it be more worse?

def set_camera_cgi(self, set_CGI_lst): try: cgi_set_prefix=''.join([ "http://", self.conn_cfg["ip"], self.cgi["set"]]) cgi_get_prefix=''.join([ "http://", self.conn_cfg["ip"], self.cgi["get"]]) 

1 Answer 1

1

Name abbreviations using the usual lowercase convention (e.g. the cgi module, not the CGI module). Basically, name everything according to PEP 8 when reasonable (even abbreviations).

Sign up to request clarification or add additional context in comments.

4 Comments

But he suggested capitalize all the letters of the abbreviation , so I'm kind of confused stackoverflow.com/questions/2853531/…
Only When using abbreviations in CapWords. So, you would always write nasa_jpl in a function or variable name.
so even in module name(filename), I should use cgi_automation.py , not the CGI_automation.py , it's a more common convention , right ? Only use Class CGIAutomation in camel case, that is class name, right ?
Yep. You should use the lowercase for naming the files. And yep to the class name, too.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.