Ok. Thank you very much.
Have a great holiday!
User Profile
Collapse
-
Thanks BV. Could you please show me detailed explanation about the consistency?
I've read the description about imports in PEP08, but I think I am still puzzled about that....Leave a comment:
-
Hi,
I think wxPython can help you to develop GUI function, including the input/output.
You can use wx.TextCtrl to get the input from the user, and then use os.listdir('PAT H') to enumerate the files.
Note: PATH is the input got from user.
I can give you a sample to use wxPython
wxpython TextCtrl Basic Formatting - Python
and the help for TextCtrl
wx.TextCtrlLeave a comment:
-
Questions about the import ordering
Dear all,
I am reading the book "Core Python Programming". In the chapter talking about modules, it says the modules should follow this ordering:
I am not sure whether the ordering will impact the module's loading or search efficiency. For example, a common...Code:import Python Standard Library modules import Python third party modules import Application-specific modules
-
Thank you. I've got the answer why the error happened.
"Since the name of the main module is always "__main__", modules intended for use as the main module of a Python application should always use absolute imports."
So I made another main module with absolute imports, and also imports this test module. Everything is fine.
Thanks again for your help:)
Have a nice day!Leave a comment:
-
A question about "Intra-package References"
Hi all,
I have a simple question about "Intra-package References"
There are two source files and __init__.py in package MyPkg shown below:
|-MyPkg
-__init__.py
-example.py
-test.py
example.py is like this:
and test.py is like this:Code:a = 5
While I executed test.py, python...Code:from . import example print example.a
-
I found another solution to this problem.
I can use a name space for the scoping.
__main__.a will be referenced to a global variable.
Anyway, I think container is better.Leave a comment:
-
-
Question about "global" statement
Hi,
I am having trouble understanding the use of 'global' variables I want to use a global variable with the same name as a parameter of a function. But I don't know how to use them at the same time. Here is a snippet of example code:
...Code:def foo (a): global p global a p = a + 3 #here "a" will be reference to the global one a = 1 p = 0 foo (a)
No activity results to display
Show More
Leave a comment: