Click to See Complete Forum and Search --> : what to choose
m3rlin
01-16-2005, 07:47 PM
Here is the thing.
I want to learn to program a language, that i can program data base, create scripts, create graphic interface, and mutch more.
I have a small exerience programing c++, more than one year that i don't program :(
i used to program Visual Basic (only windows, blargh)
I was thinking in PEARL, but im not sure, thats why im here to have some sugestions from people who programs.
My requierments are: Data Base, Graphic Interface, NOT OBSOLETE and kind of a easy programing. Im starting, but i want to grab on tho a language, and learn to the deep.
What do you sugest? Is Pearl ok?
is there other better?
soulestream
01-16-2005, 09:06 PM
python seems to be a popular choice
soule
flukshun
01-16-2005, 09:07 PM
it's Perl. and yes, Perl is awesome. More so in the DB area than the graphics area. In fact, stick to C++ for graphics cuz ncurses in perl is a little quirky, and packages like Tk are a bit limited.
m3rlin
01-16-2005, 09:13 PM
Well i really would like to combine, Data Base with Graphic.
Let's say: Make a Video Data Base.
This will have a Data Base, and i want with graphic.
bwkaz
01-16-2005, 11:19 PM
I'm not sure on Python database stuff (though I'm sure if you searched the docs for ODBC you'd very likely find something helpful), but if you want a Gtk2 interface with a Python frontend, it's relatively easy (once you know what to do). If you have a recent version of Fedora, you already have all the libraries you need (because the Fedora config tools use exactly this way of doing Python+GUI). If you don't have Fedora, then install the following (preferably from distro packages):
glib (Note: NOT glibc, glib. ;) It's the base library for Gtk+. If Gtk+ (version 2) is already installed, then skip to Python. Use version 2.x.y.)
pkg-config 0.15.0 (if not installed)
atk
pango
gtk+ (version 2.x.y)
Python (if not installed)
glade-2 (make sure it's version 2)
libglade (latest version)
PyGtk (the Python wrapper for Gtk+ widgets -- latest version)
At this point, you can fire up glade-2 and make a Gtk2 user interface. Save the result anywhere you want (it'll be a .glade file), and then do this in your Python program:
#!/usr/bin/env python
# (That line is in every Python script.)
import pygtk
pygtk.require("2.2") # The version here is the minimum
# version of Gtk+ you want your script to support.
window.signal_autoconnect({"on_window1_delete_event":
gtk.main_quit})
# Connect the on_window1_delete_event signal to the
# handler gtk.main_quit. This handler shuts down Gtk,
# so you want to hook it up to the close-window event.
# To get this event declared in the .glade file, you have
# to go into glade-2, select the window1 widget (if you
# didn't name it window1, then replace window1 with
# whatever you did name it), and go to the Signals tab.
# Create a signal hookup for the delete_event, and
# keep the default name for the handler function.
# This will create a signal hookup declaration in the
# XML file, which you can refer to in the
# signal_autoconnect function call.
gtk.main() This assumes the latest PyGtk. If you get errors where gtk.main_quit or gtk.main() aren't defined, then you have an older PyGtk, and you should probably try gtk.mainquit (I think) and gtk.main_loop() (again, I think), respectively.
But if you don't want to do Python, then forget everything I'm saying. :D That's your decision, I'm just showing you how to do Gtk2 with Python if you want to go that route. :)
m3rlin
01-18-2005, 07:57 PM
im giving a try on python.
I've downloaded the last version 2.4. Im reading Dive in to python, i have this little "first" program.
def buildConnectionString(params):
"""Build a connection string from a dictionary of parameters.
Returns string."""
return ";".join(["%s=%s" % (k, v) for k, v in params.items()])
I used "pico" to edit a file named odbchelper.py, then wrote the code, and saved, then python2.4 odbchelper.py
Once again nothing happend.
For what i read, its supost to layout this:
server=mpilgrim;uid=sa;database=master;pwd=secret
What im i doing wrong?
thanks
m3rlin
01-18-2005, 08:22 PM
after looking in google, i found what i was doing wrong.
1st i didin't wrote on the top of the program
#!/usr/local/bin/python
and the i didn't chmod +x <file.py>
:)
cybervegan
01-25-2005, 06:30 PM
Hi Merlin,
Here's a suggestion for a good, up-to-date book on Python:
Alex Martelli "Python in a Nutshell" published by O'Reilly, of course.
Dive into Python is quite good, but it's a bit dated and Python has come on in leaps and bounds since it was published.
When you run into the inevitable brick wall (we all get them) with some program or other you're writing, get yourself subscribed to the Python mailing list - see
BTW - Ubuntu is another Python-based linux distribution.
Hope that helps,
-cybervegan
Choozo
01-25-2005, 06:44 PM
If you've had some C++ experience, why not dive into Java?
J2EE and the JBoss Application Server hooked up with MySQL/Oracle/etc. should give you plenty :D
svetho
02-01-2005, 12:20 PM
Learn Perl. Larry Wall is a semi-god and Perl is his gift to mankind ;-). No honest, Perl is a marvel among programming languages, you can do *virtually anything* with Perl, little helpers for the command line to sophisticated projects. Also I'd rather program an entire office suite in brainf*ck than a hello world program in Python ;-) (don't want to start a flame war here, that's just my personal opinion). But keep in mind: Tim today, i.e. There's More Than One Way To Do It. Have a look at some programming languages and then stick with the one you like best.
cybervegan
02-01-2005, 05:37 PM
Hash-bang's intentionally omitted:
""" Hello World in Python """
print "Hello World!"
----8<--------8<--------8<----
# Hello World in Perl
print "Hello World!\n";
----8<--------8<--------8<----
Try doing Hello World in RPG 3 if you want difficult!
Theres no need for language snobism - you have to choose one that makes sense to you. "Hello World" is not usually a good way to get the feel of a language in action. Perl's philosophy differs greatly from Python's, where perl stresses "expressiveness" python stresses simplicity and readability. Perl is not renowned as a good language for collaborative work, wheras that's precisely what Python is designed for. Actually, you *can* write impenetrable code in Python, but you have to use clever hacks, wheras with Perl, you are actually encouraged to do so (by some) and the language will help you along with it too.
Out of interest, Perl and Python have "cross-fertilized" a lot, with ideas and libraries flowing from one to the other. Perl's object-oriented extensions are based on the Python model, and there are lots of libraries (regex for example) in Python which are based on Perl's CPAN.
Larry Wall (the inventor of Perl) and Guido van Rossum (ditto Python) are rumoured to be "good mates".
There's room for every language - you just have to choose one that fits with your style and the tasks you want it to perform. For me, that's Python - I can do the quick'n'dirty hacks on the command line when I need to, and I can write clear, structured 2,000 line programs that I can come back to modify three years later and still understand what it all does. More importantly, someone who's not a python whiz can, too.
regards,
-cybervegan
m3rlin
02-01-2005, 09:10 PM
Thanks for all your replies, it have been very usefull, after a careful review on programing language, i gonna give a try to Phyton.
I have been reading about phyton, and i enjoy it
svetho
02-02-2005, 11:13 AM
Originally posted by cybervegan
Perl's philosophy differs greatly from Python's, where perl stresses "expressiveness" python stresses simplicity and readability. Perl is not renowned as a good language for collaborative work, wheras that's precisely what Python is designed for.
;)
# That's a Perl comment
Actually you can write readable code in Perl but Perl doesn't force you to do so. That's also why you can write some very cool one-liners. Also you can embed the POD (Plain Old Documentation) in your code and have manpages or HTML code easily created from it.
Just because you can write obfuscated code in Perl doesn't mean you have to. ;)
cybervegan
02-02-2005, 02:37 PM
># That's a Perl comment
Oh yeah ;-) - it's also a Python comment. And a Bash/Bourne shell comment, and in fact a comment in quite a few other programming and non-programming languages :-D
>Actually you can write readable code in Perl but Perl doesn't force you to do so.
Actually, you can write obfuscated code in Python, but it doesn't force you to do so ;-D Touche'
>That's also why you can write some very cool one-liners.
Well, you can with Python too (just surf comp.lang.python for examples). I tend to work from the Python interpreter command -line in IDLE because it has superior editing facilities and sits better in a GUI, so you don't *have* to do things on one line, but sometimes you need to.
> Also you can embed the POD (Plain Old Documentation) in your code and have manpages or HTML code easily created from it.
You see the """ .... """ bit at the top of my micro-sample? That's called a DOCSTRING and that's exactly what they're for. The commensurate utilities are there too, part of the standard library, to do the HTML-ising. Not sure about manpages, but being unixy, it probably can.
>Just because you can write obfuscated code in Perl doesn't mean you have to.
Don't let me stop you ;-)
Like I said above, your choice of language has to fit with your style. Python fits mine, Perl fits yours. No sweat.
respectfully,
-cybervegan
svetho
02-02-2005, 03:43 PM
Hehehee, okay I chicken out here. You score one ;)
Anyway, I didn't say Python was bad, it's just that I feel more at home with Perl.
I hate flames, 'cept when it comes to Vi vs Emacs ;)
m3rlin
03-02-2005, 09:16 PM
Those anyone know a front end editor to program python?
Something like Visual Basic, that shows the command and several keywords with colors.
Something that helps your out to program with the correct syntax.
Thanks
bwkaz
03-03-2005, 07:59 PM
I know it doesn't have an equivalent to IntelliSense (:rolleyes: at the stupid terms Microsoft comes up with...), but the Python top-level is actually quite good. Just run python and start typing in code. Leave a browser window open, with one tab pointing at http://www.python.org/doc/2.4/lib/lib.html (the library reference) and one tab pointing at http://www.python.org/doc/2.4/ref/ref.html (the language reference).
Otherwise, I'm not sure about IntelliSense, but I've heard that Idle is a good Python IDE. http://www.python.org/idle/
justlinux.com
Copyright Internet.com Inc. All Rights Reserved.