If I might offer one small comment...
It seems to me that this argument also goes to a code readability issue; ergo,
if you choose "from foobar..." as opposed to "import foobar", then from that
point on you only need employ foobar's methods in your code, and they are not
alway easily recognizab
On Sat, Jan 9, 2010 at 07:28, Alan Gauld wrote:
>
> "Richard D. Moores" wrote
>>
>> to be put in a function. For convenience sake, I've put this new
>> function inside the one that calls it.
>>
>> Question 1: Is this bad practice? It works fine that way, but..
>
> No, but there are some issues to
galaxywatc...@gmail.com wrote:
After
many more hours of reading and testing, I am still struggling to
finish this simple script, which bear in mind, I already got my
desired results by preprocessing with an awk one-liner.
I am opening a zipped file properly, so I did make some progress, but
I finally got it working! I would do a victory lap around my apartment
building if I wasn't recovering from a broken ankle.
Excuse my excitement, but this simple script marks a new level of
Python proficiency for me. Thanks to Kent, Bob, Denis, and others who
pointed me in the right directi
Ok, it's not a big deal, but once I learned enough I went off on a few
tangents to create programs of my own design. Since I had to return
the book to the public library, I finally got back to finishing the
last chapter. Since the book is not current, I took the time to
decipher the differences a
Nice one... I should still get to starting lol...
2010/1/10 Tim Goddard
> Ok, it's not a big deal, but once I learned enough I went off on a few
> tangents to create programs of my own design. Since I had to return
> the book to the public library, I finally got back to finishing the
> last cha
"Tim Goddard" wrote
I also figured out how to configure Eclipse IDE to recognize modules.
Apparently in the preferences for each 'project' is a separate
PYTHONPATH.. which is not to be confused with sys.path. Adding the
appropriate folders to the preferences allows the user to browse
through
I should add (that as I understand it), when you do a 'from foo import
blah', or 'from foo import *', this is doing a *copy* (effectively) of that
module's attributes into the current namespace. Doing "import foo" or
"import foo as goo" is keeping a *reference *to the imported module rather
than a
Eric Pavey wrote:
I should add (that as I understand it), when you do a 'from foo import
blah', or 'from foo import *', this is doing a /copy/ (effectively) of
that module's attributes into the current namespace.
Not a copy (which means duplicating the attribute) but a new reference
to the orig
On 1/10/2010 11:23 AM, Eric Pavey wrote:
I should add (that as I understand it), when you do a 'from foo import
blah', or 'from foo import *', this is doing a /copy/ (effectively) of
that module's attributes into the current namespace. Doing "import foo"
or "import foo as goo" is keeping a /refe
Lie Ryan dixit:
> only use "from module import *" if the
> module was designed for such use
In most cases, this translates to: the imported module defines __names__, which
holds the list of names (of the objects) to be exported. Check it.
Below, a,b,c,f,g,X,Y are defined, but only c,g,Y are ex
"Lowell Tackett" wrote
In the meantime, posing this query took me somewhere I hadn't imagined...
I got turned on to the 'Gmane' mailsite, which pretty much solved all my
issues,
plus presented a much nicer 'reading room'.
I actually use it as a news feed into Outlook Express.
I only occasi
I'm working on a function that seems to cry out for some of its code
to be put in a function. For convenience sake, I've put this new
function inside the one that calls it.
Question 1: Is this bad practice? It works fine that way, but..
Question 2: If the answer to Q1 is no, is there a standard p
hi,
iam a beginner.
sample_file = file("/home/ee08m082/Desktop/python/123.txt","w")
sample_file.write("About Pythons\n")
in the above two line code,123.txt is being created but "About Pythons" is
not being written in the file.
my OS is redhat linux and python version is 2.3.4
thanks
__
sudhir prasad wrote:
hi,
iam a beginner.
sample_file = file("/home/ee08m082/Desktop/python/123.txt","w")
sample_file.write("About Pythons\n")
in the above two line code,123.txt is being created but "About Pythons" is
not being written in the file.
my OS is redhat linux and python version is 2
After many more hours of reading and testing, I am still struggling to
finish this simple script, which bear in mind, I already got my
desired results by preprocessing with an awk one-liner.
I am opening a zipped file properly, so I did make some progress, but
simply assigning num1 and num2
Richard D. Moores dixit:
> I'm working on a function that seems to cry out for some of its code
> to be put in a function. For convenience sake, I've put this new
> function inside the one that calls it.
>
> Question 1: Is this bad practice? It works fine that way, but..
>
> Question 2: If the a
On Sat, Jan 9, 2010 at 05:03, spir wrote:
> Do you realize the inner func will be redefined before each call?
Oh, I forgot about that. Thanks!
Dick
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.pyth
"Rob Cherry" wrote
Extending on this advice somewhat - is it *ever* correct to "import
foobar".
Yes, it is *usually* correct to "import foobar" and rarely correct to "from
foobar".
The exception being if you only need one or two names from foobar, but
usually you need a lot more, in which
"Richard D. Moores" wrote
to be put in a function. For convenience sake, I've put this new
function inside the one that calls it.
Question 1: Is this bad practice? It works fine that way, but..
No, but there are some issues to consider.
Denis has addressed some but one other is...
Reuse:
dear tutors,
I'm trying to use a GPS tracking service called InstaMapper. The service
changes how frequently it updates the tracking device's position based on
whether the UI is being accessed on the InstaMapper webpage. I'd like to
have the increased update frequency happen all the time so I th
21 matches
Mail list logo