ok here's my upgrade to PEP 8 style conventions:
Changes that I've made:
Alysha.Py
I'll look into upgrading to Python 3, but I'm not going to do that right away.
I would also like to learn more about how to create and implement a configuration file that Gribouillis had suggested for the file path names and global variables. That sounds interesting I don't like having to hard-code file paths so if there's better way to do that I'm all eyes. Can you point to any instructions on how to do that?
Thanks for all the constructive mentoring thus far. This is what I came here for.
Further Housecleaning via PEP 8 style:
I was concentrating so much on the class and methods formatting that I forgot about the variable names conventions.
So now I realize that Tasks should be tasks in both Alysha.py and AlyshaPass.py and the variable "message" in the write method also should be all lowercase.
So,... here's the latest update:
Alysha.py
Changes that I've made:
- Changed namespace folder to lowercase. alysha_pass. (Using underscore here because of lowercase)
- Removed underscore from the class name AlyshaPass()
- Removed the Alysha_ prefix from the read() and write() methods and wrote them using all lowercase.
Alysha.Py
from alysha_pass.AlyshaPass import * def main(): Tasks = AlyshaPass().read() print Tasks Alysha_Pass().write("Dummy Message") return 0 if __name__ == '__main__': main()AlyshaPass.Py
class AlyshaPass(): def __init__(self): pass def read(self): Tasks = ['Task 1','Task 2','Task 3','Task 4','Task 5'] return (Tasks) def write(self, Message): print "\n" , Message , "\n"
Output:['Task 1', 'Task 2', 'Task 3', 'Task 4', 'Task 5']
Dummy Message
Any other great suggestions? I'll look into upgrading to Python 3, but I'm not going to do that right away.
I would also like to learn more about how to create and implement a configuration file that Gribouillis had suggested for the file path names and global variables. That sounds interesting I don't like having to hard-code file paths so if there's better way to do that I'm all eyes. Can you point to any instructions on how to do that?
Thanks for all the constructive mentoring thus far. This is what I came here for.
Further Housecleaning via PEP 8 style:
I was concentrating so much on the class and methods formatting that I forgot about the variable names conventions.
So now I realize that Tasks should be tasks in both Alysha.py and AlyshaPass.py and the variable "message" in the write method also should be all lowercase.
So,... here's the latest update:
Alysha.py
from alysha_pass.AlyshaPass import * def main(): tasks = AlyshaPass().read() print tasks Alysha_Pass().write("Dummy Message") return 0 if __name__ == '__main__': main()AlyshaPass.py
class AlyshaPass(): def __init__(self): pass def read(self): tasks = ['Task 1','Task 2','Task 3','Task 4','Task 5'] return (tasks) def write(self, message): print "\n" , message , "\n"I'm learning one step at a time.