Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 18th, 2006, 7:37 PM   #21
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Wow, that got the soup boiling! There are the C/C++ experts, and then there is the C/C++ crowd mostly lost in memory allocations, pointers, and other things the prof comes up with to kill time. Sorry DaWei, I didn't originally consider you part of the crowd.

Hello Sane! Nice to know you are still looking in every now and then!
Thanks Arevos for the hint on Haskell. Can you point me into the right direction?
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Nov 18th, 2006, 8:41 PM   #22
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 19th, 2006, 1:29 AM   #23
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
Quote:
Originally Posted by DaWei View Post
On further reflection, I must confess that I considered that an utterly stupid statement, ...
I assume you are talking about me there. Let me explain (or just babel if you weren't talking to me) I was just giving and example of where C++ has some of 'meta' programming like qualities of python. Then went on to describe how a language like python allows you to many things that would take pages of template code in C++ (hence the joy factor) in just a few lines. The last part was a little cheap shot at Java but hey, Python has multiple inheritance and operator overloading and is still considered easy to learn.

Edit: Try the homepage of Haskell.
Game_Ender is offline   Reply With Quote
Old Nov 19th, 2006, 10:33 PM   #24
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
Thanks Game_Ender for the Haskell ref!
Yes, I have looked at boost, 20M+ zipped, found it to be overwhelming in size and complexity. Beating yourself with chains comes to mind! I think it was one of the reasons I switched to Python.
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote
Old Nov 19th, 2006, 11:07 PM   #25
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Nah, Game Ender, it was the 'fear' remark. I'm not a professional programmer, and C++ is just one of my occassional tools, but fear has never been involved and the bottom line has always come through nicely.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Dec 29th, 2006, 9:19 AM   #26
MicDareall
Programmer
 
Join Date: Dec 2005
Posts: 67
Rep Power: 0 MicDareall is an unknown quantity at this point
Quote:
Originally Posted by Dietrich View Post
Has anybody explored the Python Tkinter GUI Builder (ptkgb) at:
http://sourceforge.net/projects/ptkgb/
?
I haven't used one but Ive used pythoncard which looks like the equivalent to it for wxPython and I love it.

As far as the topic goes, personally I find python is alot quicker to develop in. I love python. I have alot more experience in C/C++ then I do any language but I always revert back to python when I have an Idea for a program that won't be too greatly effected by the speed differences. For example the other day I wrote a fully functioning FTP client with GUI in a matter a couple hours in less then 500 lines of code using Python, wxPython and Pythoncard. It would have taken me alot longer in C/C++ as well as alot more code to tackle the same task. For me atleast, python does cut down on development time.
MicDareall is offline   Reply With Quote
Old Jan 3rd, 2007, 6:36 PM   #27
jazzychic18
Newbie
 
Join Date: Jan 2007
Posts: 3
Rep Power: 0 jazzychic18 is an unknown quantity at this point
what kind of programs can you write with python?
jazzychic18 is offline   Reply With Quote
Old Jan 4th, 2007, 8:02 PM   #28
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
The real question is what can't you write in python. You can write anything but an operating system or dynamic library in python.
Game_Ender is offline   Reply With Quote
Old Jan 4th, 2007, 11:36 PM   #29
jazzychic18
Newbie
 
Join Date: Jan 2007
Posts: 3
Rep Power: 0 jazzychic18 is an unknown quantity at this point
i have a question. like im like trying to learn how to program in python. and like can anyone tell me what loops are used for and whats an easy way to learn them. is there like some sort of like formula
jazzychic18 is offline   Reply With Quote
Old Jan 5th, 2007, 5:04 AM   #30
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Loops are used for repeating blocks of code. There are two basic types of loops; while loops, which keep repeating until a condition is met, and for loops, which repeat for each item in a list.

Here's an example of a "while" loop:
python Syntax (Toggle Plain Text)
  1. from datetime import datetime
  2.  
  3. while user_input != "q":
  4. print "The date and time is %s" % datetime.now()
  5.  
  6. print "Type in 'q' to quit, or press enter to print the date again."
  7.  
  8. user_input = raw_input()
The while loop will keep repeating the date and time until the user types in "q".

And here's an example of a "for" loop:
python Syntax (Toggle Plain Text)
  1. numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  2.  
  3. print "The 7 times table: "
  4.  
  5. for number in numbers:
  6. print "%d times 7 is %d" % (number, number * 7)
The for loop will output the 7 times table, without you having to type every line. You can also use the "range" function to return a list of numbers:
python Syntax (Toggle Plain Text)
  1. >>> range(10)
  2. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  3. >>> range(1, 10)
  4. [1, 2, 3, 4, 5, 6, 7, 8, 9]
  5. >>> range(1, 11)
  6. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
When given one number N, the sequence range returns is 0 <= x < N. When given two numbers N and M, the range is N <= x < M.

It's a little counter intuitive, but there are a few good reasons for not including the last number.
Arevos is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[tutorial] Python for programming beginners coldDeath Python 30 Dec 14th, 2005 12:35 PM
If you want to learn Python or improve your Python skills coldDeath Python 2 Nov 23rd, 2005 1:27 AM
Convert Python script to C++ code clanotheduck Python 17 Sep 25th, 2005 9:55 AM
Advanced Python Tricks Arevos Python 19 Sep 24th, 2005 8:39 AM
Python - A Programmers Introduction coldDeath Python 17 Aug 19th, 2005 1:41 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC