Re: [Tutor] Two Newbile Questions: porting drawmap.c, & Python as a lifetime language

2006-07-04 Thread Carlos Daniel Ruvalcaba Valenzuela
Really depends on what you do, if you program for a living most probably you'll use whatever your employer tells you to use, if you work by yourself you can choose, personally i like python because of the enormous amount of modules available to do all sort of stuff, from GUI programing, to unittest

Re: [Tutor] Two Newbile Questions: porting drawmap.c, & Python as a lifetime language

2006-07-04 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > 2. Seeing Python hailed as a good language for learning programming, > how do you > rate it as a lifetime language? (I can imagine that many people have > settled into one language for doing the remainder of their life's work. If > I am pressed, I will choos

Re: [Tutor] I Give Up. - Follow up post

2006-07-04 Thread Brian Gustin
OK .. so far so good.. :) > ultimately want is not meshing well together. > > Let's clarify the requirement: you want to have a mapping from services > to their configurations. Ignoring the format of the configuration file > for the moment, it sounds like you ultimately want to parse the > con

Re: [Tutor] Two Newbile Questions: porting drawmap.c, & Python as a lifetime language

2006-07-04 Thread Dustin J. Mitchell
[EMAIL PROTECTED] wrote: > 1. What's involved in a port of a C program into Python? (drawmap is > offered in a number of linux distributions btw.) It really (really) depends on the C program -- C's so flexible that you can write in a "Pythonish" style (specifically, avoiding pointer tricks, kee

Re: [Tutor] I Give Up. - Follow up post

2006-07-04 Thread Danny Yoo
> Now, if I want to iterate over a list of machines , and check each > machine for whatever it was set for (in the config file) > So the config file requires http to be the first part of the string , > followed by something to make it unique (I.E. http1, http2, http3) Hi Brian, Have you consi

[Tutor] Two Newbile Questions: porting drawmap.c, & Python as a lifetime language

2006-07-04 Thread dnelson
Relying heavily on the "newbies treated well" advertisment... :^) I'm an old C programmer, which is to say (a) I am old, and (b) even when young, I somehow managed to program in "old C". I have been working--for years--on creating a personal variant of drawmap.c, Fred M. Erickson's wonderful

[Tutor] Correct way to code data or parse?

2006-07-04 Thread DM
Hi Everyone *Please forgive me the repost ... I sent the first as Html not Text Dumb, Doh! I'm new to python and I want to write a rpg program that is able to use the Correct way to code data or parse? I have pages of .PDF file Data tables copied to text files. I check out many python boar

Re: [Tutor] I Give Up. - Follow up post

2006-07-04 Thread Brian Gustin
Danny Yoo wrote: >> I tried it by opening a file , but could find no way to do variable >> variables > > > > Hi Brian, > > Look for the concept of dictionaries in Python. "Variable variables" in > languages like PHP and Perl are doable in Python, but a dictionary > usually handles such si

Re: [Tutor] I Give Up. - Follow up post

2006-07-04 Thread Danny Yoo
> I tried it by opening a file , but could find no way to do variable > variables Hi Brian, Look for the concept of dictionaries in Python. "Variable variables" in languages like PHP and Perl are doable in Python, but a dictionary usually handles such situations in a safer way. > and then

Re: [Tutor] I Give Up. - Follow up post

2006-07-04 Thread Brian Gustin
OK see, what I was doing originally (and I found time to finally get it partially working) I have a configuration file that may be edited by webmaster thus [Ports] http = 80 https = 443 http1 = 81 smtp = 25 smtp2 = 587 (the above is a small example, it could be *anything* ) Now I have a funct

[Tutor] Correct way to code data or parse?

2006-07-04 Thread StevenG the Judge
Hi Everyone   I'm new to python and I want to write a rpg program that is able to use theCorrect way to code data or parse?  I have pages of .PDF file Data tables copied to text files. I check out many python boards & Books with little illumination to my problem. I'm still not sure about what to us

Re: [Tutor] stfftime question

2006-07-04 Thread Kent Johnson
Tom Tucker wrote: > I found a temporary solution. The goal in the end was to compare two > dates/times and retrieve the millisecond delta between the two. > > Work around > # > import datetime > import time > t1 = datetime.datetime(1973,9,4,04,3,25,453) > t2 = datetime.datetime(1973,

Re: [Tutor] Query regarding Unittest module behaviour

2006-07-04 Thread Luke Paireepinart
[snip] > Script abc.py imports xyz.py. > Now when I execute abc.py from commandlline all unittestcases of > xyz.py are also executed. > Why is this happening and what can be the solution to this. anything that's in the global scope of an imported module gets executed. For example... -- a.py

Re: [Tutor] Moved Python installation. Need advice rebuilding all *.pyc

2006-07-04 Thread Adam
On 03/07/06, Andreas <[EMAIL PROTECTED]> wrote: On 03.07.2006 20:45 Adam wrote> Erm trying to remember exactly how to do this in windows but if you do the> equivalent of an rm -r E:\Python24\site-packages\*.pyc ie remove all the> *.pyc files they will be rebuilt as and when you next import those mo

Re: [Tutor] stfftime question

2006-07-04 Thread Tom Tucker
I found a temporary solution. The goal in the end was to compare two dates/times and retrieve the millisecond delta between the two. Work around # import datetime import time t1 = datetime.datetime(1973,9,4,04,3,25,453) t2 = datetime.datetime(1973,9,4,04,3,25,553) t1tuple = time.mkti

[Tutor] Query regarding Unittest module behaviour

2006-07-04 Thread Akanksha Govil
Hi,I have 2 scripts , abc.py and xyz.py, In both I have made unittest cases using the unittest module.Script abc.py imports xyz.py.Now when I execute abc.py from commandlline all unittestcases of xyz.py are also executed. Why is this happening and what can be the solution to this.Also I have tried

[Tutor] stfftime question

2006-07-04 Thread Tom Tucker
Below is an example of me converting a datetime to milliseconds on a Mac running Pythong 2.3.5. The same working code on a Solaris system with Python 2.3.2 fails. Any thoughts? What arguments am I missing? >From my Mac # Python 2.3.5 (#1, Oct 5 2005, 11:07:27) [GCC 3.3 20030304 (A