![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Programming Talk This forum is for all programming questions. The questions do not have to be directly related to Ubuntu and any programming language is allowed. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
A Carafe of Ubuntu
![]() Join Date: Mar 2007
My beans are hidden!
|
Need your comments on a PyGTK PlayStation CD backup tool
Hi all,
This is my first post in this section and I hope I get something useful out of it. I am new to programming and currently learning python, working on a GUI app to backup PSX games using "cdrdao" as a backend. The program in its current state works just fine, but I can see lots of drawbacks: 1-The program is bloated and the code looks ugly. 2-No object-oriented programming was used. ( I know it's not necessary) 3-Many noobish habits and techniques were used to solve some problems. 4-The use of some shell commands instead of doing things in a pythonic way. I want you to help me polish it and teach me how to do it the right way (and help me toss those bad techniques away) I would also appreciate it if someone could tell me why I would want to do it in OOP, what's the benefits? what's object-oriented programming?(still struggling with this question) Here's the code: http://dpaste.com/hold/28221/ Note the use of the global variable avail, I am sure there is a better way, but can't come up with it. Thanks in advance, verb3k
__________________
Freedom is neither exclusive nor unlimited. |
|
|
|
|
|
#2 |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2006
Location: Slovenia
Beans: 356
Ubuntu Karmic Koala (testing)
|
Re: Need your comments on a PyGTK PlayStation CD backup tool
insted of:
PHP Code:
PHP Code:
Also: PHP Code:
PHP Code:
|
|
|
|
|
|
#3 |
|
Ubuntu Master Roaster
![]() Join Date: Jan 2006
My beans are hidden!
Ubuntu Jaunty Jackalope (testing)
|
Re: Need your comments on a PyGTK PlayStation CD backup tool
may I suggest looking into libglade?
__________________
I am infallible, you should know that by now. "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall 42 lines of Perl - SHI |
|
|
|
|
|
#4 |
|
Tall Cafè Ubuntu
![]() Join Date: Oct 2006
Beans: 2,678
Ubuntu 7.10 Gutsy Gibbon
|
Re: Need your comments on a PyGTK PlayStation CD backup tool
I second that. It will make it easier to maintain later. Dynamic widget creation should be reserved for applications that require their interface to dynamically alter itself, this one is stationary so I would just use Glade.
My other critique (since you asked) is to use 4-space tabs instead of regular tabs (it's practically standard in Python, and is definitely considered good practice).
__________________
|
|
|
|
|
|
#5 |
|
A Carafe of Ubuntu
![]() Join Date: Mar 2007
My beans are hidden!
|
Re: Need your comments on a PyGTK PlayStation CD backup tool
Thanks Quikee for those corrections .... will be studied indeed
slavik and Wybiral, I agree ...I should have used glade but I thought as I was learning, I needed to know how to do a GUI myself rather than using a builder. I think I am starting to understand some basics. I also like the idea that my program is only one file
__________________
Freedom is neither exclusive nor unlimited. |
|
|
|
|
|
#6 |
|
Ubuntu Master Roaster
![]() Join Date: Jan 2006
My beans are hidden!
Ubuntu Jaunty Jackalope (testing)
|
Re: Need your comments on a PyGTK PlayStation CD backup tool
understandable, but the counterpoint to the one file program is that (while not in this case) sometimes splitting your program into separate files is very good for maintainability (library/front end is a very common split).
__________________
I am infallible, you should know that by now. "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall 42 lines of Perl - SHI |
|
|
|
|
|
#7 | |
|
A Carafe of Ubuntu
![]() Join Date: Mar 2007
My beans are hidden!
|
Re: Need your comments on a PyGTK PlayStation CD backup tool
Quote:
Don't you think that's true?
__________________
Freedom is neither exclusive nor unlimited. |
|
|
|
|
|
|
#8 | |
|
Ubuntu Extra Shot
![]() Join Date: Apr 2006
Location: Slovenia
Beans: 356
Ubuntu Karmic Koala (testing)
|
Quote:
PHP Code:
|
|
|
|
|
|
|
#9 |
|
A Carafe of Ubuntu
![]() Join Date: Mar 2007
My beans are hidden!
|
Re: Need your comments on a PyGTK PlayStation CD backup tool
Thanks Quikee for your support
Any other comments are welcome.
__________________
Freedom is neither exclusive nor unlimited. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|