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
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
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
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
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
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
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
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
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
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.
__
> 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.
___
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
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
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:\
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
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
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
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
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.
___
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
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
>
>
&
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
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
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():
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
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:
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
> 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
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
29 matches
Mail list logo