Re: [Tutor] How Do I Make Imports Work

2007-12-27 Thread Rob Andrews
Can you show us an example of the code where you're attempting to import and the error you get? -Rob A. On Dec 27, 2007 7:40 AM, <[EMAIL PROTECTED]> wrote: > > Hi, > I am just starting to learn about making classes, so I wanted to put some > code into a module and use it. I know the code works b

Re: [Tutor] Beat me over the head with it

2007-12-08 Thread Rob Andrews
Need help with a motivational disorder? ;) When you say you want to learn Python, what's the nature of the "want to" part? Looking to write a game, land a job, parse a log file? Perhaps if you focus on what it is you want to do, that will lead the way. On Dec 8, 2007 9:08 PM, Theyain <[EMAIL PRO

Re: [Tutor] Timers in Python

2007-10-04 Thread Rob Andrews
On 10/4/07, Kamal <[EMAIL PROTECTED]> wrote: > Is there a method in Python which does what > setInterval('someFunction()',5000) does in Javascript. > > Basically, I want to call functionOne() every x minutes, and wondering > whats the best way to do it. Yes, the time module in the standard library

Re: [Tutor] how to specify working directory from within python app?

2007-09-20 Thread Rob Andrews
Thanks (to Alan, as well). I had a wild suspicion that there would be a fairly standard solution to this one. I've just never had to really look into it before. On 9/20/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > Rob Andrews wrote: > > I've got a weekly project here

[Tutor] how to specify working directory from within python app?

2007-09-20 Thread Rob Andrews
I've got a weekly project here in which I have to take a somewhat arbitrary number of input files, create working directories in which to process each of them, and call other programs from within the scope of those directories. The source files are in a directory named 'orig' under the project roo

Re: [Tutor] Fw: KeyError list?

2007-08-16 Thread Rob Andrews
I wasn't familiar with it prior to this thread, as previously I'd had the good fortune to use normalized data. I guess more pristine data environments spoiled me into writing less robust code. So although I asked what turned out to be the wrong question, I seem to be getting a consensus answer I'm

Re: [Tutor] Fw: KeyError list?

2007-08-15 Thread Rob Andrews
At my current day job, I'm handed a wild variety of data from customers, and most of it hasn't been normalized in any reasonable way. File formats are inconsistent, numbers of fields are randomly inconsistent with the headers, etc. Attempting to massage these into files I can process has involved

[Tutor] KeyError list?

2007-08-15 Thread Rob Andrews
Is there a comprehensive list of dictionary KeyError meanings? I could sure use one these days and haven't had much luck tracking one down yet. -Rob ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Editors .. which do you reccomend for a amateur?

2007-08-04 Thread Rob Andrews
A fair enough and frequently-asked question... I take it you're in a Windows environment? For basic editing purposes, I'm pretty crazy about IDLE after all these years, although I use Komodo IDE for most of my production code. When the other programmers in my department tasked me with picking a s

Re: [Tutor] Python IDE

2007-06-11 Thread Rob Andrews
Personally, I use and love Komodo (the full version, although Komodo Edit is nice). I didn't *expect* to like it, but it won me over with ease. On 6/11/07, scott <[EMAIL PROTECTED]> wrote: >Could someone suggest a few good IDE's for me to look at. __

Re: [Tutor] IDE / development environment

2007-04-22 Thread Rob Andrews
> What does everyone use as their development environment for Python, > particularly web dev? Komodo (by ActiveState). For web dev in dynamic languages, it's tough to actually beat. I scored mine at a $100 discount thanks to a coupon ActiveState handed out at PyCon this year. -Rob A. ___

Re: [Tutor] Best IDE for python?

2007-03-09 Thread Rob Andrews
It may be worthwhile to note that "laziness" isn't necessarily a derogatory term in programming circles. To quote Eric S. Raymond, who turned me on to Python as much as any other (in _The Art of Unix Programming_), "Constructive laziness is one of the cardinal virtues of the master programmer." -R

[Tutor] sorting question

2007-03-06 Thread Rob Andrews
I'm trying to think of the best way to go about this one, as the files I have to sort are *big*. They're ASCII files with each row consisting of a series of fixed-length fields, each of which has a corresponding format file. (To be specific, these files are FirstLogic compatible.) I'm looking to

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Rob Andrews
Ahh, yes. Your main trouble seems to be the use of \ instead of / in 'C:\testing_it.txt' Windows uses \, whereas python uses /. So you can replace 'c:\' with your choice of the following: 'c:/' (replacing \ with /) r'c:\' (the 'r' before the string tells python it's a raw string) 'c:\

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Rob Andrews
I can confirm it works nicely in Windows. I have a script I use several times daily to create working directories on a local workstation by copying over arbitrarily deep directory trees into an "original files" directory under a root directory named by job number. The local workstation on which I h

Re: [Tutor] Convert my .bat and .vbs to .py

2007-02-15 Thread Rob Andrews
If you import os, os.path, and shutil (only the ones you need, although I wind up using all three for this sort of task), you can do all that you have in mind and more. os.path opens up some pretty painless methods for doing things like testing to make sure the file exists in a given location befo

[Tutor] [OT?] PyCon

2007-01-29 Thread Rob Andrews
I hope it's not unforgivably off-topic to ask if anyone's planning on attending PyCon in Feb. My manager gave a thumbs-up for me to attend today. -Rob ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Best way to learn python

2006-12-29 Thread Rob Andrews
I'm not exactly a math guru, either, but know some algebra & geometry from school. When I first tried my hand at Python, I started with just the tutorial bundled with the Python download. I had been taken a semester in Pascal & tinkered with Perl & Java at that point, and found Python to be simpl

Re: [Tutor] what is PIL..???

2006-10-21 Thread Rob Andrews
On 10/21/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > May I ask someone to tell what PIL is and how can it be helpful in drawing > 2-dimensional graphs... PIL = Python Imaging Library PIL provides a bunch of nifty tools for handling images and is well worth a google. -Rob A. ___

[Tutor] Fwd: Help with basic user-data file

2006-10-12 Thread Rob Andrews
I'm forwarding this to the tutor list, as I'm swamped at work. -- Forwarded message -- From: Asrarahmed Kadri <[EMAIL PROTECTED]> Date: Oct 12, 2006 9:17 AM Subject: Re: [Tutor] Help with basic user-data file To: Rob Andrews <[EMAIL PROTECTED]> Thanks. Ca

Re: [Tutor] Help with basic user-data file

2006-10-12 Thread Rob Andrews
delimited text file. On 10/12/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: > It means there is no need of entering the data in the dictionary,?? > > How will I then implement the uniqueness of loginnames??? > > Thanks for the support. > regards, > Asrar > > &

Re: [Tutor] Help with basic user-data file

2006-10-12 Thread Rob Andrews
To keep the information, the simplest solution is simply to save it in a text file that the program can load into memory when it starts up again. For sensitive information like passwords, a little extra fuss is generally merited. When someone logs in, you can save a value like time.strftime(time.c

Re: [Tutor] What after Learning Python 2nd

2006-10-09 Thread Rob Andrews
Those are both fine "next book" choices, and neither should prove a disapointment. However, LP should've left you with just enough knowledge to be dangerous, so I'd encourage you to work on several small projects in python using what you already know. In the process of taking a crack at those, you

Re: [Tutor] directory recursion

2005-09-12 Thread Rob Andrews
Thanks! That did the trick after very modest head scratching. -Rob On 9/9/05, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > > What's a nice, clean way to recursively scan through directories with > > an arbitrary number of subdirectories? > > Hi Rob, > > You may want to look at os.walk():

[Tutor] directory recursion

2005-09-09 Thread Rob Andrews
I should already know this, and probably once did, but have never had a real world use for it until now. What's a nice, clean way to recursively scan through directories with an arbitrary number of subdirectories? In today's example, we're looking to grab the file name and third line of the file

Re: [Tutor] Guess my number?

2005-08-07 Thread Rob Andrews
Let's take a look I pasted your code into a new window and gave it a go. You used tabs for indentation (or they got in there somewhere in the email/copy/paste process), which confused my tiny mind, so I replaced 'em with spaces. I noticed a few things. Here's my code:

[Tutor] file IO tutorial

2005-07-31 Thread Rob Andrews
http://uselesspython.com/tutorials/PythonFileIOStepByStep.pdf I've written a quick step-by-step .pdf to walk through the process of creating a new text file, read from it, and append to it with Python. It doesn't cover every last thing one can do with opened files, but does point to a few other re

Re: [Tutor] replaying

2005-07-19 Thread Rob Andrews
> However, there are significant downsides to enabling Reply-to munging: > > http://www.unicom.com/pw/reply-to-harmful.html > > I agree with most of those reasons, and so I won't enable Reply-to munging > unless there's a real overriding reason that trumps the ones listed on > that page. I f

Re: [Tutor] PLEASE HELP ON PYTHON

2005-07-16 Thread Rob Andrews
On 7/15/05, Suranga Sarukkali <[EMAIL PROTECTED]> wrote: > > Hai, I (Suranga) started using Python2.4 Downloaded from the Original > WebSite www.python.org a week ago but still I have not made any good > progress on Programming and all that Tutorials available make it like hell > to get started a