473,789 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

another docs problem - imp

Another Python docs problem...

I was trying to use imp.find_module ().
imp.find_module ("mymod", "./subdir") ImportError: No frozen submodule named ./subdir.mymod

subdir/mymod.py definately exists, has reasonable
permissions, etc.

After a lot of reading and re-reading the docs,
trying various things, I Googled on the error
message and lo, there was a message from
2002 by someone ranting about how hard
it was to do things in Python sometimes (no it
was not from me).

Turns out that you have to do imp.find_module ("mymod", ["./subdir"])


I saw not a hint of this in the docs. In fact
they seem to say that the first (unworking)
form *should* work. Bye bye about two
hours altogether...

I thought I would post this and hopefully help
someone else in the future (since I noticed
an unanswered posting here from Mar 2005
about the same problem.)

Jan 10 '06
14 2300
Kent Johnson wrote:
Steve Holden wrote:
Clearly. So get your sleeves rolled up and provide a fix. Then you too
will get your name in the Python documentation contributors' list.

Is there such a list? I have contributed many doc patches and if such
glory is mine I would like to know it!

Kent


There *is* one:

http://docs.python.org/acks.html

but I don;t get to decide who goes on it.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

Jan 13 '06 #11
Kent Johnson wrote:
Clearly. So get your sleeves rolled up and provide a fix. Then you too
will get your name in the Python documentation contributors' list.


Is there such a list? I have contributed many doc patches and if such
glory is mine I would like to know it!


unfortunately, your name don't seem to be mentioned in the Doc version
history either:

[Doc]$ svn log | grep -i Kent
Fix typo reported by Kent Engström, and a bunch of broken markup.
[Doc]$

do you have more details (a reference to a page you've contributed to should
be enough).

or could it be that your submissions are still sitting in the SF tracker ?

</F>

Jan 13 '06 #12
Fredrik Lundh wrote:
Kent Johnson wrote:
Is there such a list? I have contributed many doc patches and if such
glory is mine I would like to know it!


unfortunately, your name don't seem to be mentioned in the Doc version
history either:

do you have more details (a reference to a page you've contributed to should
be enough).

or could it be that your submissions are still sitting in the SF tracker ?


There are twelve closed doc bugs in SF tracker that I submitted
(username kjohnson); I think most of these were accepted. They're all
pretty minor but certainly as big as the change this thread is
discussing. I also recently helped Andrew Kuchling rewrite the
BeginnersGuide in the Wiki.

A note to rurpy and anyone else with a complaint about the docs: it
really is very easy to suggest a change in SF. In my experience most
suggestions are accepted very quickly. It's an easy way to help make
Python better. Definitely easier than fighting on c.l.py about whether
the docs are confusing.

Kent
Jan 13 '06 #13

Steve Holden wrote:
ru***@yahoo.com wrote: [...snip...] Well, perhaps if you'd read the intro to the documentation (more
carefully), or if you were more used to reading programming manuals,
you'd quickly have recognised

[, path]

as meaning precisely that the path argument is optional.
I did realize that. (And I have read enough other
programming manuals that reading more will not
affect my recognition of anything.) The issue was
not the optionality of the argument, it was the
type of the argument when it was supplied.

[...snip...]
So you think the docs should be changed if just *one* person can't
understand them. Or maybe *two*? or *ten*?
I don't know how many people had trouble
with the text. But there were some postings,
and the number of people is almost certainly
orders of magnitude larger than the number
that post.
I continue to think that the way I interpreted it
was valid, so it *is* ambiguous, even if most
people quickly disambiguate it correctly. If
you accept that, it should be clarified even if
the number was *one*.

[...snip...]
How about
1 - read some clear unambiguous documentation.
2 - write the code and it works as described.

Excellent. So now you only have to fix the docs and that's what everyone
will do from now on.
My grandfather used to own a hardware store.
He frequently said he took every customer
complaint very seriously. "For every customer
who complains, there are a 100 that just take their
business elsewhere."
I wonder how many people had a problem with
this and lost time. Not as extreme as my case,
maybe just rereading it a few times. And of course
this particular piece of documentation is not an
isolated instance. If you are happy with the status
quo, if it is "good enough" fine. I am not.

...snipped long anacdote about busses...

Clearly. So get your sleeves rolled up and provide a fix. Then you too
will get your name in the Python documentation contributors' list.


I would be sufficient reward just to get good, clear,
complete accurate python docs.
I agree that things that are difficult to understand could usefully be
fixed. Since this is the open source world I'm unsure as to why you feel
somebody else should fix it. It's also fairly obvious since you failed
to find other complaints about this issue in your Google search that it
isn't a frequent cause of complaint.


I never suggested someone else should fix it. I am willing
to submit either a doc bug reports, or patches provided
that there is a reasonable chance it will result in a positive
change. I am not willing to invest a lot of time summiting
things that are ignored or dumped in the bit bucket. So
in part, my post here was to gauge the reaction to proposed
change.

Frequency of public complaints is a *lousy* criteria. Very
few people are going to complain publicly, especially here
where suggestions that Python is not perfect are often met
with derision or silence. That was the whole point of the
grandfather story.

Jan 23 '06 #14
I assume one cause of the misunderstandin g was the name "path" for the
search path. If it had been named "paths" it would have been more
obvious. But Python is only following a common standard here. Since
environment variables are called PATH, CLASSPATH etc. it was only
logical to use PYTHONPATH and sys.path etc. Therefore the imp module
uses "pathname" where it is only a single path.

Probably the people who once invented the env variables didn't care
about writing PATHS because it sounds like PATH anyway (or is there a
difference? I am German).

Anyway, the docs are technically correct. Maybe the best solution would
not to improve the docs but to allow path to be a string in which case
it would be treated as [string].

-- Christoph
Jan 23 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1566
by: Bjørn T Johansen | last post by:
I need to introduce an extra field in a table that has one field as primary key. The "problem" is that this new field should be combined with the existing pk to create a new combined pk for the table, how to I change the table? Using the Alternate command? How? Or do I need to create a new table and copy everything to the new table? Cheers, BTJ
11
16962
by: Rob | last post by:
I know, I know, don't use frames. Well, I'm stuck with these frames and I'm trying to add functionality without a complete redsign. You can look at this as a nostalgic journey. Anyway, I've got the following frame structure at the top level: FRAMESET CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html><head><title>Server List</title></head> <frameset frameborder="1" border="1" framespacing="1" rows="10%,89%">
8
2307
by: Eric_Dexter | last post by:
I was looking for a simple way to load a simple python program from another python program. I tried os.system(cabel) The file name is cabel.py a csound instrument editor.. The error I am getting is
2
2975
by: KraftDiner | last post by:
I have a class that is defined in a file called MyClass.py How do I use that class in another python script.. import MyClass ? (Does it need to be in a specific location?)
17
2722
by: Eric_Dexter | last post by:
def simplecsdtoorc(filename): file = open(filename,"r") alllines = file.read_until("</CsInstruments>") pattern1 = re.compile("</") orcfilename = filename + "orc" for line in alllines: if not pattern1 print >>orcfilename, line I am pretty sure my code isn't close to what I want. I need to be able
3
12092
by: yinglcs | last post by:
Hi, i have 2 python files in *different directory* , how can I import python functions from 1 python file to another? i get this error: import task ImportError: No module named task/ Thank you.
2
1940
by: Carnell, James E | last post by:
I am thinking about purchasing a book, but wanted to make sure I could get through the code that implements what the book is about (Artificial Intelligence a Modern Approach). Anyway, I'm not a very good programmer and OOP is still sinking in, so please don't answer my questions like I really know anything. MY QUESTION: What is a slot? In class Object below the __init__ has a slot. Note: The slot makes use of a data object called...
2
1447
by: patrick.waldo | last post by:
Hi all, Fairly new Python guy here. I am having a lot of trouble trying to figure this out. I have some data on some regulations in Excel and I need to basically add up the total regulations for each country--a statistical analysis thing that I'll copy to another Excel file. Writing with pyExcelerator has been easier than reading with xlrd for me...So that's what I did first, but now I'd like to learn how to crunch some data.
11
7127
by: mjahabarsadiq | last post by:
Hi I have created a web application. I am using ant to build the war and deploy in tomcat. The war file is deployed under "TOMCATE_HOME/work/standalone/localhost/onlineres.war". I have my source files in "D:\Sadiq\Projects\Onlineres". The folder structure is as follows. 1) D:\Sadiq\Projects\Onlineres: This folder is having the context.xml, web.xml, build.xml and build.properties files.
0
10403
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10193
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10136
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9978
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9015
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7524
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6755
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4087
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2904
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.