it might be a little clearer if you look at sys.modules
In the sys module is a useful dictionary called "modules"
This dictionary maps all the names of modules we import, to the objects
that are those modules.
for example (I am only importing pprint to make it easier to read)
>>> import sys, pp
Bernard Lebel wrote:
> Hi grouchy,
>
> I seem to have found the problem. Somehow, it seems BeautifulSoup
> doesn't like nested tags of the same name.
This seems to be a feature of BS. It seems a bit of a misfeature when applied
to XML but anyway...you can configure BS with a set of tags which ca
Hello.
I have been reading the
http://wiki.wxpython.org/index.cgi/Getting_20Started manual and are
running the program there. (Enclosed below).
When I run it, it works fine. But, when I run it again, I get the error
PyNoAppError: The wx.App object must be created first! I assume I have
killed the
I needed a script that takes command line arguments, searches an ini
file for a match to the arguments and then executes a Windows
executable. This is my first script using python so I wanted to make
sure I made
the most of the language. I took bits and pieces from different
tutorials and examples
Chris Hallman wrote:
> The script is executed in this
> manner:
>
> python search_interface.py device interface interface_name "is down -
> 00:00:00 01/01/06"
>
> Here is the script:
>
> import ConfigParser, string, sys
> section = sys.argv[1]
> port = sys.argv[3]
> INI=ConfigParser.ConfigPars
On Mon, 26 Sep 2005 13:41:32 +0200 (CEST), Ãyvind <[EMAIL PROTECTED]> wrote:
>Hello.
>
>I have been reading the
>http://wiki.wxpython.org/index.cgi/Getting_20Started manual and are
>running the program there. (Enclosed below).
>
>When I run it, it works fine. But, when I run it again, I get the e
Sorry... Forgot all about that.
Using WinXP, ActiveState Python 2.3 and wx-version 2.6.1.0.
I run it in ActiveStates Interactive Window, which is IDLE (I think).
Thanks in advance
http://mail.python.org/mailman/listinfo/tutor
Chris Hallman schrieb:
> for i in passwordlist:
> if i == port:
> os.system("d:\\tnd\\bin\\cawto.exe -cat NetNet " + sys.argv[1] +
> " " + sys.argv[2] + " " + sys.argv[3] + " " + sys.argv[4])
1) The last line can be also expressed as:
os.system(r"d:\tnd\bin\cawto.exe -cat NetNet %s" %
On Mon, 26 Sep 2005 14:32:53 +0200 (CEST), Ãyvind <[EMAIL PROTECTED]> wrote:
>Sorry... Forgot all about that.
>
>Using WinXP, ActiveState Python 2.3 and wx-version 2.6.1.0.
>
>I run it in ActiveStates Interactive Window, which is IDLE (I think).
>
>Thanks in advance
>
>
Aha, I thought something
Bob,
I did what you
suggested. Take another look, and tell me if you were a potential customer,
would you purchase something?
Why not take
the challenge? It's not like I'm asking much.
Nathan
Pinno
- Original Message -
From:
bob
To: Nathan Pinno
Cc: tutor@python
Krishna wrote:
> When I have this piece of code in a function, it works fine. So is
> this some limitation of directly working out off the console?
It is indeed valid Python (you don't have to have empty lines after
try-except in a real Python program).
> Seems the console supports complete code
At 10:34 AM 9/26/2005, Nathan Pinno wrote:
Bob,
I did what you suggested. Take
another look, and tell me if you were a potential customer, would you
purchase something?
I tried
http://zoffee.tripod.com/purchasecomprogs.htm
I got "Sorry but the page ... is not here."
Sorry, but the page or t
The actual URL is http://zoffee.tripod.com/purchasecompprogs.htm
- Original Message -
From:
bob
To: Nathan Pinno
Cc: tutor@python.org
Sent: Monday, September 26, 2005 11:54
AM
Subject: Re: [Tutor] Challenge [was Re:
Why won't it enter the quiz?]
At 10:34 AM
Forwarding to tutor
-- Forwarded message --
Date: Mon, 26 Sep 2005 08:32:02 -0500
From: Jason Massey <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] printing an acronym
Something like this:
def acro(a):
... b = a.split()
... c = ""
... for d
Or a shorter version,
a=lambda n: "".join([x[0].upper() for x in n.split()])
Then it is just:
>>> a('random access memory')
'RAM'
Danny Yoo wrote:
Forwarding to tutor
-- Forwarded message --
Date: Mon, 26 Sep 2005 08:32:02 -0500
From: Jason Massey <[EMAIL PROTECTED]>
T
> > How could I get the following program to output UDP from the user
> > entering user datagram protcol or IP if internet protocla was entered?
Wait a second. This looks exactly like this question from just a day ago:
http://mail.python.org/pipermail/tutor/2005-September/041639.html
The a
--- [EMAIL PROTECTED] wrote:
> Send Tutor mailing list submissions to
> tutor@python.org
>
> To subscribe or unsubscribe via the World Wide Web,
> visit
> http://mail.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body
> 'help' to
> [EMAIL PRO
Can I have a look at the password program by any chance?
Tutor maillist -
Tutor@python.orghttp://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> for i in passwordlist:
> if i == port:
> os.system("d:\\tnd\\bin\\cawto.exe -cat NetNet " + sys.argv[1] + " " +
>sys.argv[2] + " " + sys.argv[3] + " " + sys.argv[4])
If you don't have duplicates in your list, a "break" after the
os.system line might help, because once you've found
Chris Hallman wrote:
> Here is the script:
>
> import ConfigParser, string, sys
> section = sys.argv[1]
> port = sys.argv[3]
> INI=ConfigParser.ConfigParser()
> INI.read("interfaces.ini")
> passwordentries=[p for p in INI.options(section)]
> passwordlist=[INI.get(section, pw) for pw in passwordent
At 10:56 AM 9/26/2005, Nathan Pinno wrote:
The actual URL is
http://zoffee.tripod.com/purchasecompprogs.htm
I did what you suggested. Take another look, and tell me if you were a potential customer, would you purchase something?
No. For one thing I can (if I didn't already have one) buy a "re
Kent Johnson wrote:
> *TEST FIRST* Don't optimize until you know it is too slow and you
> have a test case that you can time to see if your 'optimizations' are
> making it faster.
Pardon my shouting :-)
Kent
___
Tutor maillist - Tutor@python.org
http
n\\cawto.exe -cat NetNet " + sys.argv[1] + " " +sys.argv[2] + " " + sys.argv[3] + " " + sys.argv[4])I'd like to know if there is a more efficient way to do this and if there isa way to have these functions performed with the least amount of timepossible (the in
n\\cawto.exe -cat NetNet " + sys.argv[1] + " " +sys.argv[2] + " " + sys.argv[3] + " " + sys.argv[4])I'd like to know if there is a more efficient way to do this and if there isa way to have these functions performed with the least amount of timepossib
I am trying to write a stript that extract jpg files
from a html I had downloaded.I encounter a problem with
a Big5 charset html file.Big5 used in Hongkong ans Taiwan.
In this html file there's a jpg names "xvg_h%202.jpg"
in vi ,the tag of the image is
Please HELP...
First
I need to know how to allow the user to search their local drives and directories in order to load a file...or if there are any pre-written opensource functions that will also be well appreciated..
Second
I need to know how to render graphics without the windo
On Tue, 27 Sep 2005, [GB2312] ��ʯ wrote:
> I am trying to write a stript that extract jpg files
> from a html I had downloaded.I encounter a problem with
> a Big5 charset html file.Big5 used in Hongkong ans Taiwan.
> In this html file there's a jpg names "xvg_h%202.jpg" in vi ,the tag
27 matches
Mail list logo