On Thursday 18 January 2007 02:59, Uwe Grauer wrote:
> johnf wrote:
> > OK I have been attempting use
> > "import dabo.ui.dKeys" and not "import dabo.ui.uiwx.dKeys"
> > But I can't figure out how too.  I have checked all of dabo for any
> > location where you used dabo.ui.dKeys.  I did not find any in dabo.  I
> > did find "from dabo.ui import dKeys"  in daboide.
> >
> > Using "from dabo.ui import dKeys" appears to work.  This really blows my
> > mind. what is the diff between
> > "import dabo.ui.dKeys"
> > and
> > "from dabo.ui import dKeys"
>
> John, you really should do a python tutorial.
> Play with the namespaces.
>
> Do something easy first and watch the dir() statements as they show you
> whats in your namespace:
> You can place some dir(whatever) calls into your source later.
>
> [EMAIL PROTECTED]:~> python
> Python 2.5 (r25:51908, Jan  9 2007, 16:59:32)
> [GCC 4.1.2 20061115 (prerelease) (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> dir()
>
> ['__builtins__', '__doc__', '__file__', '__name__']
>
> >>> import os
> >>> dir()
>
> ['__builtins__', '__doc__', '__file__', '__name__', 'os']
>
> >>> dir(os)
>
> ['EX_CANTCREAT', 'EX_CONFIG', 'EX_DATAERR', 'EX_IOERR', 'EX_NOHOST',
> 'EX_NOINPUT', 'EX_NOPERM', 'EX_NOUSER', 'EX_OK', 'EX_OSERR',
> 'EX_OSFILE', 'EX_PROTOCOL', 'EX_SOFTWARE', 'EX_TEMPFAIL',
> 'EX_UNAVAILABLE', 'EX_USAGE', 'F_OK', 'NGROUPS_MAX', 'O_APPEND',
> 'O_CREAT', 'O_DIRECT', 'O_DIRECTORY', 'O_DSYNC', 'O_EXCL',
> 'O_LARGEFILE', 'O_NDELAY', 'O_NOCTTY', 'O_NOFOLLOW', 'O_NONBLOCK',
> 'O_RDONLY', 'O_RDWR', 'O_RSYNC', 'O_SYNC', 'O_TRUNC', 'O_WRONLY',
> 'P_NOWAIT', 'P_NOWAITO', 'P_WAIT', 'R_OK', 'SEEK_CUR', 'SEEK_END',
> 'SEEK_SET', 'TMP_MAX', 'UserDict', 'WCONTINUED', 'WCOREDUMP',
> 'WEXITSTATUS', 'WIFCONTINUED', 'WIFEXITED', 'WIFSIGNALED', 'WIFSTOPPED',
> 'WNOHANG', 'WSTOPSIG', 'WTERMSIG', 'WUNTRACED', 'W_OK', 'X_OK',
> '_Environ', '__all__', '__builtins__', '__doc__', '__file__',
> '__name__', '_copy_reg', '_execvpe', '_exists', '_exit',
> '_get_exports_list', '_make_stat_result', '_make_statvfs_result',
> '_pickle_stat_result', '_pickle_statvfs_result', '_spawnvef', 'abort',
> 'access', 'altsep', 'chdir', 'chmod', 'chown', 'chroot', 'close',
> 'confstr', 'confstr_names', 'ctermid', 'curdir', 'defpath', 'devnull',
> 'dup', 'dup2', 'environ', 'error', 'execl', 'execle', 'execlp',
> 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'extsep', 'fchdir',
> 'fdatasync', 'fdopen', 'fork', 'forkpty', 'fpathconf', 'fstat',
> 'fstatvfs', 'fsync', 'ftruncate', 'getcwd', 'getcwdu', 'getegid',
> 'getenv', 'geteuid', 'getgid', 'getgroups', 'getloadavg', 'getlogin',
> 'getpgid', 'getpgrp', 'getpid', 'getppid', 'getsid', 'getuid', 'isatty',
> 'kill', 'killpg', 'lchown', 'linesep', 'link', 'listdir', 'lseek',
> 'lstat', 'major', 'makedev', 'makedirs', 'minor', 'mkdir', 'mkfifo',
> 'mknod', 'name', 'nice', 'open', 'openpty', 'pardir', 'path',
> 'pathconf', 'pathconf_names', 'pathsep', 'pipe', 'popen', 'popen2',
> 'popen3', 'popen4', 'putenv', 'read', 'readlink', 'remove',
> 'removedirs', 'rename', 'renames', 'rmdir', 'sep', 'setegid', 'seteuid',
> 'setgid', 'setgroups', 'setpgid', 'setpgrp', 'setregid', 'setreuid',
> 'setsid', 'setuid', 'spawnl', 'spawnle', 'spawnlp', 'spawnlpe',
> 'spawnv', 'spawnve', 'spawnvp', 'spawnvpe', 'stat', 'stat_float_times',
> 'stat_result', 'statvfs', 'statvfs_result', 'strerror', 'symlink',
> 'sys', 'sysconf', 'sysconf_names', 'system', 'tcgetpgrp', 'tcsetpgrp',
> 'tempnam', 'times', 'tmpfile', 'tmpnam', 'ttyname', 'umask', 'uname',
> 'unlink', 'unsetenv', 'urandom', 'utime', 'wait', 'wait3', 'wait4',
> 'waitpid', 'walk', 'write']
>
> >>> from os import *
> >>> dir()
>
> ['EX_CANTCREAT', 'EX_CONFIG', 'EX_DATAERR', 'EX_IOERR', 'EX_NOHOST',
> 'EX_NOINPUT', 'EX_NOPERM', 'EX_NOUSER', 'EX_OK', 'EX_OSERR',
> 'EX_OSFILE', 'EX_PROTOCOL', 'EX_SOFTWARE', 'EX_TEMPFAIL',
> 'EX_UNAVAILABLE', 'EX_USAGE', 'F_OK', 'NGROUPS_MAX', 'O_APPEND',
> 'O_CREAT', 'O_DIRECT', 'O_DIRECTORY', 'O_DSYNC', 'O_EXCL',
> 'O_LARGEFILE', 'O_NDELAY', 'O_NOCTTY', 'O_NOFOLLOW', 'O_NONBLOCK',
> 'O_RDONLY', 'O_RDWR', 'O_RSYNC', 'O_SYNC', 'O_TRUNC', 'O_WRONLY',
> 'R_OK', 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'WCONTINUED',
> 'WCOREDUMP', 'WEXITSTATUS', 'WIFCONTINUED', 'WIFEXITED', 'WIFSIGNALED',
> 'WIFSTOPPED', 'WNOHANG', 'WSTOPSIG', 'WTERMSIG', 'WUNTRACED', 'W_OK',
> 'X_OK', '__builtins__', '__doc__', '__file__', '__name__', 'abort',
> 'access', 'altsep', 'chdir', 'chmod', 'chown', 'chroot', 'close',
> 'confstr', 'confstr_names', 'ctermid', 'curdir', 'defpath', 'devnull',
> 'dup', 'dup2', 'environ', 'error', 'execl', 'execle', 'execlp',
> 'execlpe', 'execv', 'execve', 'execvp', 'execvpe', 'fchdir',
> 'fdatasync', 'fdopen', 'fork', 'forkpty', 'fpathconf', 'fstat',
> 'fstatvfs', 'fsync', 'ftruncate', 'getcwd', 'getcwdu', 'getegid',
> 'getenv', 'geteuid', 'getgid', 'getgroups', 'getloadavg', 'getlogin',
> 'getpgid', 'getpgrp', 'getpid', 'getppid', 'getsid', 'getuid', 'isatty',
> 'kill', 'killpg', 'lchown', 'linesep', 'link', 'listdir', 'lseek',
> 'lstat', 'major', 'makedev', 'makedirs', 'minor', 'mkdir', 'mkfifo',
> 'mknod', 'name', 'nice', 'open', 'openpty', 'os', 'pardir', 'path',
> 'pathconf', 'pathconf_names', 'pathsep', 'pipe', 'popen', 'popen2',
> 'popen3', 'popen4', 'putenv', 'read', 'readlink', 'remove',
> 'removedirs', 'rename', 'renames', 'rmdir', 'sep', 'setegid', 'seteuid',
> 'setgid', 'setgroups', 'setpgid', 'setpgrp', 'setregid', 'setreuid',
> 'setsid', 'setuid', 'spawnl', 'spawnle', 'spawnlp', 'spawnlpe',
> 'spawnv', 'spawnve', 'spawnvp', 'spawnvpe', 'stat', 'stat_float_times',
> 'stat_result', 'statvfs', 'statvfs_result', 'strerror', 'symlink',
> 'sysconf', 'sysconf_names', 'system', 'tcgetpgrp', 'tcsetpgrp',
> 'tempnam', 'times', 'tmpfile', 'tmpnam', 'ttyname', 'umask', 'uname',
> 'unlink', 'unsetenv', 'utime', 'wait', 'wait3', 'wait4', 'waitpid',
> 'walk', 'write']
>
>
> Hope that helps,
> Uwe
Uwe thanks I have it's just my nose is getting in the way all the time.  BTW I 
use dir() all the time - that's how I discovered the __ and _ don't show up.

-- 
John Fabiani

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to