From arj.python at gmail.com Mon Mar 1 00:05:55 2021 From: arj.python at gmail.com (Abdur-Rahmaan Janhangeer) Date: Mon, 1 Mar 2021 09:05:55 +0400 Subject: Packaging/MANIFEST.in: Incude All, Exclude .gitignore Message-ID: Greetings list, SInce i have a .gitignore, how do i exclude all files and folders listed by my gitignore? How do i include everything by default? Kind Regards, Abdur-Rahmaan Janhangeer about | blog github Mauritius From greg.ewing at canterbury.ac.nz Mon Mar 1 00:44:39 2021 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Mon, 1 Mar 2021 18:44:39 +1300 Subject: weirdness with list() In-Reply-To: References: Message-ID: On 28/02/21 1:17 pm, Cameron Simpson wrote: > [its length in bytes] is presented via the object's __len__ method, > BUT... It also has a __iter__ value, which like any Box iterates over > the subboxes. You're misusing __len__ here. If an object is iterable and also has a __len__, its __len__ should return the number of items you would get if you iterated over it. Anything else is confusing and can lead to trouble, as you found here. > But is there a cleaner way to do this? Yes. Give up on using __len__ to get the length in bytes, and provide another way to do that. -- Greg From cs at cskk.id.au Mon Mar 1 06:29:34 2021 From: cs at cskk.id.au (Cameron Simpson) Date: Mon, 1 Mar 2021 22:29:34 +1100 Subject: weirdness with list() In-Reply-To: <3a38a712-60ec-c8aa-5c85-bb8d65a047fd@mrabarnett.plus.com> References: <3a38a712-60ec-c8aa-5c85-bb8d65a047fd@mrabarnett.plus.com> Message-ID: On 01Mar2021 00:06, MRAB wrote: >I'm not seeing a huge problem here: > >Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 >64 bit (AMD64)] on win32 >Type "help", "copyright", "credits" or "license" for more information. >>>> import time >>>> class A: >... def __len__(self): >... return 1024**3 >... def __iter__(self): >... yield from () >... >>>> a = A() >>>> len(a) >1073741824 >>>> s = time.time() >>>> list(a) >[] >>>> print(time.time() - s) >0.16294455528259277 3.9.1 on MacOS: 14.529589891433716 3.9.2 on MacOS: instant again Interesting. - Cameron Simpson From grant.b.edwards at gmail.com Mon Mar 1 09:10:55 2021 From: grant.b.edwards at gmail.com (Grant Edwards) Date: Mon, 1 Mar 2021 14:10:55 -0000 (UTC) Subject: weirdness with list() References: Message-ID: On 2021-03-01, Greg Ewing wrote: > On 28/02/21 1:17 pm, Cameron Simpson wrote: >> [its length in bytes] is presented via the object's __len__ method, > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. > > You're misusing __len__ here. If an object is iterable and > also has a __len__, its __len__ should return the number of > items you would get if you iterated over it. Anything else > is confusing and can lead to trouble, as you found here. That was certainly my reaction. Can you imagine the confusion if len() of a list returned the number of bytes required for srorage insttead of the number of elements? >> But is there a cleaner way to do this? > > Yes. Give up on using __len__ to get the length in bytes, > and provide another way to do that. From garabik-news-2005-05 at kassiopeia.juls.savba.sk Mon Mar 1 08:04:16 2021 From: garabik-news-2005-05 at kassiopeia.juls.savba.sk (garabik-news-2005-05 at kassiopeia.juls.savba.sk) Date: Mon, 1 Mar 2021 13:04:16 +0000 (UTC) Subject: grc 1.12 released Message-ID: This is generic colouriser, version 1.12 grc is a colouriser configured by regular expressions, including a simple command line wrapper for some commonly used unix commands. Notable changes in this version: - add several configuration files - pass invalid UTF-8 unchanged, if possible - fix other minor bugs License: GPL (any version) URL: http://kassiopeia.juls.savba.sk/~garabik/software/grc.html -- ----------------------------------------------------------- | Radovan Garab?k http://kassiopeia.juls.savba.sk/~garabik/ | | __..--^^^--..__ garabik @ kassiopeia.juls.savba.sk | ----------------------------------------------------------- Antivirus alert: file .signature infected by signature virus. Hi! I'm a signature virus! Copy me into your signature file to help me spread! From manfred.schmidt at posteo.de Mon Mar 1 12:46:45 2021 From: manfred.schmidt at posteo.de (manfred.schmidt at posteo.de) Date: Mon, 01 Mar 2021 18:46:45 +0100 Subject: try to install Python3.9.2 / setup failed In-Reply-To: <991c99720af5b2c212476899209aab82@posteo.de> References: <991c99720af5b2c212476899209aab82@posteo.de> Message-ID: <4c4ad8369d630978f3b2a1e41d2f8a81@posteo.de> Hello Python Team, i tried to install SW above; the installation stopped with the message "one or more issues caused the setup to fail. Please the issues and then retry 0x80070642 installation stopped by user" What must i do go get the SW installed? Windows 10, file "python-3.9.2-amd64.exe" Best Regards from Lake of Constance Manfred Schmidt log-file: [3314:32E8][2021-03-01T18:44:04]i001: Burn v3.11.1.2318, Windows v10.0 (Build 19041: Service Pack 0), path: C:\Users\Manfred Schmidt\AppData\Local\Temp\{2E17A51D-2D6F-45A4-A0FE-7965AAB86107}\.cr\python-3.9.2-amd64.exe [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'ActionLikeInstalling' to value 'Installing' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'ActionLikeInstallation' to value 'Setup' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'ShortVersion' to value '3.9' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'ShortVersionNoDot' to value '39' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'WinVer' to value '3.9' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'WinVerNoDot' to value '39' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'InstallAllUsers' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'InstallLauncherAllUsers' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'TargetDir' to value '' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'DefaultAllUsersTargetDir' to value '[ProgramFiles64Folder]Python[WinVerNoDot]' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'TargetPlatform' to value 'x64' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'DefaultJustForMeTargetDir' to value '[LocalAppDataFolder]Programs\Python\Python[WinVerNoDot]' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'OptionalFeaturesRegistryKey' to value 'Software\Python\PythonCore\[WinVer]\InstalledFeatures' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'TargetDirRegistryKey' to value 'Software\Python\PythonCore\[WinVer]\InstallPath' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'DefaultCustomTargetDir' to value '' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'InstallAllUsersState' to value 'enabled' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'InstallLauncherAllUsersState' to value 'enabled' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'CustomInstallLauncherAllUsersState' to value '[InstallLauncherAllUsersState]' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'TargetDirState' to value 'enabled' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'CustomBrowseButtonState' to value 'enabled' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_core' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_exe' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_dev' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_lib' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_test' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_doc' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_tools' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_tcltk' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_pip' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_launcher' to value '-1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'Include_launcherState' to value 'enabled' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_symbols' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Include_debug' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'LauncherOnly' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'DetectedLauncher' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'DetectedOldLauncher' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'AssociateFiles' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'Shortcuts' to value '1' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'PrependPath' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'CompileAll' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing numeric variable 'SimpleInstall' to value '0' [3314:32E8][2021-03-01T18:44:04]i000: Initializing string variable 'SimpleInstallDescription' to value '' [3314:32E8][2021-03-01T18:44:04]i009: Command Line: '"-burn.clean.room=C:\Users\Manfred Schmidt\Downloads\python-3.9.2-amd64.exe" -burn.filehandle.attached=544 -burn.filehandle.self=552' [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\Manfred Schmidt\Downloads\python-3.9.2-amd64.exe' [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\Manfred Schmidt\Downloads\' [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404.log' [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'WixBundleName' to value 'Python 3.9.2 (64-bit)' [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'WixBundleManufacturer' to value 'Python Software Foundation' [3314:32E8][2021-03-01T18:44:04]i000: Setting numeric variable 'CRTInstalled' to value 1 [3314:0984][2021-03-01T18:44:04]i000: Did not find C:\Users\Manfred Schmidt\Downloads\unattend.xml [3314:0984][2021-03-01T18:44:04]i000: Setting string variable 'ActionLikeInstalling' to value 'Installing' [3314:0984][2021-03-01T18:44:04]i000: Setting string variable 'ActionLikeInstallation' to value 'Setup' [3314:0984][2021-03-01T18:44:04]i000: Setting version variable 'WixBundleFileVersion' to value '3.9.2150.0' [3314:0984][2021-03-01T18:44:04]i000: Target OS is Windows 10 or later [3314:32E8][2021-03-01T18:44:04]i100: Detect begin, 52 packages [3314:32E8][2021-03-01T18:44:04]i000: Setting numeric variable 'InstallLauncherAllUsers' to value 1 [3314:32E8][2021-03-01T18:44:04]i000: Setting numeric variable 'Include_launcher' to value 1 [3314:32E8][2021-03-01T18:44:04]i000: Setting numeric variable 'DetectedLauncher' to value 1 [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'Include_launcherState' to value 'disable' [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'InstallLauncherAllUsersState' to value 'disable' [3314:32E8][2021-03-01T18:44:04]i000: Setting numeric variable 'AssociateFiles' to value 1 [3314:32E8][2021-03-01T18:44:04]i101: Detected package: ucrt_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: ucrt_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: core_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: core_AllUsers_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: core_AllUsers_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: core_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: core_JustForMe_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: core_JustForMe_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: dev_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: dev_AllUsers_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: dev_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: dev_JustForMe_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: exe_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: exe_AllUsers, feature: DefaultFeature, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: exe_AllUsers, feature: Shortcuts, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: exe_AllUsers_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: exe_AllUsers_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: exe_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: exe_JustForMe, feature: DefaultFeature, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: exe_JustForMe, feature: Shortcuts, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: exe_JustForMe_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: exe_JustForMe_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: lib_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: lib_AllUsers_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: lib_AllUsers_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: lib_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: lib_JustForMe_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: lib_JustForMe_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: test_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: test_AllUsers_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: test_AllUsers_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: test_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: test_JustForMe_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: test_JustForMe_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: doc_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: doc_AllUsers, feature: DefaultFeature, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: doc_AllUsers, feature: Shortcuts, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: doc_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: doc_JustForMe, feature: DefaultFeature, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: doc_JustForMe, feature: Shortcuts, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tools_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tools_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tcltk_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_AllUsers, feature: DefaultFeature, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_AllUsers, feature: AssociateFiles, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_AllUsers, feature: Shortcuts, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tcltk_AllUsers_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_AllUsers_pdb, feature: Symbols, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tcltk_AllUsers_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_AllUsers_d, feature: DebugBinaries, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tcltk_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_JustForMe, feature: DefaultFeature, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_JustForMe, feature: AssociateFiles, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_JustForMe, feature: Shortcuts, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tcltk_JustForMe_pdb, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_JustForMe_pdb, feature: Symbols, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: tcltk_JustForMe_d, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: tcltk_JustForMe_d, feature: DebugBinaries, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: launcher_AllUsers, state: Present, cached: Complete [3314:32E8][2021-03-01T18:44:04]i104: Detected package: launcher_AllUsers, feature: DefaultFeature, state: Local [3314:32E8][2021-03-01T18:44:04]i104: Detected package: launcher_AllUsers, feature: AssociateFiles, state: Local [3314:32E8][2021-03-01T18:44:04]i101: Detected package: launcher_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i104: Detected package: launcher_JustForMe, feature: DefaultFeature, state: Absent [3314:32E8][2021-03-01T18:44:04]i104: Detected package: launcher_JustForMe, feature: AssociateFiles, state: Absent [3314:32E8][2021-03-01T18:44:04]i101: Detected package: pip_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: pip_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: path_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: path_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: compileall_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: compileallO_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: compileallOO_AllUsers, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: compileall_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: compileallO_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i101: Detected package: compileallOO_JustForMe, state: Absent, cached: None [3314:32E8][2021-03-01T18:44:04]i000: Setting string variable 'TargetDir' to value 'C:\Users\Manfred Schmidt\AppData\Local\Programs\Python\Python39' [3314:32E8][2021-03-01T18:44:04]i199: Detect complete, result: 0x0 [3314:0984][2021-03-01T18:44:04]i000: Disable control InstallLauncherAllUsers [3314:0984][2021-03-01T18:44:04]i052: Condition 'not WixBundleElevated and (InstallAllUsers or (Include_launcher and InstallLauncherAllUsers and not DetectedLauncher))' evaluates to false. [3314:0984][2021-03-01T18:44:09]i000: Setting numeric variable 'PrependPath' to value 1 [3314:0984][2021-03-01T18:44:09]i000: Setting numeric variable 'CompileAll' to value 0 [3314:0984][2021-03-01T18:44:09]i000: Setting string variable 'ActionLikeInstalling' to value 'Installing' [3314:0984][2021-03-01T18:44:09]i000: Setting string variable 'ActionLikeInstallation' to value 'Setup' [3314:32E8][2021-03-01T18:44:09]i200: Plan begin, 52 packages, action: Install [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: ucrt_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: core_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: core_AllUsers_pdb, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: core_AllUsers_d, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_core_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_000_core_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_core_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_000_core_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_dev and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_dev and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: dev_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_dev and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_dev and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: dev_AllUsers_d, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_dev and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_dev and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_dev_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_001_dev_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_dev_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_001_dev_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_dev and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_dev and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 2 msi features for package: exe_AllUsers [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Shortcuts, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: exe_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: exe_AllUsers_pdb, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: exe_AllUsers_d, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i204: Plan 2 msi features for package: exe_JustForMe [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Shortcuts, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_exe_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_002_exe_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_exe_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_002_exe_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_lib and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_lib and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: lib_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_lib and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_lib and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: lib_AllUsers_pdb, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_lib and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_lib and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: lib_AllUsers_d, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_lib and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_lib and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_lib_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_003_lib_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_lib_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_003_lib_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_lib and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_lib and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_lib and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_lib and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_test and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_test and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: test_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_test and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_test and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: test_AllUsers_pdb, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_test and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_test and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: test_AllUsers_d, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_test and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_test and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_test_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_004_test_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_test_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_004_test_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_test and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_test and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_test and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_test and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_doc and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_doc and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 2 msi features for package: doc_AllUsers [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Shortcuts, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: doc_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_doc and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_doc and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i204: Plan 2 msi features for package: doc_JustForMe [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Shortcuts, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_doc_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_005_doc_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_doc_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_005_doc_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tools and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tools and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: tools_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tools and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tools and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_tools_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_006_tools_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_tools_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_006_tools_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tcltk and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tcltk and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 3 msi features for package: tcltk_AllUsers [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: AssociateFiles, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Shortcuts, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: tcltk_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tcltk and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tcltk and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 1 msi features for package: tcltk_AllUsers_pdb [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Symbols, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: tcltk_AllUsers_pdb, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tcltk and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_tcltk and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 1 msi features for package: tcltk_AllUsers_d [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DebugBinaries, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: tcltk_AllUsers_d, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tcltk and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tcltk and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i204: Plan 3 msi features for package: tcltk_JustForMe [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: AssociateFiles, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Shortcuts, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_tcltk_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_007_tcltk_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_tcltk_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_007_tcltk_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tcltk and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tcltk and Include_symbols and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 1 msi features for package: tcltk_JustForMe_pdb [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: Symbols, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tcltk and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_tcltk and Include_debug and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 1 msi features for package: tcltk_JustForMe_d [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DebugBinaries, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i052: Condition '(InstallAllUsers or InstallLauncherAllUsers) and Include_launcher and not DetectedLauncher' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition '(InstallAllUsers or InstallLauncherAllUsers) and Include_launcher and not DetectedLauncher' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 2 msi features for package: launcher_AllUsers [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Local, default requested: Unknown, ba requested: Local, execute action: None, rollback action: None [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: AssociateFiles, state: Local, default requested: Unknown, ba requested: Local, execute action: None, rollback action: None [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: launcher_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not (InstallAllUsers or InstallLauncherAllUsers) and Include_launcher and not DetectedLauncher' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not (InstallAllUsers or InstallLauncherAllUsers) and Include_launcher and not DetectedLauncher' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i204: Plan 2 msi features for package: launcher_JustForMe [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: DefaultFeature, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i203: Planned feature: AssociateFiles, state: Absent, default requested: Unknown, ba requested: Local, execute action: AddLocal, rollback action: Remove [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_pip and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and Include_pip and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: pip_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_pip and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and Include_pip and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_pip_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_008_pip_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_pip_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_008_pip_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and PrependPath and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and PrependPath and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w322: Skipping cross-scope dependency registration on package: path_AllUsers, bundle scope: PerUser, package scope: PerMachine [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and PrependPath and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and PrependPath and not LauncherOnly' evaluates to true. [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleRollbackLog_path_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_009_path_JustForMe_rollback.log' [3314:32E8][2021-03-01T18:44:09]i000: Setting string variable 'WixBundleLog_path_JustForMe' to value 'C:\Users\Manfred Schmidt\AppData\Local\Temp\Python 3.9.2 (64-bit)_20210301184404_009_path_JustForMe.log' [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w321: Skipping dependency registration on package with no dependency providers: compileall_AllUsers [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w321: Skipping dependency registration on package with no dependency providers: compileallO_AllUsers [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w321: Skipping dependency registration on package with no dependency providers: compileallOO_AllUsers [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w321: Skipping dependency registration on package with no dependency providers: compileall_JustForMe [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w321: Skipping dependency registration on package with no dependency providers: compileallO_JustForMe [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]i052: Condition 'not InstallAllUsers and CompileAll and not LauncherOnly' evaluates to false. [3314:32E8][2021-03-01T18:44:09]w321: Skipping dependency registration on package with no dependency providers: compileallOO_JustForMe [3314:32E8][2021-03-01T18:44:09]i201: Planned package: ucrt_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: ucrt_JustForMe, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: core_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: core_AllUsers_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: core_AllUsers_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: core_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: core_JustForMe_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: core_JustForMe_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: dev_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: dev_AllUsers_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: dev_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: dev_JustForMe_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: exe_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: exe_AllUsers_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: exe_AllUsers_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: exe_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: exe_JustForMe_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: exe_JustForMe_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: lib_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: lib_AllUsers_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: lib_AllUsers_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: lib_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: lib_JustForMe_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: lib_JustForMe_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: test_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: test_AllUsers_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: test_AllUsers_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: test_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: test_JustForMe_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: test_JustForMe_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: doc_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: doc_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tools_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tools_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tcltk_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tcltk_AllUsers_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tcltk_AllUsers_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tcltk_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tcltk_JustForMe_pdb, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: tcltk_JustForMe_d, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: launcher_AllUsers, state: Present, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: launcher_JustForMe, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: pip_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: pip_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: path_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: path_JustForMe, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register [3314:32E8][2021-03-01T18:44:09]i201: Planned package: compileall_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: compileallO_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: compileallOO_AllUsers, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: compileall_JustForMe, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: compileallO_JustForMe, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i201: Planned package: compileallOO_JustForMe, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None [3314:32E8][2021-03-01T18:44:09]i299: Plan complete, result: 0x0 [3314:32E8][2021-03-01T18:44:09]i300: Apply begin [3314:32E8][2021-03-01T18:44:09]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3973ea30-aa45-4804-9840-93a305a0d632}, options: 0x7, disable resume: No [3314:32E8][2021-03-01T18:44:09]i000: Caching bundle from: 'C:\Users\Manfred Schmidt\AppData\Local\Temp\{D5330290-DA77-4169-AAA1-AB9F33B829F7}\.be\python-3.9.2-amd64.exe' to: 'C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{3973ea30-aa45-4804-9840-93a305a0d632}\python-3.9.2-amd64.exe' [3314:32E8][2021-03-01T18:44:10]i320: Registering bundle dependency provider: CPython-3.9, version: 3.9.2150.0 [3314:32E8][2021-03-01T18:44:10]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3973ea30-aa45-4804-9840-93a305a0d632}, resume: Active, restart initiated: No, disable resume: No [3314:30A8][2021-03-01T18:44:10]i305: Verified acquired payload: core_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\core_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{1F050E31-5E11-4184-B791-8FD5070C55AA}v3.9.2150.0\core.msi. [3314:32E8][2021-03-01T18:44:10]i323: Registering package dependency provider: {1F050E31-5E11-4184-B791-8FD5070C55AA}, version: 3.9.2150.0, package: core_JustForMe [3314:32E8][2021-03-01T18:44:10]i301: Applying execute package: core_JustForMe, action: Install, path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{1F050E31-5E11-4184-B791-8FD5070C55AA}v3.9.2150.0\core.msi, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" TARGETDIR="C:\Users\Manfred Schmidt\AppData\Local\Programs\Python\Python39" OPTIONALFEATURESREGISTRYKEY="Software\Python\PythonCore\3.9\InstalledFeatures"' [3314:30A8][2021-03-01T18:44:10]i305: Verified acquired payload: dev_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\dev_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{EA736F6F-172B-4D18-831E-B5DFB2EA5057}v3.9.2150.0\dev.msi. [3314:30A8][2021-03-01T18:44:10]i305: Verified acquired payload: exe_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\exe_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{701FA3EE-56EB-422A-A2D9-FFFE12E53A5E}v3.9.2150.0\exe.msi. [3314:30A8][2021-03-01T18:44:10]i305: Verified acquired payload: lib_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\lib_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{D5638C16-6D72-4A80-B101-07B6B9C92273}v3.9.2150.0\lib.msi. [3314:30A8][2021-03-01T18:44:10]i305: Verified acquired payload: test_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\test_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{73AB4143-E6F9-4AFB-B0F5-B0AE869B37FB}v3.9.2150.0\test.msi. [3314:30A8][2021-03-01T18:44:10]i305: Verified acquired payload: doc_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\doc_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{FDD5FBD7-2E89-496E-B0CE-19FA26F3C347}v3.9.2150.0\doc.msi. [3314:30A8][2021-03-01T18:44:11]i305: Verified acquired payload: tools_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\tools_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{D345FB80-FF7C-4DF0-B60A-924B7F7D1974}v3.9.2150.0\tools.msi. [3314:30A8][2021-03-01T18:44:11]i305: Verified acquired payload: tcltk_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\tcltk_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{0281F202-0833-49D8-8145-530021FF2CA2}v3.9.2150.0\tcltk.msi. [3314:30A8][2021-03-01T18:44:11]i305: Verified acquired payload: pip_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\pip_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{ECCE5BC5-9400-4BB7-82F4-3699308CCC18}v3.9.2150.0\pip.msi. [3314:30A8][2021-03-01T18:44:11]i305: Verified acquired payload: path_JustForMe at path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\.unverified\path_JustForMe, moving to: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{BA86AE20-66E7-48D9-BD8B-8FAD5BDB7882}v3.9.2150.0\path.msi. [3314:32E8][2021-03-01T18:44:12]e000: Error 0x80070642: Failed to install MSI package. [3314:32E8][2021-03-01T18:44:12]e000: Error 0x80070642: Failed to configure per-user MSI package. [3314:32E8][2021-03-01T18:44:12]i319: Applied execute package: core_JustForMe, result: 0x80070642, restart: None [3314:32E8][2021-03-01T18:44:12]e000: Error 0x80070642: Failed to execute MSI package. [3314:32E8][2021-03-01T18:44:12]i318: Skipped rollback of package: core_JustForMe, action: Uninstall, already: Absent [3314:32E8][2021-03-01T18:44:12]i319: Applied rollback package: core_JustForMe, result: 0x0, restart: None [3314:32E8][2021-03-01T18:44:12]i329: Removed package dependency provider: {1F050E31-5E11-4184-B791-8FD5070C55AA}, package: core_JustForMe [3314:32E8][2021-03-01T18:44:12]i351: Removing cached package: core_JustForMe, from path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{1F050E31-5E11-4184-B791-8FD5070C55AA}v3.9.2150.0\ [3314:32E8][2021-03-01T18:44:12]i329: Removed package dependency provider: {B2A61038-1479-48B4-BE08-91317E5F459B}, package: ucrt_JustForMe [3314:32E8][2021-03-01T18:44:12]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3973ea30-aa45-4804-9840-93a305a0d632}, resume: None, restart: None, disable resume: No [3314:32E8][2021-03-01T18:44:12]i330: Removed bundle dependency provider: CPython-3.9 [3314:32E8][2021-03-01T18:44:12]i352: Removing cached bundle: {3973ea30-aa45-4804-9840-93a305a0d632}, from path: C:\Users\Manfred Schmidt\AppData\Local\Package Cache\{3973ea30-aa45-4804-9840-93a305a0d632}\ [3314:32E8][2021-03-01T18:44:12]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3973ea30-aa45-4804-9840-93a305a0d632}, resume: None, restart initiated: No, disable resume: No [3314:32E8][2021-03-01T18:44:13]i399: Apply complete, result: 0x80070642, restart: None, ba requested restart: No From cs at cskk.id.au Mon Mar 1 16:59:16 2021 From: cs at cskk.id.au (Cameron Simpson) Date: Tue, 2 Mar 2021 08:59:16 +1100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: On 28Feb2021 23:47, Alan Gauld wrote: >On 28/02/2021 00:17, Cameron Simpson wrote: >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. For MDAT that is implemented like this: >> >> def __iter__(self): >> yield from () > >Sorry, a bit OT but I'm curious. I haven't seen >this before: > >yield from () > >What is it doing? >What do the () represent in this context? It's an empty tuple. The yield from iterates over the tuple, yielding zero times. There are shorter ways to write that (eg outright omitting the yield), except when you're writing a generator function with only a single yield statement - then you need something like that to make it a generator. Cheers, Cameron Simpson From cs at cskk.id.au Mon Mar 1 16:56:34 2021 From: cs at cskk.id.au (Cameron Simpson) Date: Tue, 2 Mar 2021 08:56:34 +1100 Subject: weirdness with list() In-Reply-To: References: Message-ID: On 01Mar2021 14:10, Grant Edwards wrote: >That was certainly my reaction. Can you imagine the confusion if len() >of a list returned the number of bytes required for srorage insttead >of the number of elements? Yeah, well the ancestry of these classes is a binary deserialise/serialise base class, so __len__ _is_ the natural thing - the length of the object when serialised. The conflation came when making a recursive hierarchical system to parse ISO14496 files (MOV, MP4). These have variable sized binary records which can themselves enclose other records, often an array of other records. That led me down the path of making an __iter__ (not previously present), without considering the __len__ interaction. I've split these things apart now, and will probably go the full step of not providing __iter__ at all, instead requiring things to reach for the .boxes attribute or a generic .subboxes() method, since not all these things have .boxes (depends on the record type). The design question is answered, and I consider myself at least somewhat spanked. However, the primary question was about sidestepping list()'s preallocation feature. That is also answered. Cheers, Cameron Simpson From ikorot01 at gmail.com Mon Mar 1 14:09:52 2021 From: ikorot01 at gmail.com (Igor Korot) Date: Mon, 1 Mar 2021 13:09:52 -0600 Subject: is not recognized as an internal or external command, operable program or batch file. In-Reply-To: References: Message-ID: Hi, On Mon, Mar 1, 2021 at 12:56 PM singh.veer99999--- via Python-list wrote: > > Dear Sir/Madam > > Sir I am facing the issue from 10 days. And I tried all the ways to remove > this or to come out of this problem > but as i try to install some PYTEST or OPENPYXL packages using pip it > gives the notification that there is no writeable path present due to that > I am not ?is not recognized as an internal or external command, operable > program or batch file.? I am facing problem in running the test cases in > Pycharm for the PYTEST > please help me pls Usual stanza: How exactly did you try to install them? Which OS are you running? What version of Python? Thank you. > > > > > > Sent from [1]Mail for Windows 10 > > > > References > > Visible links > 1. https://go.microsoft.com/fwlink/?LinkId=550986 > -- > https://mail.python.org/mailman/listinfo/python-list From pablogsal at gmail.com Tue Mar 2 12:45:41 2021 From: pablogsal at gmail.com (Pablo Galindo Salgado) Date: Tue, 2 Mar 2021 17:45:41 +0000 Subject: [RELEASE] Python 3.10.0a6 is available, now with 100% more pattern matching Message-ID: Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along the way! Are you confused about all this pattern matching business? Fear not, this release also includes some fantastic documentation and some shiny new "What's new" entries. Check them here and tell us how we can improve it: What's new: https://docs.python.org/3.10/whatsnew/3.10.html Tutorial: https://docs.python.org/3.10/tutorial/controlflow.html#match-statements Go get the new alpha here: https://www.python.org/downloads/release/python-3100a6/ *Note: The alpha was officially released yesterday, but my email client failed to deliver this email to the mailing lists so I am reposting it.* **This is an early developer preview of Python 3.10** # Major new features of the 3.10 series, compared to 3.9 Python 3.10 is still in development. This release, 3.10.0a6 is the sixth of seven planned alpha releases. Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process. During the alpha phase, features may be added up until the start of the beta phase (2021-05-03) and, if necessary, may be modified or deleted up until the release candidate phase (2021-10-04). Please keep in mind that this is a preview release and its use is **not** recommended for production environments. Many new features for Python 3.10 are still being planned and written. Among the new major new features and changes so far: * [PEP 623](https://www.python.org/dev/peps/pep-0623/) -- Remove wstr from Unicode * [PEP 604](https://www.python.org/dev/peps/pep-0604/) -- Allow writing union types as X | Y * [PEP 612](https://www.python.org/dev/peps/pep-0612/) -- Parameter Specification Variables * [PEP 626](https://www.python.org/dev/peps/pep-0626/) -- Precise line numbers for debugging and other tools. * [bpo-38605](https://bugs.python.org/issue38605): `from __future__ import annotations` ([PEP 563](https://www.python.org/dev/peps/pep-0563/)) is now the default. * [PEP 618 ](https://www.python.org/dev/peps/pep-0618/) -- Add Optional Length-Checking To zip. * [bpo-12782](https://bugs.python.org/issue12782): Parenthesized context managers are now officially allowed. * [PEP 632 ](https://www.python.org/dev/peps/pep-0632/) -- Deprecate distutils module. * [PEP 613 ](https://www.python.org/dev/peps/pep-0613/) -- Explicit Type Aliases * [PEP 634 ](https://www.python.org/dev/peps/pep-0634/) -- Structural Pattern Matching: Specification * [PEP 635 ](https://www.python.org/dev/peps/pep-0635/) -- Structural Pattern Matching: Motivation and Rationale * [PEP 636 ](https://www.python.org/dev/peps/pep-0636/) -- Structural Pattern Matching: Tutorial * (Hey, **fellow core developer,** if a feature you find important is missing from this list, [let Pablo know](mailto:pablogsal at python.org ).) The next pre-release of Python 3.10 will be 3.10.0a7 ( last alpha release), currently scheduled for Monday, 2021-04-05. # More resources * [Online Documentation](https://docs.python.org/3.10/) * [PEP 619](https://www.python.org/dev/peps/pep-0619/), 3.10 Release Schedule * Report bugs at [https://bugs.python.org](https://bugs.python.org). * [Help fund Python and its community](/psf/donations/). # And now for something completely different Schwarzschild wormholes, also known as Einstein?Rosen bridges (named after Albert Einstein and Nathan Rosen), are connections between areas of space that can be modelled as vacuum solutions to the Einstein field equations, and that are now understood to be intrinsic parts of the maximally extended version of the Schwarzschild metric describing an eternal black hole with no charge and no rotation. Here, "maximally extended" refers to the idea that the spacetime should not have any "edges": it should be possible to continue this path arbitrarily far into the particle's future or past for any possible trajectory of a free-falling particle (following a geodesic in the spacetime). Although Schwarzschild wormholes are not traversable in both directions, their existence inspired Kip Thorne to imagine traversable wormholes created by holding the "throat" of a Schwarzschild wormhole open with exotic matter (material that has negative mass/energy). Regards from rainy London, Pablo Galindo Salgado From Marco.Sulla.Python at gmail.com Mon Mar 1 17:51:02 2021 From: Marco.Sulla.Python at gmail.com (Marco Sulla) Date: Mon, 1 Mar 2021 23:51:02 +0100 Subject: Why assert is not a function? Message-ID: I have a curiosity. Python, as many languages, has assert as a keyword. Can't it be implemented as a function? Is there an advantage to have it as a keyword? From mats at wichmann.us Mon Mar 1 18:15:21 2021 From: mats at wichmann.us (Mats Wichmann) Date: Mon, 1 Mar 2021 16:15:21 -0700 Subject: try to install Python3.9.2 / setup failed In-Reply-To: <4c4ad8369d630978f3b2a1e41d2f8a81@posteo.de> References: <991c99720af5b2c212476899209aab82@posteo.de> <4c4ad8369d630978f3b2a1e41d2f8a81@posteo.de> Message-ID: <051e4cbd-cd35-231e-6169-f88b91c338c9@wichmann.us> On 3/1/21 10:46 AM, manfred.schmidt at posteo.de wrote: > Hello Python Team, > > i tried to install SW above; the installation stopped with the > message > "one or more issues caused the setup to fail. > Please the issues and then retry > > 0x80070642 installation stopped by user" > > What must i do go get the SW installed? > Windows 10, file "python-3.9.2-amd64.exe" > > Best Regards from Lake of Constance > Manfred Schmidt With all due respect to the Microsoft folks here, Windows installation is a bit of a mess. When it finds something it doesn't like, it tends to throw its hands up and give you back an error that has a chance of not being terribly helpful to you, the user: you get a hex code, and an error string that doesn't seem to apply (pretty sure your installation wasn't stopped by _you_, despite what it says, though it _possibly_ could have been stopped by an external actor, like an antivirus program). Often these kinds of problems don't have a lot to do with the thing being installed, and do have a lot to do with other conditions. In my experience, this means you need to run some of the fixit tools to make sure your system doesn't have corruption that is confusing it. Try the ones from Microsoft - there's usually no need for third-party ones. I've had good luck with the one in the following link, though obviously no guarantees it will take care of this _specific_ issue: https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d From __peter__ at web.de Mon Mar 1 15:48:57 2021 From: __peter__ at web.de (Peter Otten) Date: Mon, 1 Mar 2021 21:48:57 +0100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: <114945fd-cc32-fff5-0100-17a296e5af20@web.de> On 01/03/2021 00:47, Alan Gauld via Python-list wrote: > On 28/02/2021 00:17, Cameron Simpson wrote: > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. For MDAT that is implemented like this: >> >> def __iter__(self): >> yield from () > > Sorry, a bit OT but I'm curious. I haven't seen > this before: > > yield from () > > What is it doing? > What do the () represent in this context? The 0-tuple ;) yield from x is syntactic sugar for for item in x: yield item Instead of () you can use any empty iterable. If x is empty nothing is ever yielded. From rosuav at gmail.com Tue Mar 2 16:01:50 2021 From: rosuav at gmail.com (Chris Angelico) Date: Wed, 3 Mar 2021 08:01:50 +1100 Subject: Why assert is not a function? In-Reply-To: References: Message-ID: On Wed, Mar 3, 2021 at 7:53 AM Marco Sulla wrote: > > I have a curiosity. Python, as many languages, has assert as a > keyword. Can't it be implemented as a function? Is there an advantage > to have it as a keyword? It could, but it would need some magic. A lot of test frameworks have their own set of assertions and you have to pick the one you want - for instance: assertEqual(x, y) instead of assert x == y The trouble is that, if you write a function for this, it will just get True or False, without any explanation of the cause - making it somewhat unhelpful when something goes wrong. To compensate, function equivalents inevitably have to have myriad types of assertions, where the language just needs one. ChrisA From dieter at handshake.de Tue Mar 2 12:33:58 2021 From: dieter at handshake.de (Dieter Maurer) Date: Tue, 2 Mar 2021 18:33:58 +0100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: <24638.30470.76978.418644@ixdm.fritz.box> Alan Gauld wrote at 2021-2-28 23:47 +0000: >yield from () "yield from iterator" is similar to "for i in iterator: yield i" (with special handling when data/exceptions are injected into the generator). Thus, "yield from ()" does essentially nothing with the side effect that the containing function is treated as generator function. -- Dieter From rosuav at gmail.com Tue Mar 2 16:51:59 2021 From: rosuav at gmail.com (Chris Angelico) Date: Wed, 3 Mar 2021 08:51:59 +1100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: <24638.30470.76978.418644@ixdm.fritz.box> References: <24638.30470.76978.418644@ixdm.fritz.box> Message-ID: On Wed, Mar 3, 2021 at 8:21 AM Dieter Maurer wrote: > > Alan Gauld wrote at 2021-2-28 23:47 +0000: > >yield from () > > "yield from iterator" is similar to "for i in iterator: yield i" (with > special handling when data/exceptions are injected into the generator). > > Thus, "yield from ()" does essentially nothing with the side effect > that the containing function is treated as generator function. > Another way to write the same thing is: if False: yield None This, too, will do nothing - in fact, it will be optimized out completely in current versions of CPython - but, again, will force the function to be a generator. ChrisA From alan.gauld at yahoo.co.uk Mon Mar 1 19:07:27 2021 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Tue, 2 Mar 2021 00:07:27 +0000 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: On 28/02/2021 23:47, Alan Gauld via Python-list wrote: > On 28/02/2021 00:17, Cameron Simpson wrote: > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. For MDAT that is implemented like this: >> >> def __iter__(self): >> yield from () > > Sorry, a bit OT but I'm curious. I haven't seen > this before: > > yield from () > > What is it doing? > What do the () represent in this context? > Thanks for the replies. I should have known better but I was thinking some cleverness with callables and completely forgot the empty tuple syntax. Oops! -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos From roland.em0001 at googlemail.com Tue Mar 2 03:20:10 2021 From: roland.em0001 at googlemail.com (Roland Mueller) Date: Tue, 2 Mar 2021 10:20:10 +0200 Subject: is not recognized as an internal or external command, operable program or batch file. In-Reply-To: References: Message-ID: Hello, this is windows setup issue related to the fact that python binary is not in execution path. For setting up you may find instructions by searching for "windows 10 put python to path". One result is following page: https://superuser.com/questions/143119/how-do-i-add-python-to-the-windows-path ma 1. maalisk. 2021 klo 20.54 singh.veer99999--- via Python-list ( python-list at python.org) kirjoitti: > Dear Sir/Madam > > Sir I am facing the issue from 10 days. And I tried all the ways to > remove > this or to come out of this problem > but as i try to install some PYTEST or OPENPYXL packages using pip it > gives the notification that there is no writeable path present due to > that > I am not ?is not recognized as an internal or external command, operable > program or batch file.? I am facing problem in running the test cases > in > Pycharm for the PYTEST > please help me pls > > > > > > Sent from [1]Mail for Windows 10 > > > > References > > Visible links > 1. https://go.microsoft.com/fwlink/?LinkId=550986 > -- > https://mail.python.org/mailman/listinfo/python-list > From stestagg at gmail.com Tue Mar 2 17:09:10 2021 From: stestagg at gmail.com (Stestagg) Date: Tue, 2 Mar 2021 22:09:10 +0000 Subject: Why assert is not a function? In-Reply-To: References: Message-ID: There is also the, I think seldom used, feature that calling python with '-O' removes all assert statements at parse/compile time (I believe for performance reasons) So for example: $ python -c 'assert False' Traceback (most recent call last): File "", line 1, in AssertionError But: $ python -O -c 'assert False' [no output] $ Ignoring the question about this feature being particularly useful, it would be much harder to implement if assert were a standard function (and re-bindable), as the 'arguments' in the assert construct are not even executed when '-O' is used (this is the performance gain): $ python -O -c 'assert DoesNotExist' Traceback (most recent call last): File "", line 1, in NameError: name 'DoesNotExist' is not defined vs. $ python -O -c 'assert DoesNotExist' [no output] $ so the compiler would have to do a lot of work to identify assert calls and remove them. Steve On Tue, Mar 2, 2021 at 9:04 PM Chris Angelico wrote: > On Wed, Mar 3, 2021 at 7:53 AM Marco Sulla > wrote: > > > > I have a curiosity. Python, as many languages, has assert as a > > keyword. Can't it be implemented as a function? Is there an advantage > > to have it as a keyword? > > It could, but it would need some magic. A lot of test frameworks have > their own set of assertions and you have to pick the one you want - > for instance: > > assertEqual(x, y) > > instead of > > assert x == y > > The trouble is that, if you write a function for this, it will just > get True or False, without any explanation of the cause - making it > somewhat unhelpful when something goes wrong. To compensate, function > equivalents inevitably have to have myriad types of assertions, where > the language just needs one. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > From rosuav at gmail.com Mon Mar 1 14:16:05 2021 From: rosuav at gmail.com (Chris Angelico) Date: Tue, 2 Mar 2021 06:16:05 +1100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list wrote: > > On 28/02/2021 00:17, Cameron Simpson wrote: > > > BUT... It also has a __iter__ value, which like any Box iterates over > > the subboxes. For MDAT that is implemented like this: > > > > def __iter__(self): > > yield from () > > Sorry, a bit OT but I'm curious. I haven't seen > this before: > > yield from () > > What is it doing? > What do the () represent in this context? > It's yielding all the elements in an empty tuple. Which is none of them, meaning that - for this simple example - iterating over the object will produce zero results. ChrisA From __peter__ at web.de Mon Mar 1 15:48:57 2021 From: __peter__ at web.de (Peter Otten) Date: Mon, 1 Mar 2021 21:48:57 +0100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: <114945fd-cc32-fff5-0100-17a296e5af20@web.de> On 01/03/2021 00:47, Alan Gauld via Python-list wrote: > On 28/02/2021 00:17, Cameron Simpson wrote: > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. For MDAT that is implemented like this: >> >> def __iter__(self): >> yield from () > > Sorry, a bit OT but I'm curious. I haven't seen > this before: > > yield from () > > What is it doing? > What do the () represent in this context? The 0-tuple ;) yield from x is syntactic sugar for for item in x: yield item Instead of () you can use any empty iterable. If x is empty nothing is ever yielded. From pablogsal at gmail.com Mon Mar 1 15:00:54 2021 From: pablogsal at gmail.com (Pablo Galindo Salgado) Date: Mon, 1 Mar 2021 20:00:54 +0000 Subject: Python 3.10.0a6 is available, now with 100% more pattern matching Message-ID: Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along the way! Are you confused about all this pattern matching business? Fear not, this release also includes some fantastic documentation and some shiny new "What's new" entries. Check them here and tell us how we can improve it: What's new: https://docs.python.org/3.10/whatsnew/3.10.html Tutorial: https://docs.python.org/3.10/tutorial/controlflow.html#match-statements Go get the new alpha here: https://www.python.org/downloads/release/python-3100a6/ **This is an early developer preview of Python 3.10** # Major new features of the 3.10 series, compared to 3.9 Python 3.10 is still in development. This release, 3.10.0a6 is the sixth of seven planned alpha releases. Alpha releases are intended to make it easier to test the current state of new features and bug fixes and to test the release process. During the alpha phase, features may be added up until the start of the beta phase (2021-05-03) and, if necessary, may be modified or deleted up until the release candidate phase (2021-10-04). Please keep in mind that this is a preview release and its use is **not** recommended for production environments. Many new features for Python 3.10 are still being planned and written. Among the new major new features and changes so far: * [PEP 623](https://www.python.org/dev/peps/pep-0623/) -- Remove wstr from Unicode * [PEP 604](https://www.python.org/dev/peps/pep-0604/) -- Allow writing union types as X | Y * [PEP 612](https://www.python.org/dev/peps/pep-0612/) -- Parameter Specification Variables * [PEP 626](https://www.python.org/dev/peps/pep-0626/) -- Precise line numbers for debugging and other tools. * [bpo-38605](https://bugs.python.org/issue38605): `from __future__ import annotations` ([PEP 563](https://www.python.org/dev/peps/pep-0563/)) is now the default. * [PEP 618 ](https://www.python.org/dev/peps/pep-0618/) -- Add Optional Length-Checking To zip. * [bpo-12782](https://bugs.python.org/issue12782): Parenthesized context managers are now officially allowed. * [PEP 632 ](https://www.python.org/dev/peps/pep-0632/) -- Deprecate distutils module. * [PEP 613 ](https://www.python.org/dev/peps/pep-0613/) -- Explicit Type Aliases * [PEP 634 ](https://www.python.org/dev/peps/pep-0634/) -- Structural Pattern Matching: Specification * [PEP 635 ](https://www.python.org/dev/peps/pep-0635/) -- Structural Pattern Matching: Motivation and Rationale * [PEP 636 ](https://www.python.org/dev/peps/pep-0636/) -- Structural Pattern Matching: Tutorial * (Hey, **fellow core developer,** if a feature you find important is missing from this list, [let Pablo know](mailto:pablogsal at python.org ).) The next pre-release of Python 3.10 will be 3.10.0a7 ( last alpha release), currently scheduled for Monday, 2021-04-05. # More resources * [Online Documentation](https://docs.python.org/3.10/) * [PEP 619](https://www.python.org/dev/peps/pep-0619/), 3.10 Release Schedule * Report bugs at [https://bugs.python.org](https://bugs.python.org). * [Help fund Python and its community](/psf/donations/). # And now for something completely different Schwarzschild wormholes, also known as Einstein?Rosen bridges (named after Albert Einstein and Nathan Rosen), are connections between areas of space that can be modelled as vacuum solutions to the Einstein field equations, and that are now understood to be intrinsic parts of the maximally extended version of the Schwarzschild metric describing an eternal black hole with no charge and no rotation. Here, "maximally extended" refers to the idea that the spacetime should not have any "edges": it should be possible to continue this path arbitrarily far into the particle's future or past for any possible trajectory of a free-falling particle (following a geodesic in the spacetime). Although Schwarzschild wormholes are not traversable in both directions, their existence inspired Kip Thorne to imagine traversable wormholes created by holding the "throat" of a Schwarzschild wormhole open with exotic matter (material that has negative mass/energy). Regards from rainy London, Pablo Galindo Salgado From barry at barrys-emacs.org Tue Mar 2 17:25:44 2021 From: barry at barrys-emacs.org (Barry) Date: Tue, 2 Mar 2021 22:25:44 +0000 Subject: Why assert is not a function? In-Reply-To: References: Message-ID: <95F199C3-F178-405A-BB13-CDCDD1560D12@barrys-emacs.org> > On 2 Mar 2021, at 20:54, Marco Sulla wrote: > > ?I have a curiosity. Python, as many languages, has assert as a > keyword. Can't it be implemented as a function? Is there an advantage > to have it as a keyword? assert condition, expression Only is condition is false with expression be evaluated. So you can safely do expensive things I the expression with incuring and cost if the condition is True. With a function assert the 2nd part would have to evaluated regardless of the state of the condition. Which would slow down the code for no benefit. Barry > -- > https://mail.python.org/mailman/listinfo/python-list > From Marco.Sulla.Python at gmail.com Mon Mar 1 17:56:50 2021 From: Marco.Sulla.Python at gmail.com (Marco Sulla) Date: Mon, 1 Mar 2021 23:56:50 +0100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: On Mon, 1 Mar 2021 at 19:51, Alan Gauld via Python-list wrote: > Sorry, a bit OT but I'm curious. I haven't seen > this before: > > yield from () > > What is it doing? > What do the () represent in this context? It's the empty tuple. From larry.martell at gmail.com Tue Mar 2 18:06:53 2021 From: larry.martell at gmail.com (Larry Martell) Date: Tue, 2 Mar 2021 15:06:53 -0800 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: On Tue, Mar 2, 2021 at 2:16 PM Chris Angelico wrote: > > On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list > wrote: > > > > On 28/02/2021 00:17, Cameron Simpson wrote: > > > > > BUT... It also has a __iter__ value, which like any Box iterates over > > > the subboxes. For MDAT that is implemented like this: > > > > > > def __iter__(self): > > > yield from () > > > > Sorry, a bit OT but I'm curious. I haven't seen > > this before: > > > > yield from () > > > > What is it doing? > > What do the () represent in this context? > > > > It's yielding all the elements in an empty tuple. Which is none of > them, meaning that - for this simple example - iterating over the > object will produce zero results. I discovered something new (to me) yesterday. Was writing a unit test for generator function and I found that none of the function got executed at all until I iterated on the return value. It was blowing my mind as I was debugging the test and had a BP set in the first line of the function but it was not hit when I called the function. From mirkok.lists at googlemail.com Tue Mar 2 18:20:52 2021 From: mirkok.lists at googlemail.com (Mirko) Date: Wed, 3 Mar 2021 00:20:52 +0100 Subject: Why assert is not a function? In-Reply-To: References: Message-ID: <603EC854.6010008@googlemail.com> Am 02.03.2021 um 23:09 schrieb Stestagg: > Ignoring the question about this feature being particularly useful, it It is useful because "assert" is primarily (if not purely and exclusive) a debugging tool during development and testing. In production code you don't want any asserts, but logging. Having "assert" being a function would make it much harder to get rid of it in production code. From rosuav at gmail.com Tue Mar 2 18:24:33 2021 From: rosuav at gmail.com (Chris Angelico) Date: Wed, 3 Mar 2021 10:24:33 +1100 Subject: Why assert is not a function? In-Reply-To: <603EC854.6010008@googlemail.com> References: <603EC854.6010008@googlemail.com> Message-ID: On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list wrote: > > Am 02.03.2021 um 23:09 schrieb Stestagg: > > Ignoring the question about this feature being particularly useful, it > > It is useful because "assert" is primarily (if not purely and > exclusive) a debugging tool during development and testing. > > In production code you don't want any asserts, but logging. Having > "assert" being a function would make it much harder to get rid of it > in production code. > Really? if PRODUCTION: def assert(*a, **kw): pass would work if it were a function :) ChrisA From hexamorph at gmx.net Tue Mar 2 18:46:44 2021 From: hexamorph at gmx.net (Hexamorph) Date: Wed, 3 Mar 2021 00:46:44 +0100 Subject: Why assert is not a function? In-Reply-To: References: <603EC854.6010008@googlemail.com> Message-ID: <603ECE64.2080105@gmx.net> Am 03.03.2021 um 00:24 schrieb Chris Angelico: > On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list > wrote: >> >> Am 02.03.2021 um 23:09 schrieb Stestagg: >>> Ignoring the question about this feature being particularly useful, it >> >> It is useful because "assert" is primarily (if not purely and >> exclusive) a debugging tool during development and testing. >> >> In production code you don't want any asserts, but logging. Having >> "assert" being a function would make it much harder to get rid of it >> in production code. >> > > Really? Yes. > if PRODUCTION: > def assert(*a, **kw): pass > > would work if it were a function :) With the "if PRODUCTION" being superfluously in the production code (not to mention the possible NameError otherwise). From rosuav at gmail.com Tue Mar 2 18:50:43 2021 From: rosuav at gmail.com (Chris Angelico) Date: Wed, 3 Mar 2021 10:50:43 +1100 Subject: Why assert is not a function? In-Reply-To: <603ECE64.2080105@gmx.net> References: <603EC854.6010008@googlemail.com> <603ECE64.2080105@gmx.net> Message-ID: On Wed, Mar 3, 2021 at 10:48 AM Hexamorph wrote: > > Am 03.03.2021 um 00:24 schrieb Chris Angelico: > > On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list > > wrote: > >> > >> Am 02.03.2021 um 23:09 schrieb Stestagg: > >>> Ignoring the question about this feature being particularly useful, it > >> > >> It is useful because "assert" is primarily (if not purely and > >> exclusive) a debugging tool during development and testing. > >> > >> In production code you don't want any asserts, but logging. Having > >> "assert" being a function would make it much harder to get rid of it > >> in production code. > >> > > > > Really? > > Yes. > > > if PRODUCTION: > > def assert(*a, **kw): pass > > > > would work if it were a function :) > > With the "if PRODUCTION" being superfluously in the production code > (not to mention the possible NameError otherwise). > Whatever method you have for determining whether you're in debug or prod, you can use it to decide whether or not to create the function. It's that easy. That said, though... I prefer to keep my assertions in prod too. ChrisA From cs at cskk.id.au Tue Mar 2 19:01:35 2021 From: cs at cskk.id.au (Cameron Simpson) Date: Wed, 3 Mar 2021 11:01:35 +1100 Subject: yield from () Was: Re: weirdness with list() In-Reply-To: References: Message-ID: On 02Mar2021 15:06, Larry Martell wrote: >I discovered something new (to me) yesterday. Was writing a unit test >for generator function and I found that none of the function got >executed at all until I iterated on the return value. Aye. Generators are lazy - they don't run at all until you ask for a value. By contrast, this is unlike Go's goroutines, which are busy - they commence operation as soon as invoked and run until the first yield (channel put, I forget how it is spelled now). This can cause excessive CPU utilisation, but it handle for _fast_ production of results. Which is a primary goal in Go's design. Cheers, Cameron Simpson From research at johnohagan.com Tue Mar 2 19:11:29 2021 From: research at johnohagan.com (John O'Hagan) Date: Wed, 3 Mar 2021 11:11:29 +1100 Subject: Tkinter long-running window freezes In-Reply-To: <20210224220031.5ce59f6b@e7240.home> References: <20210224220031.5ce59f6b@e7240.home> Message-ID: <20210303111129.01d6d381@e7240.home> On Wed, 24 Feb 2021 22:35:32 +1100 John O'Hagan wrote: > Hi list > > I have a 3.9 tkinter interface that displays data from an arbitrary > number of threads, each of which runs for an arbitrary period of time. > A frame opens in the root window when each thread starts and closes > when it stops. Widgets in the frame and the root window control the > thread and how the data is displayed. > > This works well for several hours, but over time the root window > becomes unresponsive and eventually freezes and goes grey. No error > messages are produced in the terminal. > > Here is some minimal, non-threaded code that reproduces the problem on > my system (Xfce4 on Debian testing): > > from tkinter import * > from random import randint > > root = Tk() > > def display(label): > label.destroy() > label = Label(text=randint(0, 9)) > label.pack() > root.after(100, display, label) > > display(Label()) > mainloop() > > This opens a tiny window that displays a random digit on a new label > every .1 second. (Obviously I could do this by updating the text > rather than recreating the label, but my real application has to > destroy widgets and create new ones). > > This works for 3-4 hours, but eventually the window freezes. Thanks to those that replied to this. To summarise my tentative and incomplete conclusions, it seems that tkinter doesn't like a lot of widgets being created and destroyed in a long running process and will/may eventually freeze if this is done, for a reason I haven't been able to fathom. Tk internally keeps names of all widgets created, and this will cause a slow memory-use increase if not prevented by manually re-using widget names, but this is not the cause of the freezing. Here is a simplified version of how I worked around the issue by recycling widgets: from tkinter import * class WidgetHandler: "Reuse tkinter widgets" widget_cache = [] def __init__(self, main_window, *args): self.datastream = MyDataStream(*args) self.main_window = main_window if self.widget_cache: self.widget = self.widget_cache.pop() self.clean(self.widget) else: self.widget = self.new_widget() #add functionality to widgets, e.g: self.widget.var.traceid = self.widget.var.trace('w', self.meth1) self.widget.button.configure(command=self.meth2) self.widget.button.pack() #etc self.widget.pack() def clean(self, widget): "Remove traces, clear text boxes, reset button states etc" #e.g: self.widget.var.trace_remove('write', var.traceid) self.widget.button['state'] = 'normal' #etc def new_widget(self): "Create widget and children without adding any commands, traces etc" widget = Frame(self.main_window) #e.g: widget.var = StringVar() widget.button = Checkbutton(widget, variable=widget.var) #etc return widget def meth1(self, *e): pass #do something with self.datastream def meth2(self): pass #do something else with self.datastream #etc def quit(self): self.datastream.quit() self.widget.pack_forget() self.widget_cache.append(self.widget) From greg.ewing at canterbury.ac.nz Tue Mar 2 22:02:10 2021 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 3 Mar 2021 16:02:10 +1300 Subject: Why assert is not a function? In-Reply-To: References: <603EC854.6010008@googlemail.com> Message-ID: On 3/03/21 12:24 pm, Chris Angelico wrote: > if PRODUCTION: > def assert(*a, **kw): pass > > would work if it were a function :) But would cost you a useless function call for every assert in production mode. -- Greg From rsstinnett at gmail.com Tue Mar 2 22:56:11 2021 From: rsstinnett at gmail.com (Russell) Date: Wed, 3 Mar 2021 03:56:11 +0000 (UTC) Subject: editor recommendations? References: <41697044-4479-97c6-4913-11de27f79565@stoneleaf.us> Message-ID: Ethan Furman wrote: > I'm currently using vim, and the primary reason I've stuck with it for so long is because I can get truly black screens with it. By which I mean that I have a colorful window title bar, a light-grey menu bar, and then a light-grey frame around the text-editing window (aka the only window), and a nice, black-background editing area. I use vim. It's actually extremely powerful, especially for text/code editing. I'd recommend reading one of the many books on using vim effectively. Also, plugins can really add a lot... -- rust 0x68caecc97f6a90122e51c0692c88d9cb6b58a3dc From drsalists at gmail.com Tue Mar 2 23:11:47 2021 From: drsalists at gmail.com (Dan Stromberg) Date: Tue, 2 Mar 2021 20:11:47 -0800 Subject: editor recommendations? In-Reply-To: References: <41697044-4479-97c6-4913-11de27f79565@stoneleaf.us> Message-ID: On Tue, Mar 2, 2021 at 8:00 PM Russell wrote: > Ethan Furman wrote: > > I'm currently using vim, and the primary reason I've stuck with it for > so long is because I can get truly black screens with it. By which I mean > that I have a colorful window title bar, a light-grey menu bar, and then a > light-grey frame around the text-editing window (aka the only window), and > a nice, black-background editing area. > > I use vim. It's actually extremely powerful, especially for text/code > editing. I'd recommend reading one of the many books on using vim > effectively. Also, plugins can really add a lot... > On the subject of learning vim: There's an excellent vi cheat sheet available on the internet. I've put a copy of it at https://stromberg.dnsalias.org/~strombrg/vi.ref.6 vi is of course the predecessor of vim. But that cheat sheet is still great for learning much of vim. From rosuav at gmail.com Tue Mar 2 23:28:34 2021 From: rosuav at gmail.com (Chris Angelico) Date: Wed, 3 Mar 2021 15:28:34 +1100 Subject: Why assert is not a function? In-Reply-To: References: <603EC854.6010008@googlemail.com> Message-ID: On Wed, Mar 3, 2021 at 2:06 PM Greg Ewing wrote: > > On 3/03/21 12:24 pm, Chris Angelico wrote: > > if PRODUCTION: > > def assert(*a, **kw): pass > > > > would work if it were a function :) > > But would cost you a useless function call for every assert > in production mode. > A micro-optimization that would almost never actually impact your code. But considering that I'm willing to keep *the entire check* active, it's possible I'm slightly biased in favour of debuggability at the cost of CPU... ChrisA From drsalists at gmail.com Tue Mar 2 23:54:04 2021 From: drsalists at gmail.com (Dan Stromberg) Date: Tue, 2 Mar 2021 20:54:04 -0800 Subject: editor recommendations? In-Reply-To: References: <41697044-4479-97c6-4913-11de27f79565@stoneleaf.us> Message-ID: On Tue, Mar 2, 2021 at 8:11 PM Dan Stromberg wrote: > > On Tue, Mar 2, 2021 at 8:00 PM Russell wrote: > >> Ethan Furman wrote: >> > I'm currently using vim, and the primary reason I've stuck with it for >> so long is because I can get truly black screens with it. By which I mean >> that I have a colorful window title bar, a light-grey menu bar, and then a >> light-grey frame around the text-editing window (aka the only window), and >> a nice, black-background editing area. >> >> I use vim. It's actually extremely powerful, especially for text/code >> editing. I'd recommend reading one of the many books on using vim >> effectively. Also, plugins can really add a lot... >> > > On the subject of learning vim: There's an excellent vi cheat sheet > available on the internet. I've put a copy of it at > https://stromberg.dnsalias.org/~strombrg/vi.ref.6 > > vi is of course the predecessor of vim. But that cheat sheet is still > great for learning much of vim. > I just ran across: http://lib.ru/MAN/viref.txt ...which is pretty much the same thing, but converted to nice HTML. From grant.b.edwards at gmail.com Tue Mar 2 21:05:02 2021 From: grant.b.edwards at gmail.com (Grant Edwards) Date: Wed, 3 Mar 2021 02:05:02 -0000 (UTC) Subject: Why assert is not a function? References: <603EC854.6010008@googlemail.com> Message-ID: On 2021-03-02, Chris Angelico wrote: > On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list> wrote: > >> In production code you don't want any asserts, but logging. Having >> "assert" being a function would make it much harder to get rid of >> it in production code. > > Really? > > if PRODUCTION: > def assert(*a, **kw): pass > > would work if it were a function :) Wouldn't that still evaluate all of the arguments? You get rid of the value of the assert, but retain almost all of the cost. I thought the entire point of asser being a keyword was so that if you disable asserts then they go away completely: the arguments aren't even evaluated. -- Grant From tjreedy at udel.edu Tue Mar 2 21:33:53 2021 From: tjreedy at udel.edu (Terry Reedy) Date: Tue, 2 Mar 2021 21:33:53 -0500 Subject: Why assert is not a function? In-Reply-To: References: Message-ID: On 3/1/2021 5:51 PM, Marco Sulla wrote: > I have a curiosity. Python, as many languages, has assert as a > keyword. Can't it be implemented as a function? Is there an advantage > to have it as a keyword? One does not need to turn the test expression into a function. One does not need to wrap the message expression to delay evaluation. -- Terry Jan Reedy From lele at metapensiero.it Wed Mar 3 04:00:36 2021 From: lele at metapensiero.it (Lele Gaifax) Date: Wed, 03 Mar 2021 10:00:36 +0100 Subject: editor recommendations? References: <41697044-4479-97c6-4913-11de27f79565@stoneleaf.us> Message-ID: <874khs8vd7.fsf@metapensiero.it> Cameron Simpson writes: > My fingers know vim. Some others' fingers know emacs. Emacs has also an Evil[1] mode, that mimics some vi/vim features. I suggest taking a look at Doom Emacs[2], a popular so-called "Emacs distribution", that provides an out-of-the-box great experience with a modular configuration. ciao, lele. [1] https://www.emacswiki.org/emacs/Evil [2] https://github.com/hlissner/doom-emacs -- Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish. ? Neal Stephenson From rosuav at gmail.com Wed Mar 3 09:54:18 2021 From: rosuav at gmail.com (Chris Angelico) Date: Thu, 4 Mar 2021 01:54:18 +1100 Subject: Why assert is not a function? In-Reply-To: References: <603EC854.6010008@googlemail.com> Message-ID: On Thu, Mar 4, 2021 at 1:40 AM Grant Edwards wrote: > > On 2021-03-02, Chris Angelico wrote: > > On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list> wrote: > > > >> In production code you don't want any asserts, but logging. Having > >> "assert" being a function would make it much harder to get rid of > >> it in production code. > > > > Really? > > > > if PRODUCTION: > > def assert(*a, **kw): pass > > > > would work if it were a function :) > > Wouldn't that still evaluate all of the arguments? You get rid of the > value of the assert, but retain almost all of the cost. > > I thought the entire point of asser being a keyword was so that if you > disable asserts then they go away completely: the arguments aren't > even evaluated. > It depends on what the point of "removing the assertions" is, but yes, that will indeed still evaluate the arguments. IMO the cost of running assertions isn't that high compared to the value of keeping them (which is why I never run -O), and the performance argument is a weak one compared to the much stronger value of having the actual failing expression available in the exception report. ChrisA From david at lowryduda.com Wed Mar 3 12:35:24 2021 From: david at lowryduda.com (David Lowry-Duda) Date: Wed, 3 Mar 2021 12:35:24 -0500 Subject: Why assert is not a function? In-Reply-To: <95F199C3-F178-405A-BB13-CDCDD1560D12@barrys-emacs.org> References: <95F199C3-F178-405A-BB13-CDCDD1560D12@barrys-emacs.org> Message-ID: > assert condition, expression > > Only is condition is false with expression be evaluated. > So you can safely do expensive things I the expression with incuring > and cost if the condition is True. I think I've only every used a string as the expression. Have you found it useful to use complicated, expensive expressions? Could you give an example? - DLD From barry at barrys-emacs.org Wed Mar 3 13:24:21 2021 From: barry at barrys-emacs.org (Barry Scott) Date: Wed, 3 Mar 2021 18:24:21 +0000 Subject: Why assert is not a function? In-Reply-To: References: <95F199C3-F178-405A-BB13-CDCDD1560D12@barrys-emacs.org> Message-ID: > On 3 Mar 2021, at 17:35, David Lowry-Duda wrote: > >> assert condition, expression >> >> Only is condition is false with expression be evaluated. >> So you can safely do expensive things I the expression with incuring >> and cost if the condition is True. > > I think I've only every used a string as the expression. Have you found > it useful to use complicated, expensive expressions? Could you give an > example? In the test suite of the product I work on its common to put a lot of information into the expression. For example if a HTTP request returns unexpected content we will include all the headers and body of the that the request returners. assert http_status == '200', 'Request failed status %r Body:\n%s' % (http_status, http_header_and_body) Barry > > - DLD > -- > https://mail.python.org/mailman/listinfo/python-list > From rosuav at gmail.com Wed Mar 3 13:41:02 2021 From: rosuav at gmail.com (Chris Angelico) Date: Thu, 4 Mar 2021 05:41:02 +1100 Subject: Why assert is not a function? In-Reply-To: References: <95F199C3-F178-405A-BB13-CDCDD1560D12@barrys-emacs.org> Message-ID: On Thu, Mar 4, 2021 at 5:25 AM Barry Scott wrote: > > > > > On 3 Mar 2021, at 17:35, David Lowry-Duda wrote: > > > >> assert condition, expression > >> > >> Only is condition is false with expression be evaluated. > >> So you can safely do expensive things I the expression with incuring > >> and cost if the condition is True. > > > > I think I've only every used a string as the expression. Have you found > > it useful to use complicated, expensive expressions? Could you give an > > example? > > In the test suite of the product I work on its common to put a lot of information into the expression. > For example if a HTTP request returns unexpected content we will include all the headers and > body of the that the request returners. > > assert http_status == '200', 'Request failed status %r Body:\n%s' % (http_status, http_header_and_body) > That doesn't look like the sort of thing that should be an assertion. Assertions should be for things that, if your code were bug-free, could never happen. ChrisA From barry at barrys-emacs.org Wed Mar 3 14:33:27 2021 From: barry at barrys-emacs.org (Barry Scott) Date: Wed, 3 Mar 2021 19:33:27 +0000 Subject: Why assert is not a function? In-Reply-To: References: <95F199C3-F178-405A-BB13-CDCDD1560D12@barrys-emacs.org> Message-ID: <5DD1201E-9A7B-4A61-BFD0-6DB2D758C05F@barrys-emacs.org> > On 3 Mar 2021, at 18:41, Chris Angelico wrote: > > On Thu, Mar 4, 2021 at 5:25 AM Barry Scott > wrote: >> >> >> >>> On 3 Mar 2021, at 17:35, David Lowry-Duda wrote: >>> >>>> assert condition, expression >>>> >>>> Only is condition is false with expression be evaluated. >>>> So you can safely do expensive things I the expression with incuring >>>> and cost if the condition is True. >>> >>> I think I've only every used a string as the expression. Have you found >>> it useful to use complicated, expensive expressions? Could you give an >>> example? >> >> In the test suite of the product I work on its common to put a lot of information into the expression. >> For example if a HTTP request returns unexpected content we will include all the headers and >> body of the that the request returners. >> >> assert http_status == '200', 'Request failed status %r Body:\n%s' % (http_status, http_header_and_body) >> > > That doesn't look like the sort of thing that should be an assertion. > Assertions should be for things that, if your code were bug-free, > could never happen. If the code works the status will be 200 and the test will pass. Now you can argue that the test suite should use something better then assert, but assert is what the code that I inherited uses. Its origins go back many many years. Its would be a lot of work to modernise as there are 1,000s of test suites affect. Barry > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list From rob.cliffe at btinternet.com Wed Mar 3 22:18:31 2021 From: rob.cliffe at btinternet.com (Rob Cliffe) Date: Thu, 4 Mar 2021 03:18:31 +0000 Subject: a + not b Message-ID: <0a183460-095d-fad1-4b87-f56e315f2bb0@btinternet.com> I can't work out why ??? 1 + - 1 ??? 1 + (not 1) are legal syntax, but ??? 1 + not 1 isn't. Is there a good reason for this? Thanks Rob Cliffe From avigross at verizon.net Wed Mar 3 22:39:49 2021 From: avigross at verizon.net (Avi Gross) Date: Wed, 3 Mar 2021 22:39:49 -0500 Subject: a + not b In-Reply-To: <0a183460-095d-fad1-4b87-f56e315f2bb0@btinternet.com> References: <0a183460-095d-fad1-4b87-f56e315f2bb0@btinternet.com> Message-ID: <0fdd01d710a8$078cd820$16a68860$@verizon.net> As a guess, Rob, precedence rules for not may not bind as strongly as you think. 1 + (not 1) With parentheses, "not 1" is a subexpression that should be performed first and might return the value "False" 1 + False treats False in a numeric context as a zero so evaluates to 1. But 1 + not 1 Looks a bit ambiguous as "+ " expects something it considers a number or that can be converted to a number. Without parentheses, it may try to do 1 + not Which gets the same Syntax error. I looked and operator "not" is evaluated much later than "+" and just before "and" and "or" so you need parentheses to force the interpretation you may intend. Similarly, some used of "and" require parentheses as do other operators. -----Original Message----- From: Python-list On Behalf Of Rob Cliffe via Python-list Sent: Wednesday, March 3, 2021 10:19 PM To: Python Subject: a + not b I can't work out why 1 + - 1 1 + (not 1) are legal syntax, but 1 + not 1 isn't. Is there a good reason for this? Thanks Rob Cliffe -- https://mail.python.org/mailman/listinfo/python-list From python at mrabarnett.plus.com Wed Mar 3 23:08:40 2021 From: python at mrabarnett.plus.com (MRAB) Date: Thu, 4 Mar 2021 04:08:40 +0000 Subject: a + not b In-Reply-To: <0fdd01d710a8$078cd820$16a68860$@verizon.net> References: <0a183460-095d-fad1-4b87-f56e315f2bb0@btinternet.com> <0fdd01d710a8$078cd820$16a68860$@verizon.net> Message-ID: <4734cb71-0c43-8918-e6bc-a1a68d682876@mrabarnett.plus.com> On 2021-03-04 03:39, Avi Gross via Python-list wrote: > As a guess, Rob, precedence rules for not may not bind as strongly as you think. > > 1 + (not 1) > > With parentheses, "not 1" is a subexpression that should be performed first and might return the value "False" > > 1 + False > > treats False in a numeric context as a zero so evaluates to 1. > > But > > 1 + not 1 > > Looks a bit ambiguous as "+ " expects something it considers a number or that can be converted to a number. Without parentheses, it may try to do > > 1 + not > > Which gets the same Syntax error. > > I looked and operator "not" is evaluated much later than "+" and just before "and" and "or" so you need parentheses to force the interpretation you may intend. Similarly, some used of "and" require parentheses as do other operators. > If you look through the grammar, the relevant bits are: sum: sum '+' term term: factor factor: power power: await_primary await_primary: primary primary: atom and an 'atom' can be a number, etc, but can never start with "not". A 'primary' can be an 'atom' and can have a subscript. > -----Original Message----- > From: Python-list On Behalf Of Rob Cliffe via Python-list > Sent: Wednesday, March 3, 2021 10:19 PM > To: Python > Subject: a + not b > > I can't work out why > 1 + - 1 > 1 + (not 1) > are legal syntax, but > 1 + not 1 > isn't. > Is there a good reason for this? > Thanks > Rob Cliffe > From grant.b.edwards at gmail.com Wed Mar 3 11:50:31 2021 From: grant.b.edwards at gmail.com (Grant Edwards) Date: Wed, 3 Mar 2021 16:50:31 -0000 (UTC) Subject: Why assert is not a function? References: <603EC854.6010008@googlemail.com> Message-ID: On 2021-03-03, Chris Angelico wrote: > On Thu, Mar 4, 2021 at 1:40 AM Grant Edwards wrote: > >> I thought the entire point of asser being a keyword was so that if you >> disable asserts then they go away completely: the arguments aren't >> even evaluated. > > It depends on what the point of "removing the assertions" is, but > yes, that will indeed still evaluate the arguments. IMO the cost of > running assertions isn't that high compared to the value of keeping > them (which is why I never run -O), and the performance argument is > a weak one compared to the much stronger value of having the actual > failing expression available in the exception report. Good point. I had forgotten about having the expression available in the exception output. That's definitly valuable. From qberz2005 at gmail.com Thu Mar 4 12:10:34 2021 From: qberz2005 at gmail.com (Quentin Bock) Date: Thu, 4 Mar 2021 12:10:34 -0500 Subject: Problem with printing statement when condition is false Message-ID: Okay so, this is my biggest project, I'm not advanced in Python in any way so don't expect it to be perfect. I made a trivia game and for the most part, it works but I can't get it to print "Incorrect" and then what the answer was for all but one of my questions and I don't know why. I use PyCharm as my IDE for his just as a heads up. I won't paste the code into this because it's 164 lines so I will attach a file copy, please don't send back the edited file only write them out and where I need to fix them, thank you! Stay Safe Everyone! :) Virus-free. www.avast.com <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> From tjreedy at udel.edu Thu Mar 4 15:15:33 2021 From: tjreedy at udel.edu (Terry Reedy) Date: Thu, 4 Mar 2021 15:15:33 -0500 Subject: Problem with printing statement when condition is false In-Reply-To: References: Message-ID: On 3/4/2021 12:10 PM, Quentin Bock wrote: > I won't paste the code into > this because it's 164 lines so I will attach a file copy, The alternative to posting too much is to reduce your code to the minimum needed to exhibit the behavior you want to change. Doing so may reveal to you the solution. It will certainly make it easier for anyone else to help you and will make any answer more useful to other readers. -- Terry Jan Reedy From voodoo.bender at gmail.com Thu Mar 4 15:36:00 2021 From: voodoo.bender at gmail.com (alberto) Date: Thu, 4 Mar 2021 12:36:00 -0800 (PST) Subject: program python Message-ID: <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> Hi I'm tring to write a program with python to evaluate data of csv data In particular I would extract this information View data on the presence of men and women in Affori over time. * Carry out an analysis relating to the last available year. Of the 10 most populous neighborhoods show: * the proportion of births out of the total * the proportion of 80+ to the total * The ratio of minors / number of kindergartens this is the file https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing How could fix it? regards From ikorot01 at gmail.com Thu Mar 4 15:49:05 2021 From: ikorot01 at gmail.com (Igor Korot) Date: Thu, 4 Mar 2021 14:49:05 -0600 Subject: program python In-Reply-To: <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> References: <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> Message-ID: Hi, On Thu, Mar 4, 2021 at 2:42 PM alberto wrote: > > Hi I'm tring to write a program with python to evaluate data of csv data > In particular I would extract this information > > View data on the presence of men and women in Affori over time. > > * Carry out an analysis relating to the last available year. Of the 10 most populous neighborhoods show: > * the proportion of births out of the total > * the proportion of 80+ to the total > * The ratio of minors / number of kindergartens > > this is the file > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing > > How could fix it? What seems to be the problem? Thank you. > > regards > -- > https://mail.python.org/mailman/listinfo/python-list From PythonList at DancesWithMice.info Thu Mar 4 15:53:07 2021 From: PythonList at DancesWithMice.info (dn) Date: Fri, 5 Mar 2021 09:53:07 +1300 Subject: program python In-Reply-To: <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> References: <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> Message-ID: <2e557b65-8011-5d69-adf7-9c0c4923b44d@DancesWithMice.info> Hi, and welcome to the list. On 05/03/2021 09.36, alberto wrote: > Hi I'm tring to write a program with python to evaluate data of csv data > In particular I would extract this information > > View data on the presence of men and women in Affori over time. > > * Carry out an analysis relating to the last available year. Of the 10 most populous neighborhoods show: > * the proportion of births out of the total > * the proportion of 80+ to the total > * The ratio of minors / number of kindergartens > > this is the file > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing > > How could fix it? NB For security reasons, many will not follow this link/see the data-file! There are several libraries which can be import-ed into Python, which enable access to .csv-formatted files. The PSL (Python Standard Library) offers "csv ? CSV File Reading and Writing" (https://docs.python.org/3/library/csv.html). Start by writing the Python code to open the .csv file, and close it again (as you would at the end of the program). Leave plenty of blank/empty lines between the two, and use that space to continue with the next steps... There are three objectives. To start, assume that the file is open in front of you. How will you solve the first problem? Can you describe this in English (and/or your preferred language)? Write this as a Python comment. Next, can you translate the spoken-language into Python? Thereafter tackle problems two and three. We don't know your level of Python skill. So, let us know how you get-on, and come back with sample code, if you strike a problem at any step. -- Regards, =dn From pbryan at anode.ca Thu Mar 4 16:04:41 2021 From: pbryan at anode.ca (Paul Bryan) Date: Thu, 4 Mar 2021 21:04:41 +0000 Subject: program python In-Reply-To: <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> References: <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> Message-ID: <010d0177ff0e92d1-d27d0b37-c08b-42ba-b52c-0d70dff4ece7-000000@ca-central-1.amazonses.com> I don't see a Python program in that link. Are you asking how to extract data from a CSV? A good start will be to look into the csv.reader function and csv.DictReader class. Paul On Thu, 2021-03-04 at 12:36 -0800, alberto wrote: > Hi I'm tring to write a program with python to evaluate data of csv > data > In particular I would extract this information > > View data on the presence of men and women in Affori over time. > > * Carry out an analysis relating to the last available year. Of the > 10 most populous neighborhoods show: > * the proportion of births out of the total > * the proportion of 80+ to the total > * The ratio of minors / number of kindergartens > > this is the file > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing > > How could fix it? > > regards From tjreedy at udel.edu Thu Mar 4 16:28:22 2021 From: tjreedy at udel.edu (Terry Reedy) Date: Thu, 4 Mar 2021 16:28:22 -0500 Subject: Problem with printing statement when condition is false In-Reply-To: References: Message-ID: On 3/4/2021 3:15 PM, Terry Reedy wrote: > On 3/4/2021 12:10 PM, Quentin Bock wrote: > >> I won't paste the code into >> this because it's 164 lines so I will attach a file copy, > > The alternative to posting too much is to reduce your code to the > minimum needed to exhibit the behavior you want to change.? Doing so may > reveal to you the solution.? It will certainly make it easier for anyone > else to help you and will make any answer more useful to other readers. Quentin privately sent me 12 lines (which should have been posted here instead), which can be reduced to the following 4 that exhibit his bug. if a == b: print('correct') if a != b: print('incorrect') The bug is a != b will never be true when a == b and will not be tested when a != b. The fix is to use else. if a == b: print('correct') else: print('incorrect') This should not be reduced to a conditional expression since different code follows the print statements in the actual example. -- Terry Jan Reedy From voodoo.bender at gmail.com Thu Mar 4 17:35:57 2021 From: voodoo.bender at gmail.com (alberto) Date: Thu, 4 Mar 2021 14:35:57 -0800 (PST) Subject: program python In-Reply-To: References: <010d0177ff0e92d1-d27d0b37-c08b-42ba-b52c-0d70dff4ece7-000000@ca-central-1.amazonses.com> <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> Message-ID: <49446476-b80c-4daf-8f26-75f5ad1f03fan@googlegroups.com> Il giorno gioved? 4 marzo 2021 alle 22:04:57 UTC+1 Paul Bryan ha scritto: > I don't see a Python program in that link. > > Are you asking how to extract data from a CSV? > A good start will be to look into the csv.reader function and > csv.DictReader class. > > Paul > On Thu, 2021-03-04 at 12:36 -0800, alberto wrote: > > Hi I'm tring to write a program with python to evaluate data of csv > > data > > In particular I would extract this information > > > > View data on the presence of men and women in Affori over time. > > > > * Carry out an analysis relating to the last available year. Of the > > 10 most populous neighborhoods show: > > * the proportion of births out of the total > > * the proportion of 80+ to the total > > * The ratio of minors / number of kindergartens > > > > this is the file > > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing > > > > How could fix it? > > > > regards Hi, with this code import pandas as pd df = pd.read_csv('data.csv',usecols=['Uomini','Donne']) print(df) I extract two columns, but I would see 'Affori over time' regards From ikorot01 at gmail.com Thu Mar 4 17:51:11 2021 From: ikorot01 at gmail.com (Igor Korot) Date: Thu, 4 Mar 2021 16:51:11 -0600 Subject: program python In-Reply-To: <49446476-b80c-4daf-8f26-75f5ad1f03fan@googlegroups.com> References: <010d0177ff0e92d1-d27d0b37-c08b-42ba-b52c-0d70dff4ece7-000000@ca-central-1.amazonses.com> <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> <49446476-b80c-4daf-8f26-75f5ad1f03fan@googlegroups.com> Message-ID: Hi, On Thu, Mar 4, 2021 at 4:42 PM alberto wrote: > > Il giorno gioved? 4 marzo 2021 alle 22:04:57 UTC+1 Paul Bryan ha scritto: > > I don't see a Python program in that link. > > > > Are you asking how to extract data from a CSV? > > A good start will be to look into the csv.reader function and > > csv.DictReader class. > > > > Paul > > On Thu, 2021-03-04 at 12:36 -0800, alberto wrote: > > > Hi I'm tring to write a program with python to evaluate data of csv > > > data > > > In particular I would extract this information > > > > > > View data on the presence of men and women in Affori over time. > > > > > > * Carry out an analysis relating to the last available year. Of the > > > 10 most populous neighborhoods show: > > > * the proportion of births out of the total > > > * the proportion of 80+ to the total > > > * The ratio of minors / number of kindergartens > > > > > > this is the file > > > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing > > > > > > How could fix it? > > > > > > regards > > Hi, > with this code > import pandas as pd > df = pd.read_csv('data.csv',usecols=['Uomini','Donne']) > > print(df) > I extract two columns, but I would see 'Affori over time' And if you add this column to the list - what happens? Thank you. > > regards > -- > https://mail.python.org/mailman/listinfo/python-list From voodoo.bender at gmail.com Fri Mar 5 05:41:30 2021 From: voodoo.bender at gmail.com (alberto) Date: Fri, 5 Mar 2021 02:41:30 -0800 (PST) Subject: program python In-Reply-To: References: <010d0177ff0e92d1-d27d0b37-c08b-42ba-b52c-0d70dff4ece7-000000@ca-central-1.amazonses.com> <6c1d7a64-2894-4ec1-8407-b9266e611c78n@googlegroups.com> <49446476-b80c-4daf-8f26-75f5ad1f03fan@googlegroups.com> Message-ID: <22880229-e111-4628-82cf-4cc813ffca42n@googlegroups.com> Il giorno gioved? 4 marzo 2021 alle 23:51:39 UTC+1 Igor Korot ha scritto: > Hi, > On Thu, Mar 4, 2021 at 4:42 PM alberto wrote: > > > > Il giorno gioved? 4 marzo 2021 alle 22:04:57 UTC+1 Paul Bryan ha scritto: > > > I don't see a Python program in that link. > > > > > > Are you asking how to extract data from a CSV? > > > A good start will be to look into the csv.reader function and > > > csv.DictReader class. > > > > > > Paul > > > On Thu, 2021-03-04 at 12:36 -0800, alberto wrote: > > > > Hi I'm tring to write a program with python to evaluate data of csv > > > > data > > > > In particular I would extract this information > > > > > > > > View data on the presence of men and women in Affori over time. > > > > > > > > * Carry out an analysis relating to the last available year. Of the > > > > 10 most populous neighborhoods show: > > > > * the proportion of births out of the total > > > > * the proportion of 80+ to the total > > > > * The ratio of minors / number of kindergartens > > > > > > > > this is the file > > > > https://drive.google.com/file/d/1zKflvSpB-oDAqYscLsEgUhSnqL1XPdql/view?usp=sharing > > > > > > > > How could fix it? > > > > > > > > regards > > > > Hi, > > with this code > > import pandas as pd > > df = pd.read_csv('data.csv',usecols=['Uomini','Donne']) > > > > print(df) > > I extract two columns, but I would see 'Affori over time' > And if you add this column to the list - what happens? > Thank you. > > > > > regards > > -- > > https://mail.python.org/mailman/listinfo/python-list Hi, with pandas I obtain results! Now I would calculate ratio beetween columns of my csv import pandas as pd pd.set_option('display.max_rows', 500) df = pd.read_csv ('data_quartiere_2018.csv', usecols= ['Anno','Totale','Quartiere','Nati','80 e pi? soli','80 e pi?','Minori','Scuola_infanzia (numero)']) test = df.loc[df['Totale'] >= 31990, print (test) in particular I would calculate ratio beetween ('Nati'*100)/'Totale' when ['Totale'] >= 31990 How could fix it From tjreedy at udel.edu Thu Mar 4 22:13:24 2021 From: tjreedy at udel.edu (Terry Reedy) Date: Thu, 4 Mar 2021 22:13:24 -0500 Subject: Problem with printing statement when condition is false In-Reply-To: References: Message-ID: On 3/4/2021 4:28 PM, Terry Reedy wrote: > Quentin privately sent me 12 lines (which should have been posted here > instead), which can be reduced to the following 4 that exhibit his bug. > > if a == b: > ??? print('correct') > ??? if a != b: > ??????? print('incorrect') > > The bug is a != b will never be true when a == b and will not be tested > when a != b.? The fix is to use else. > > if a == b: > ??? print('correct') > else: > ??? print('incorrect') > > This should not be reduced to a conditional expression since different > code follows the print statements in the actual example. Quentin wrote me privately that this, applied to his code, solved his problem. -- Terry Jan Reedy From cs at cskk.id.au Fri Mar 5 20:02:51 2021 From: cs at cskk.id.au (Cameron Simpson) Date: Sat, 6 Mar 2021 12:02:51 +1100 Subject: Why assert is not a function? In-Reply-To: References: Message-ID: On 03Mar2021 16:50, Grant Edwards wrote: >On 2021-03-03, Chris Angelico wrote: >> On Thu, Mar 4, 2021 at 1:40 AM Grant Edwards wrote: >> >>> I thought the entire point of asser being a keyword was so that if you >>> disable asserts then they go away completely: the arguments aren't >>> even evaluated. >> >> It depends on what the point of "removing the assertions" is, but >> yes, that will indeed still evaluate the arguments. IMO the cost of >> running assertions isn't that high compared to the value of keeping >> them (which is why I never run -O), and the performance argument is >> a weak one compared to the much stronger value of having the actual >> failing expression available in the exception report. > >Good point. I had forgotten about having the expression available in >the exception output. That's definitly valuable. Did we all see the recently announced ycecream PyPI module? Very cool! See: https://github.com/salabim/ycecream Cheers, Cameron Simpson From qberz2005 at gmail.com Fri Mar 5 21:54:05 2021 From: qberz2005 at gmail.com (Quentin Bock) Date: Fri, 5 Mar 2021 21:54:05 -0500 Subject: trouble using pygame Message-ID: So, I recently downloaded the pygame module, this code is from a youtube tutorial by the way, I am following along the tutorial, the error involves the pygame.init() and also says this: import pygame # Initialize Pygame pygame.init() #create the screen screen = pygame.display.set_mode((800, 600)) # Game Loop running = True while running: for event in pygame.event.get(): if event.type == pygame.quit(): running = False The error says "partially initialized module 'pygame' has no attribute 'init' (most likely due to a circular import) If someone could also explain what a circular import is and how to avoid them within the future that would be great Thanks :) Here is a link to the tutorial as well just in case someone wants to see it: https://www.youtube.com/watch?v=FfWpgLFMI7w From python at mrabarnett.plus.com Fri Mar 5 23:28:35 2021 From: python at mrabarnett.plus.com (MRAB) Date: Sat, 6 Mar 2021 04:28:35 +0000 Subject: trouble using pygame In-Reply-To: References: Message-ID: <8009f770-6c9f-8841-cde8-fd66fc4a5b00@mrabarnett.plus.com> On 2021-03-06 02:54, Quentin Bock wrote: > So, I recently downloaded the pygame module, this code is from a youtube > tutorial by the way, I am following along the tutorial, the error involves > the pygame.init() and also says this: > > import pygame > > # Initialize Pygame > pygame.init() > > #create the screen > screen = pygame.display.set_mode((800, 600)) > > # Game Loop > running = True > while running: > for event in pygame.event.get(): > if event.type == pygame.quit(): > running = False > > The error says "partially initialized module 'pygame' has no attribute > 'init' (most likely due to a circular import) > > If someone could also explain what a circular import is and how to > avoid them within the future that would be great > > Thanks :) > > Here is a link to the tutorial as well just in case someone wants to see it: > > https://www.youtube.com/watch?v=FfWpgLFMI7w > A circular import is when a module tries to import itself directly or indirectly. (A imports A; A imports B, which imports A; A imports B, which imports C, which imports A; you get the idea!) What did you call your script? Did you perhaps call it "pygame"? From frank at chagford.com Sat Mar 6 01:21:47 2021 From: frank at chagford.com (Frank Millman) Date: Sat, 6 Mar 2021 08:21:47 +0200 Subject: Question about generators Message-ID: Hi all This is purely academic, but I would like to understand the following - >>> >>> a = [('x', 'y')] >>> >>> s = [] >>> for b, c in a: ... s.append((b, c)) ... >>> s [('x', 'y')] This is what I expected. >>> >>> s = [] >>> s.append(((b, c) for b, c in a)) >>> s [ at 0x0000019FC3F863C0>] >>> I expected the same as the first one. I understand the concept that a generator does not return a value until you call next() on it, but I have not grasped the essential difference between the above two constructions. TIA for any insights. Frank Millman From alan at csail.mit.edu Sat Mar 6 01:36:44 2021 From: alan at csail.mit.edu (Alan Bawden) Date: Sat, 06 Mar 2021 01:36:44 -0500 Subject: Question about generators References: Message-ID: <86pn0ciy9v.fsf@williamsburg.bawden.org> >>> >>> s = [] >>> s.append(((b, c) for b, c in a)) >>> s [ at 0x0000019FC3F863C0>] >>> TIA for any insights. Replace "append" above with "extend" and observe the results. Then ponder the difference between append and extend. I suspect that the heart of your confusion actually has nothing to do with generators. -- Alan Bawden From ming at pgp.cool Sat Mar 6 02:26:06 2021 From: ming at pgp.cool (Ming) Date: Sat, 6 Mar 2021 15:26:06 +0800 Subject: Question about generators In-Reply-To: References: Message-ID: <20210306072605.GA15@pgp.cool> On Sat, Mar 06, 2021 at 08:21:47AM +0200, Frank Millman wrote: > [...] > I understand the concept that a generator does not return a value until you > call next() on it, but I have not grasped the essential difference between > the above two constructions. > > TIA for any insights. > > Frank Millman In your first example, a certain element is appended to s each time in the loop. But in your second example, the generator first traverses all the elements, and then generates an iterable object, you are trying to append this object to s. Let's look at a simpler but more certain example: a = [1, 2, 3] s = [] for n in a: s.append(n) # Result: # len(s) == 3 # s == [1, 2, 3] a = [1, 2, 3] s = [] g = (n for n in a) s.append(g) # Result: # len(s) == 1 # list(s[0]) == [1, 2, 3] If you want to get the same result in the above two cases, just replace append with extend. list.extend() can accept an iterable object as input, and then append all the elements to the original list. -- OpenPGP fingerprint: 3C47 5977 4819 267E DD64 C7E4 6332 5675 A739 C74E -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From frank at chagford.com Sat Mar 6 02:54:10 2021 From: frank at chagford.com (Frank Millman) Date: Sat, 6 Mar 2021 09:54:10 +0200 Subject: Question about generators In-Reply-To: References: Message-ID: <2c7ce16a-66e1-0abb-5f87-71d3aa9939db@chagford.com> On 2021-03-06 8:21 AM, Frank Millman wrote: > Hi all > > This is purely academic, but I would like to understand the following - > > >>> > >>> a = [('x', 'y')] > >>> > >>> s = [] > >>> for b, c in a: > ...?? s.append((b, c)) > ... > >>> s > [('x', 'y')] > > > This is what I expected. > > >>> > >>> s = [] > >>> s.append(((b, c) for b, c in a)) > >>> s > [ at 0x0000019FC3F863C0>] > >>> > > I expected the same as the first one. > > I understand the concept that a generator does not return a value until > you call next() on it, but I have not grasped the essential difference > between the above two constructions. > > Thanks, Alan and Ming. I think I have got it now. In my first example, a 'for' loop both creates an iterable object *and* iterates over it. In my second example, a generator expression creates an iterable object, but does nothing with it until asked. Changing 'append' to 'extend' has the effect of iterating over the generator expression and appending the results. Frank From frank at chagford.com Sat Mar 6 02:54:10 2021 From: frank at chagford.com (Frank Millman) Date: Sat, 6 Mar 2021 09:54:10 +0200 Subject: Question about generators In-Reply-To: References: Message-ID: <2c7ce16a-66e1-0abb-5f87-71d3aa9939db@chagford.com> On 2021-03-06 8:21 AM, Frank Millman wrote: > Hi all > > This is purely academic, but I would like to understand the following - > > >>> > >>> a = [('x', 'y')] > >>> > >>> s = [] > >>> for b, c in a: > ...?? s.append((b, c)) > ... > >>> s > [('x', 'y')] > > > This is what I expected. > > >>> > >>> s = [] > >>> s.append(((b, c) for b, c in a)) > >>> s > [ at 0x0000019FC3F863C0>] > >>> > > I expected the same as the first one. > > I understand the concept that a generator does not return a value until > you call next() on it, but I have not grasped the essential difference > between the above two constructions. > > Thanks, Alan and Ming. I think I have got it now. In my first example, a 'for' loop both creates an iterable object *and* iterates over it. In my second example, a generator expression creates an iterable object, but does nothing with it until asked. Changing 'append' to 'extend' has the effect of iterating over the generator expression and appending the results. Frank From ml_news at posteo.de Sat Mar 6 06:00:33 2021 From: ml_news at posteo.de (Manfred Lotz) Date: Sat, 6 Mar 2021 12:00:33 +0100 Subject: Choosable dependency Message-ID: <20210306120033.0fd573e1@arcor.com> Let us say I have a package which reads a TOML file. I want to give the user of my package the choice to decide if he wants to use the toml, tomlkit or rtoml package. So, in case the user chose to use rtoml then there should be an import only for rtoml, aso. How could I achieve this? -- Thanks, Manfred From ml_news at posteo.de Sat Mar 6 06:43:32 2021 From: ml_news at posteo.de (Manfred Lotz) Date: Sat, 6 Mar 2021 12:43:32 +0100 Subject: Choosable dependency References: <20210306120033.0fd573e1@arcor.com> Message-ID: <20210306124332.12a4b675@arcor.com> On Sat, 6 Mar 2021 12:00:33 +0100 Manfred Lotz wrote: > Let us say I have a package which reads a TOML file. > > I want to give the user of my package the choice to decide if he wants > to use the toml, tomlkit or rtoml package. > > So, in case the user chose to use rtoml then there should be an import > only for rtoml, aso. > > How could I achieve this? > I got the following minimal example working but presumably my solution isn't the best way. xtoml.py: class Xtoml: def __init__(self, which='rtoml'): self.which = which def parse_toml(self, toml_string): if self.which == 'rtoml': import rtoml as toml elif self.which == 'tomlkit': import tomlkit as toml else: import toml return toml.loads(toml_string) test_xtoml.py: from xtoml import Xtoml toml_string = """ [default] basedir = "/myproject" """ def main(): xtoml = Xtoml('toml') parsed_toml = xtoml.parse_toml(toml_string) print(parsed_toml) xtoml = Xtoml() parsed_toml = xtoml.parse_toml(toml_string) print(parsed_toml) if __name__ == "__main__": main() From __peter__ at web.de Sat Mar 6 08:06:27 2021 From: __peter__ at web.de (Peter Otten) Date: Sat, 6 Mar 2021 14:06:27 +0100 Subject: Choosable dependency In-Reply-To: <20210306124332.12a4b675@arcor.com> References: <20210306120033.0fd573e1@arcor.com> <20210306124332.12a4b675@arcor.com> Message-ID: <437f7470-a8b8-7400-c437-a101406a14d9@web.de> On 06/03/2021 12:43, Manfred Lotz wrote: > On Sat, 6 Mar 2021 12:00:33 +0100 > Manfred Lotz wrote: > >> Let us say I have a package which reads a TOML file. >> >> I want to give the user of my package the choice to decide if he wants >> to use the toml, tomlkit or rtoml package. >> >> So, in case the user chose to use rtoml then there should be an import >> only for rtoml, aso. >> >> How could I achieve this? >> > > I got the following minimal example working but presumably my solution > isn't the best way. > > xtoml.py: > > class Xtoml: > def __init__(self, which='rtoml'): > self.which = which > > def parse_toml(self, toml_string): > if self.which == 'rtoml': > import rtoml as toml > elif self.which == 'tomlkit': > import tomlkit as toml > else: > import toml > > return toml.loads(toml_string) > > > test_xtoml.py: > > from xtoml import Xtoml > > toml_string = """ > [default] > > basedir = "/myproject" > > """ > > def main(): > xtoml = Xtoml('toml') > parsed_toml = xtoml.parse_toml(toml_string) > print(parsed_toml) > > xtoml = Xtoml() > parsed_toml = xtoml.parse_toml(toml_string) > print(parsed_toml) > > if __name__ == "__main__": > main() As long as you use a common subset of the functions provided by the packages you can just do def main(): global toml # if you want to use the toml package elsewhere # in your module chosen_toml = ... # get package name toml = importlib.import_module(chosen_toml) data = toml.loads(toml_string) However, the user usually doesn't care, so I would recommend that you be bold and pick the package you prefer ;) From __peter__ at web.de Sat Mar 6 08:06:27 2021 From: __peter__ at web.de (Peter Otten) Date: Sat, 6 Mar 2021 14:06:27 +0100 Subject: Choosable dependency In-Reply-To: <20210306124332.12a4b675@arcor.com> References: <20210306120033.0fd573e1@arcor.com> <20210306124332.12a4b675@arcor.com> Message-ID: <437f7470-a8b8-7400-c437-a101406a14d9@web.de> On 06/03/2021 12:43, Manfred Lotz wrote: > On Sat, 6 Mar 2021 12:00:33 +0100 > Manfred Lotz wrote: > >> Let us say I have a package which reads a TOML file. >> >> I want to give the user of my package the choice to decide if he wants >> to use the toml, tomlkit or rtoml package. >> >> So, in case the user chose to use rtoml then there should be an import >> only for rtoml, aso. >> >> How could I achieve this? >> > > I got the following minimal example working but presumably my solution > isn't the best way. > > xtoml.py: > > class Xtoml: > def __init__(self, which='rtoml'): > self.which = which > > def parse_toml(self, toml_string): > if self.which == 'rtoml': > import rtoml as toml > elif self.which == 'tomlkit': > import tomlkit as toml > else: > import toml > > return toml.loads(toml_string) > > > test_xtoml.py: > > from xtoml import Xtoml > > toml_string = """ > [default] > > basedir = "/myproject" > > """ > > def main(): > xtoml = Xtoml('toml') > parsed_toml = xtoml.parse_toml(toml_string) > print(parsed_toml) > > xtoml = Xtoml() > parsed_toml = xtoml.parse_toml(toml_string) > print(parsed_toml) > > if __name__ == "__main__": > main() As long as you use a common subset of the functions provided by the packages you can just do def main(): global toml # if you want to use the toml package elsewhere # in your module chosen_toml = ... # get package name toml = importlib.import_module(chosen_toml) data = toml.loads(toml_string) However, the user usually doesn't care, so I would recommend that you be bold and pick the package you prefer ;) From Bonita.Montero at gmail.com Sat Mar 6 09:52:57 2021 From: Bonita.Montero at gmail.com (Bonita Montero) Date: Sat, 6 Mar 2021 15:52:57 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: References: Message-ID: > It hasn't been formally released yet as it still requires more extensive > testing. It will be used as part of my universal compiler, neos, that > can compile any programming language ... You will get the same room in the same psychiatric ward like Amine Moulay Ramdane. From ml_news at posteo.de Sat Mar 6 09:06:53 2021 From: ml_news at posteo.de (Manfred Lotz) Date: Sat, 6 Mar 2021 15:06:53 +0100 Subject: Choosable dependency References: <20210306120033.0fd573e1@arcor.com> <20210306124332.12a4b675@arcor.com> <437f7470-a8b8-7400-c437-a101406a14d9@web.de> Message-ID: <20210306150653.37ba10ba@arcor.com> On Sat, 6 Mar 2021 14:06:27 +0100 Peter Otten <__peter__ at web.de> wrote: > On 06/03/2021 12:43, Manfred Lotz wrote: > > On Sat, 6 Mar 2021 12:00:33 +0100 > > Manfred Lotz wrote: > > > >> Let us say I have a package which reads a TOML file. > >> > >> I want to give the user of my package the choice to decide if he > >> wants to use the toml, tomlkit or rtoml package. > >> > >> So, in case the user chose to use rtoml then there should be an > >> import only for rtoml, aso. > >> > >> How could I achieve this? > >> > > > > I got the following minimal example working but presumably my > > solution isn't the best way. > > > > xtoml.py: > > > > class Xtoml: > > def __init__(self, which='rtoml'): > > self.which = which > > > > def parse_toml(self, toml_string): > > if self.which == 'rtoml': > > import rtoml as toml > > elif self.which == 'tomlkit': > > import tomlkit as toml > > else: > > import toml > > > > return toml.loads(toml_string) > > > > > > test_xtoml.py: > > > > from xtoml import Xtoml > > > > toml_string = """ > > [default] > > > > basedir = "/myproject" > > > > """ > > > > def main(): > > xtoml = Xtoml('toml') > > parsed_toml = xtoml.parse_toml(toml_string) > > print(parsed_toml) > > > > xtoml = Xtoml() > > parsed_toml = xtoml.parse_toml(toml_string) > > print(parsed_toml) > > > > if __name__ == "__main__": > > main() > > As long as you use a common subset of the functions provided by the > packages you can just do > Yes, this is a prereq. Otherwise, it wouldn't make sense to do this. > def main(): > global toml # if you want to use the toml package elsewhere > # in your module > > chosen_toml = ... # get package name > toml = importlib.import_module(chosen_toml) > > data = toml.loads(toml_string) > > However, the user usually doesn't care, so I would recommend that you > be bold and pick the package you prefer ;) > Exactly. This is why there is a default. Using your suggestion my minimal example now looks like follows xtoml.py: import importlib class Xtoml: def __init__(self, which='rtoml'): self.toml = importlib.import_module(which) def parse_toml(self, toml_string): return self.toml.loads(toml_string) No change in test_xtoml.py. Thanks a lot for your help. -- Manfred From Bonita.Montero at gmail.com Sat Mar 6 12:49:41 2021 From: Bonita.Montero at gmail.com (Bonita Montero) Date: Sat, 6 Mar 2021 18:49:41 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: <82O0I.152099$cEz2.58349@fx43.ams4> References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: > Whilst you need to read the following: > * https://en.wikipedia.org/wiki/Psychological_projection > * https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect There is no projection. _You_ have megalomania, not me. And there's also no Dunning Kruger effect. You can't assess your capabilites, not me. From rosuav at gmail.com Sat Mar 6 12:52:41 2021 From: rosuav at gmail.com (Chris Angelico) Date: Sun, 7 Mar 2021 04:52:41 +1100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: On Sun, Mar 7, 2021 at 4:51 AM Bonita Montero wrote: > > > Whilst you need to read the following: > > * https://en.wikipedia.org/wiki/Psychological_projection > > * https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect > > There is no projection. > _You_ have megalomania, not me. > And there's also no Dunning Kruger effect. > You can't assess your capabilites, not me. Ignore this guy. He produces nothing, insults everyone, and just gets himself banned from places. He is nothing more than a troll and a waste of everyone's time. His posts do not reach the mailing list, only your replies do. ChrisA From Bonita.Montero at gmail.com Sat Mar 6 14:11:39 2021 From: Bonita.Montero at gmail.com (Bonita Montero) Date: Sat, 6 Mar 2021 20:11:39 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: >> There is no projection. >> _You_ have megalomania, not me. >> And there's also no Dunning Kruger effect. >> You can't assess your capabilites, not me. > no u Someone who says that he is capable of writing a compiler that translates every language has megalomania. No one can do this. From chris.m.thomasson.1 at gmail.com Sat Mar 6 16:16:24 2021 From: chris.m.thomasson.1 at gmail.com (Chris M. Thomasson) Date: Sat, 6 Mar 2021 13:16:24 -0800 Subject: neonumeric - C++ arbitrary precision arithmetic library References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> Message-ID: On 3/6/2021 11:35 AM, Mr Flibble wrote: > On 06/03/2021 19:11, Bonita Montero wrote: >>>> There is no projection. >>>> _You_ have megalomania, not me. >>>> And there's also no Dunning Kruger effect. >>>> You can't assess your capabilites, not me. >> >>> no u >> >> Someone who says that he is capable of writing a compiler that >> translates every language has megalomania. No one can do this. > > Just because you can't make one it doesn't follow that nobody else can. I remember when Bonita tried to convince me that a mutex must use an atomic counter. From ben.usenet at bsb.me.uk Sat Mar 6 16:24:19 2021 From: ben.usenet at bsb.me.uk (Ben Bacarisse) Date: Sat, 06 Mar 2021 21:24:19 +0000 Subject: neonumeric - C++ arbitrary precision arithmetic library References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> Message-ID: <87sg58c6ws.fsf@bsb.me.uk> Mr Flibble writes: >> Someone who says that he is capable of writing a compiler that >> translates every language has megalomania. No one can do this. > > Just because you can't make one it doesn't follow that nobody else > can. True, but lots of very knowledgeable people have tried and failed. And although you use the present tense "my universal compiler, neos, that /can/ compile any programming language" (emphasis mine) you currently have nothing to show -- no compiler for any language, no paper outlining how you plan to overcome the problems that stumped others, nothing but what appears to be a false claim about neos can do. If you want this project to be taken seriously, you are going about it the wrong way. -- Ben. From avigross at verizon.net Sat Mar 6 16:52:25 2021 From: avigross at verizon.net (Avi Gross) Date: Sat, 6 Mar 2021 16:52:25 -0500 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: <07b701d712d2$feee6f30$fccb4d90$@verizon.net> Just to be clear, and luckily the person who posed such boasts is luckily gone and I AM NOT interested in having the discussion again here, I have a point to make. He did not suggest a magical compiler that could translate any language. Not exactly. I think he suggested that if all languages share a large set of paradigms related to what methods we have for computing, then there may be a way to capture and store some description of any new language that defines it well enough. He proposed a sort of universal program, indeed, that would read the description files and then actual programs and generate something that ultimately would be runnable. Of course, he basically ignored any little details along the way and even insisted it would be easy and the result would be much more efficient in every case. So, I suggest he is not as bright as he thinks. I, on the other hand, think it is a hard problem but in some abstract sense doable given infinite resources and time. Translation, not a worthwhile quest for NOW. There are accepted theorems that suggests a fairly simple Turing Machine can solve any problem computable on our current (non-quantum) generation of computers. The programs would be very far from efficient and in some cases would require an infinitely long tape and more states than our universe can accommodate. But in principle, it can do anything as stated above. So, any program in any language can theoretically be rewritten as a Turing Machine version. But that would not be done by a universal translator. I assume you could do it from say a compiled machine language version for some languages but it would require access to anything modern programs get from all kinds of libraries out there that extend the program and if it spawns other processes or has things run in parallel it gets more and more complex. But why do it at all? Sure, translating parts of some programs in one language to another can make sense. But why a goal to have a sort of Unified Programming Language Theory other than as an academic exercise? Having said that, I keep looking at how languages like Python and R grow and how they keep adding features including many borrowed or imitated from elsewhere and I conclude you can just put everything imaginable into Python and the rest become superfluous! Problem solved. -----Original Message----- From: Python-list On Behalf Of Bonita Montero Sent: Saturday, March 6, 2021 2:12 PM To: python-list at python.org Subject: Re: neonumeric - C++ arbitrary precision arithmetic library >> There is no projection. >> _You_ have megalomania, not me. >> And there's also no Dunning Kruger effect. >> You can't assess your capabilites, not me. > no u Someone who says that he is capable of writing a compiler that translates every language has megalomania. No one can do this. -- https://mail.python.org/mailman/listinfo/python-list From chris.m.thomasson.1 at gmail.com Sat Mar 6 17:13:26 2021 From: chris.m.thomasson.1 at gmail.com (Chris M. Thomasson) Date: Sat, 6 Mar 2021 14:13:26 -0800 Subject: neonumeric - C++ arbitrary precision arithmetic library References: Message-ID: On 3/5/2021 8:51 AM, Mr Flibble wrote: > neonumeric - C++ arbitrary precision arithmetic library with arbitrary > precision integers, floats and rationals: > > https://github.com/i42output/neonumeric > > It hasn't been formally released yet as it still requires more extensive > testing.? It will be used as part of my universal compiler, neos, that > can compile any programming language and will be used for the neos > implementation of Python (Python has big integers). > > Message ends. Get atan2, cos and sin, and I have some code to run it against. https://github.com/ChrisMThomasson/fractal_cipher/blob/master/RIFC/cpp/ct_rifc_sample.cpp It needs arbitrary precision! :^) From mirkok.lists at googlemail.com Sat Mar 6 17:41:10 2021 From: mirkok.lists at googlemail.com (Mirko) Date: Sat, 6 Mar 2021 23:41:10 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: <87sg58c6ws.fsf@bsb.me.uk> References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> <87sg58c6ws.fsf@bsb.me.uk> Message-ID: <60440506.2020004@googlemail.com> Am 06.03.2021 um 22:24 schrieb Ben Bacarisse: > Mr Flibble writes: > >>> Someone who says that he is capable of writing a compiler that >>> translates every language has megalomania. No one can do this. >> >> Just because you can't make one it doesn't follow that nobody else >> can. > > True, but lots of very knowledgeable people have tried and failed. I even wonder why they have tried. Writing a universal compiler/interpreter sounds logically impossible to me, Here's a simple Python expression: >>> 3+3*5 18 And here's the same expression in (GNU) Smalltalk: st> 3+3*5 30 How would such a universal compiler know which evaluation strategy to follow, if not by writing a parser end evaluator for every supported language? And if it's hard for this simple problem, how about more complex cases. From rosuav at gmail.com Sat Mar 6 17:52:24 2021 From: rosuav at gmail.com (Chris Angelico) Date: Sun, 7 Mar 2021 09:52:24 +1100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: <60440506.2020004@googlemail.com> References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> <87sg58c6ws.fsf@bsb.me.uk> <60440506.2020004@googlemail.com> Message-ID: On Sun, Mar 7, 2021 at 9:42 AM Mirko via Python-list wrote: > I even wonder why they have tried. Writing a universal > compiler/interpreter sounds logically impossible to me, Here's a > simple Python expression: > > >>> 3+3*5 > 18 > > And here's the same expression in (GNU) Smalltalk: > > st> 3+3*5 > 30 > > > How would such a universal compiler know which evaluation strategy > to follow, if not by writing a parser end evaluator for every > supported language? And if it's hard for this simple problem, how > about more complex cases. There are two ways in which "universal compiler/interpreter" can definitely make sense, but neither of them is what he's trying to do. 1) A bytecode or machine code that all other languages can be compiled to. For example, I'm running an amd64 CPU, so on this computer, everything ultimately gets executed as amd64 bytecode. It's also possible to have higher level bytecodes, or even textual languages (Asm.js can be used as a compilation target). 2) "Compiler compilers" and grammar parsers. These are an excellent tool for people designing programming language compilers, as they make it a lot easier to describe the syntax and semantics for the language. Both of them are tools that programming language developers use. They don't replace language interpreters any more than a JSON parser replaces the need to open files. ChrisA From svshahbrd at gmail.com Sat Mar 6 21:46:34 2021 From: svshahbrd at gmail.com (sarang shah) Date: Sat, 6 Mar 2021 18:46:34 -0800 (PST) Subject: Apriori Algorithm Message-ID: <35e2ca81-f3c8-41ba-ae50-1f53ff1904adn@googlegroups.com> I want to make apriori algorithm from start. Anybody have any reference file? From qberz2005 at gmail.com Sat Mar 6 22:01:57 2021 From: qberz2005 at gmail.com (Quentin Bock) Date: Sat, 6 Mar 2021 22:01:57 -0500 Subject: pygame errors Message-ID: #Space Invaders! #Title and Icon pygame.display.set_caption("Space Invaders") icon = pygame.image.load('space-invaders.png') pygame.display.set_icon(icon) #Player player_Image = pygame.image.load('player.png') player_X = 370 player_Y = 480 def player(): screen.blit(player_Image, player_X, player_Y) #Game Loop pygame.init() screen = pygame.display.set_mode((800, 600)) running = True while running: screen.fill((128, 128, 128)) for event in pygame.event.get(): if event.type == pygame.QUIT: running = False player() pygame.display.update() The window will not display the icon, saying, "invalid destination for blit" Is this an indentation error? I don't understand why this position would be invalid. link to tutorial I'm following: https://www.youtube.com/watch?v=FfWpgLFMI7w From python at mrabarnett.plus.com Sat Mar 6 22:47:41 2021 From: python at mrabarnett.plus.com (MRAB) Date: Sun, 7 Mar 2021 03:47:41 +0000 Subject: pygame errors In-Reply-To: References: Message-ID: On 2021-03-07 03:01, Quentin Bock wrote: > #Space Invaders! > #Title and Icon > pygame.display.set_caption("Space Invaders") > icon = pygame.image.load('space-invaders.png') > pygame.display.set_icon(icon) > #Player > player_Image = pygame.image.load('player.png') > player_X = 370 > player_Y = 480 > > def player(): > screen.blit(player_Image, player_X, player_Y) > The position should be given as a 2-tuple, not as 2 separate parameters. The line should be: screen.blit(player_Image, (player_X, player_Y)) > > #Game Loop > pygame.init() > screen = pygame.display.set_mode((800, 600)) > running = True > while running: > > screen.fill((128, 128, 128)) > > for event in pygame.event.get(): > if event.type == pygame.QUIT: > running = False > player() > pygame.display.update() > > The window will not display the icon, saying, "invalid destination for blit" > > Is this an indentation error? I don't understand why this position > would be invalid. > > link to tutorial I'm following: > > https://www.youtube.com/watch?v=FfWpgLFMI7w > From avigross at verizon.net Sat Mar 6 22:48:57 2021 From: avigross at verizon.net (Avi Gross) Date: Sat, 6 Mar 2021 22:48:57 -0500 Subject: Apriori Algorithm In-Reply-To: <35e2ca81-f3c8-41ba-ae50-1f53ff1904adn@googlegroups.com> References: <35e2ca81-f3c8-41ba-ae50-1f53ff1904adn@googlegroups.com> Message-ID: <0c6f01d71304$cd7edfc0$687c9f40$@verizon.net> "I want to make apriori algorithm from start. Anybody have any reference file?" Excellent question. Based on everything you shared, I think all I can offer is that whatever you do, do not make the aposteriori version. Or, you could consider asking a real question with enough detail that maybe someone understanding it will give you a hint in advance. -----Original Message----- From: Python-list On Behalf Of sarang shah Sent: Saturday, March 6, 2021 9:47 PM To: python-list at python.org Subject: Apriori Algorithm I want to make apriori algorithm from start. Anybody have any reference file? -- https://mail.python.org/mailman/listinfo/python-list From pbryan at anode.ca Sat Mar 6 23:05:54 2021 From: pbryan at anode.ca (Paul Bryan) Date: Sun, 7 Mar 2021 04:05:54 +0000 Subject: Apriori Algorithm In-Reply-To: <35e2ca81-f3c8-41ba-ae50-1f53ff1904adn@googlegroups.com> References: <35e2ca81-f3c8-41ba-ae50-1f53ff1904adn@googlegroups.com> Message-ID: <010d01780adcf00c-3adab0f4-3c71-4de9-8d57-0197343f3b9a-000000@ca-central-1.amazonses.com> Google tells me this: https://github.com/tommyod/Efficient-Apriori On Sat, 2021-03-06 at 18:46 -0800, sarang shah wrote: > I want to make apriori algorithm from start. Anybody have any > reference file? From svshahbrd at gmail.com Sun Mar 7 02:56:42 2021 From: svshahbrd at gmail.com (sarang shah) Date: Sat, 6 Mar 2021 23:56:42 -0800 (PST) Subject: Apriori Algorithm Message-ID: <1aabc84a-f00e-4c4c-bd81-7c902d2283f2n@googlegroups.com> I have this dataset in a text file I need to make an apriori algorithm based on it. Please help. 25 52 164 240 274 328 368 448 538 561 630 687 730 775 825 834 39 120 124 205 401 581 704 814 825 834 35 249 674 712 733 759 854 950 39 422 449 704 825 857 895 937 954 964 15 229 262 283 294 352 381 708 738 766 853 883 966 978 26 104 143 320 569 620 798 7 185 214 350 529 658 682 782 809 849 883 947 970 979 227 390 71 192 208 272 279 280 300 333 496 529 530 597 618 674 675 720 855 914 932 183 193 217 256 276 277 374 474 483 496 512 529 626 653 706 878 939 161 175 177 424 490 571 597 623 766 795 853 910 960 125 130 327 698 699 839 392 461 569 801 862 27 78 104 177 733 775 781 845 900 921 938 101 147 229 350 411 461 572 579 657 675 778 803 842 903 71 208 217 266 279 290 458 478 523 614 766 853 888 944 969 43 70 176 204 227 334 369 480 513 703 708 835 874 895 25 52 278 730 151 432 504 830 890 From PythonList at DancesWithMice.info Sun Mar 7 03:09:01 2021 From: PythonList at DancesWithMice.info (dn) Date: Sun, 7 Mar 2021 21:09:01 +1300 Subject: Apriori Algorithm In-Reply-To: <1aabc84a-f00e-4c4c-bd81-7c902d2283f2n@googlegroups.com> References: <1aabc84a-f00e-4c4c-bd81-7c902d2283f2n@googlegroups.com> Message-ID: <923f9f08-32a7-feb9-cf96-aa1e68401fd6@DancesWithMice.info> On 07/03/2021 20.56, sarang shah wrote: > I have this dataset in a text file I need to make an apriori algorithm based on it. Please help. > > 25 52 164 240 274 328 368 448 538 561 630 687 730 775 825 834 > 39 120 124 205 401 581 704 814 825 834 > 35 249 674 712 733 759 854 950 > 39 422 449 704 825 857 895 937 954 964 > 15 229 262 283 294 352 381 708 738 766 853 883 966 978 > 26 104 143 320 569 620 798 > 7 185 214 350 529 658 682 782 809 849 883 947 970 979 > 227 390 > 71 192 208 272 279 280 300 333 496 529 530 597 618 674 675 720 855 914 932 > 183 193 217 256 276 277 374 474 483 496 512 529 626 653 706 878 939 > 161 175 177 424 490 571 597 623 766 795 853 910 960 > 125 130 327 698 699 839 > 392 461 569 801 862 > 27 78 104 177 733 775 781 845 900 921 938 > 101 147 229 350 411 461 572 579 657 675 778 803 842 903 > 71 208 217 266 279 290 458 478 523 614 766 853 888 944 969 > 43 70 176 204 227 334 369 480 513 703 708 835 874 895 > 25 52 278 730 > 151 432 504 830 890 Great! For what purpose - is this a 'homework assignment'? What code do you have so far? -- Regards, =dn From real-not-anti-spam-address at apple-juice.co.uk Sun Mar 7 05:19:34 2021 From: real-not-anti-spam-address at apple-juice.co.uk (D.M. Procida) Date: Sun, 7 Mar 2021 10:19:34 +0000 Subject: A 35mm film camera represented in Python object Message-ID: <1p5o1as.ard2i1w91fiN%real-not-anti-spam-address@apple-juice.co.uk> Hi everyone, I've created - a representation of a Canonet G-III QL17 in Python. There's also documentation: . It's a pure Python model of the physical sub-systems of a camera and their interactions. So far it's at a fairly high level - I haven't yet got down to the level of individual springs and levers yet. I spend quite a bit of my time repairing old cameras. To me they feel like computer programs encoded into physical objects, and figuring out how a mechanism works feels like working out how code works (but more fun). The Canonet G-III QL17 is one of my favourites. One of my reasons for writing this code is to appreciate the intricate mechanical logic embodied in the machine. You can do things like advance the film, release the shutter, meter the scene with the built-in light meter (if the camera has a battery of course) and even spoil your film if you make the mistake of opening the back in daylight. >>> from camera import Camera >>> c = Camera() >>> c.state() ================== Camera state ================= ------------------ Controls --------------------- Selected speed: 1/120 ------------------ Mechanical ------------------- Back closed: True Lens cap on: False Film advance mechanism: False Frame counter: 0 Shutter cocked: False Shutter timer: 1/128 seconds Iris aperture: ?/16 Camera exposure settings: 15.0 EV ------------------ Metering --------------------- Light meter reading: 4096 cd/m^2 Exposure target: 15.0 EV Mode: Shutter priority Battery: 1.44 V Film speed: 100 ISO ------------------ Film ------------------------- Speed: 100 ISO Rewound into cartridge: False Exposed frames: 0 (of 24) Ruined: False ------------------ Environment ------------------ Scene luminosity: 4096 cd/m^2 >>> c.film_advance_mechanism.advance() Cocking shutter Cocked >>> c.shutter.trip() Shutter opens Shutter closes Shutter opened for 1/128 seconds Shutter uncocked You can't do impossible things: >>> c.shutter_speed = 1/33 Traceback (most recent call last): File "", line 1, in File "/Users/daniele/Repositories/camera/camera.py", line 29, in shutter_speed raise self.NonExistentShutterSpeed(f"Possible shutter speeds are {possible_settings}") camera.NonExistentShutterSpeed: Possible shutter speeds are 1/4, 1/8, 1/15, 1/30, 1/60, 1/120, 1/240, 1/500 But you can also do things that you shouldn't do, like opening the back of the camera in daylight with a partially-exposed roll of film inside - which will spoil the film:: >>> c.back.open() Opening back Resetting frame counter to 0 'Film is ruined' I hope this interesting to someone. Daniele From boblatest at yahoo.com Sun Mar 7 05:21:14 2021 From: boblatest at yahoo.com (Robert Latest) Date: 7 Mar 2021 10:21:14 GMT Subject: How to implement logging for an imported module? Message-ID: Hello, I'm trying to add logging to a module that gets imported by another module. But I only get it to work right if the imported module knows the name of the importing module. The example given in the "Logging Cookbook" also rely on this fact. https://docs.python.org/3/howto/logging-cookbook.html#logging-cookbook I couldn't find any information on how to implement logging in a library that doesn't know the name of the application that uses it. How is that done? Here's some example code consisting of the main module foo.py and imported modules bar.py and baz.py ### foo.py import logging import bar, baz formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s') ch = logging.StreamHandler() ch.setFormatter(formatter) logger = logging.getLogger('foo') logger.addHandler(ch) logger.setLevel(logging.DEBUG) logger.debug('debug from <%s>', __name__) logger.info('info from <%s>', __name__) logger.warning('warning from <%s>', __name__) logger.error('error from <%s>', __name__) bar.func() baz.func() ### bar.py '''This "generic" approach doesn't honor loglevel or formats when imported by another module''' import logging l = logging.getLogger(__name__) def func(): l.debug('debug from <%s>', __name__) l.info('info from <%s>', __name__) l.warning('warning from <%s>', __name__) l.error('error from <%s>', __name__) ### baz.py '''This only works if the importing module is named 'foo', which precludes its use as a library module''' import logging l = logging.getLogger('foo.baz') def func(): l.debug('debug from <%s>', __name__) l.info('info from <%s>', __name__) l.warning('warning from <%s>', __name__) l.error('error from <%s>', __name__) From pjfarley3 at earthlink.net Sun Mar 7 02:16:46 2021 From: pjfarley3 at earthlink.net (pjfarley3 at earthlink.net) Date: Sun, 7 Mar 2021 02:16:46 -0500 Subject: python curses constant names for mouse wheel movements? Message-ID: <000001d71321$d5aaad60$81000820$@earthlink.net> I have a python curses project trying to detect mouse wheel movements, and I understand that mouse wheel events by convention are reported as BUTTON4 and BUTTON5 events. I am running on a Win10 system with python 3.8.7 and windows-curses 2.2.0, which I am given to understand uses the gohlke PDCurses wheels for the underlying curses implementation. I can display the values of all of the BUTTON1 to BUTTON4 event constants but python 3.8.7 barfs if I try to use any BUTTON5 event names. It also does not recognize the BUTTONn_RESERVED_EVENT names for buttons 1-4. print( "B1={:08x},{:08x},{:08x},{:08x},{:08x}\n".format( curses.BUTTON1_RELEASED, curses.BUTTON1_PRESSED, curses.BUTTON1_CLICKED, curses.BUTTON1_DOUBLE_CLICKED, curses.BUTTON1_TRIPLE_CLICKED) + \ "B2={:08x},{:08x},{:08x},{:08x},{:08x}\n".format( curses.BUTTON2_RELEASED, curses.BUTTON2_PRESSED, curses.BUTTON2_CLICKED, curses.BUTTON2_DOUBLE_CLICKED, curses.BUTTON2_TRIPLE_CLICKED) + \ "B3={:08x},{:08x},{:08x},{:08x},{:08x}\n".format( curses.BUTTON3_RELEASED, curses.BUTTON3_PRESSED, curses.BUTTON3_CLICKED, curses.BUTTON3_DOUBLE_CLICKED, curses.BUTTON3_TRIPLE_CLICKED) + \ "B4={:08x},{:08x},{:08x},{:08x},{:08x}\n".format( curses.BUTTON4_RELEASED, curses.BUTTON4_PRESSED, curses.BUTTON4_CLICKED, curses.BUTTON4_DOUBLE_CLICKED, curses.BUTTON4_TRIPLE_CLICKED) + \ "S/C/A={:08x},{:08x},{:08x}".format( curses.BUTTON_SHIFT, curses.BUTTON_CTRL, curses.BUTTON_ALT)) yields this output: B1=00000001,00000002,00000004,00000008,00000010 B2=00000020,00000040,00000080,00000100,00000200 B3=00000400,00000800,00001000,00002000,00004000 B4=00008000,00010000,00020000,00040000,00080000 S/C/A=04000000,08000000,10000000 Any attempt to use a BUTTON5 constant name or BUTTONn_RESERVED_EVENT constant name fails: Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import curses >>> print("B5={:08x}".format(curses.BUTTON5_RELEASED)) Traceback (most recent call last): File "", line 1, in AttributeError: module 'curses' has no attribute 'BUTTON5_RELEASED' >>> print("B5={:08x}".format(curses.BUTTON1_RESERVED_EVENT)) Traceback (most recent call last): File "", line 1, in AttributeError: module 'curses' has no attribute 'BUTTON1_RESERVED_EVENT' When I actually capture mouse wheel events, the wheel-up event is reported as 0x00010000 or BUTTON4_PRESSED, but the wheel-down event is reported as 0x 00200000, which has no constant name associated with it for which I can find any documentation. This is a logging trace if curses.get_wch() and curses.getkey() results and the curses.getmouse() results when KEY_MOUSE is returned. I have manually annotated the getmouse display lines indicating what mouse action I actually performed. DEBUG:root:wch='539' = 0x021b at (0,0) DEBUG:root:3ch='KEY_MOUSE at (0,0)' DEBUG:root:3ch KEY_MOUSE detected at (0,0) DEBUG:root:Mouse data id=0, x=60, y=31, z=0, bs=00000004 Button 1 click DEBUG:root:wch='539' = 0x021b at (0,0) DEBUG:root:3ch='KEY_MOUSE at (0,0)' DEBUG:root:3ch KEY_MOUSE detected at (0,0) DEBUG:root:Mouse data id=0, x=-1, y=-1, z=0, bs=00010000 wheel up once DEBUG:root:wch='539' = 0x021b at (0,0) DEBUG:root:3ch='KEY_MOUSE at (0,0)' DEBUG:root:3ch KEY_MOUSE detected at (0,0) DEBUG:root:Mouse data id=0, x=-1, y=-1, z=0, bs=00200000 wheel down once DEBUG:root:wch='539' = 0x021b at (0,0) DEBUG:root:3ch='KEY_MOUSE at (0,0)' DEBUG:root:3ch KEY_MOUSE detected at (0,0) DEBUG:root:Mouse data id=0, x=-1, y=-1, z=0, bs=00010000 wheel up once DEBUG:root:wch='539' = 0x021b at (0,0) DEBUG:root:3ch='KEY_MOUSE at (0,0)' DEBUG:root:3ch KEY_MOUSE detected at (0,0) DEBUG:root:Mouse data id=0, x=-1, y=-1, z=0, bs=00200000 wheel down once Where can I find any documentation of the correct curses constant name(s) to use for detecting a "wheel down" action? Or do I just have to manually define my own BUTTON5 constant name for the wheel-down event? TIA for any help or RTFM you can provide. Peter From bluebox03 at gmail.com Sun Mar 7 10:36:12 2021 From: bluebox03 at gmail.com (tommy yama) Date: Mon, 8 Mar 2021 00:36:12 +0900 Subject: google text-to-speech python Message-ID: Hi, Anyone familiar with how to change speech pace with python script? Thanks! From avigross at verizon.net Sun Mar 7 12:54:54 2021 From: avigross at verizon.net (Avi Gross) Date: Sun, 7 Mar 2021 12:54:54 -0500 Subject: Apriori Algorithm In-Reply-To: <923f9f08-32a7-feb9-cf96-aa1e68401fd6@DancesWithMice.info> References: <1aabc84a-f00e-4c4c-bd81-7c902d2283f2n@googlegroups.com> <923f9f08-32a7-feb9-cf96-aa1e68401fd6@DancesWithMice.info> Message-ID: <030301d7137a$fb41f2a0$f1c5d7e0$@verizon.net> I apologize for my earlier snide remark as I was not then aware there was an algorithm called apriori based on the Latin term and wondered if someone was pulling someone's leg, in advance. Someone has posted a pointer to Python code that is supposed to do that. If that is suitable, then the serious task is to read what they say and use it. I note the data you show below is ambiguous and not in the format that code asks for. Are you saying each line I see of what looks like integers is a grouping you want to contrast to other such lines in the algorithm? I doubt it can be used as is but needs to become some kind of data structure such as a list of tuples or whatever the algorithm wants. -----Original Message----- From: Python-list On Behalf Of dn via Python-list Sent: Sunday, March 7, 2021 3:09 AM To: python-list at python.org Subject: Re: Apriori Algorithm On 07/03/2021 20.56, sarang shah wrote: > I have this dataset in a text file I need to make an apriori algorithm based on it. Please help. > > 25 52 164 240 274 328 368 448 538 561 630 687 730 775 825 834 > 39 120 124 205 401 581 704 814 825 834 > 35 249 674 712 733 759 854 950 > 39 422 449 704 825 857 895 937 954 964 > 15 229 262 283 294 352 381 708 738 766 853 883 966 978 > 26 104 143 320 569 620 798 > 7 185 214 350 529 658 682 782 809 849 883 947 970 979 > 227 390 > 71 192 208 272 279 280 300 333 496 529 530 597 618 674 675 720 855 914 932 > 183 193 217 256 276 277 374 474 483 496 512 529 626 653 706 878 939 > 161 175 177 424 490 571 597 623 766 795 853 910 960 > 125 130 327 698 699 839 > 392 461 569 801 862 > 27 78 104 177 733 775 781 845 900 921 938 > 101 147 229 350 411 461 572 579 657 675 778 803 842 903 > 71 208 217 266 279 290 458 478 523 614 766 853 888 944 969 > 43 70 176 204 227 334 369 480 513 703 708 835 874 895 > 25 52 278 730 > 151 432 504 830 890 Great! For what purpose - is this a 'homework assignment'? What code do you have so far? -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list From dieter at handshake.de Sun Mar 7 13:00:00 2021 From: dieter at handshake.de (Dieter Maurer) Date: Sun, 7 Mar 2021 19:00:00 +0100 Subject: How to implement logging for an imported module? In-Reply-To: References: Message-ID: <24645.5280.490579.951586@ixdm.fritz.box> Robert Latest wrote at 2021-3-7 10:21 GMT: >I'm trying to add logging to a module that gets imported by another module. But >I only get it to work right if the imported module knows the name of the >importing module. The example given in the "Logging Cookbook" also rely on this >fact. I have used so called "monkey patching" to achieve something like this (in fact "function call tracing"). "monkey patching" means code modification at runtime. Suppose your application implements a logging decorator `log`. Then on import, you can replace methods (easiest) or functions with decorated variants either directly in the imported module/class or for use by the importer. From grant.b.edwards at gmail.com Sat Mar 6 10:40:41 2021 From: grant.b.edwards at gmail.com (Grant Edwards) Date: Sat, 6 Mar 2021 15:40:41 -0000 (UTC) Subject: Choosable dependency References: <20210306120033.0fd573e1@arcor.com> Message-ID: On 2021-03-06, Manfred Lotz wrote: > Let us say I have a package which reads a TOML file. > > I want to give the user of my package the choice to decide if he wants > to use the toml, tomlkit or rtoml package. Why would the user choose one over the other? Does the user get different functions/features depending on which one they choose? If you're just using a common subset to provide a fixed set of features regardless, then just use whatever is installed. -- Grant From tjreedy at udel.edu Sat Mar 6 16:24:41 2021 From: tjreedy at udel.edu (Terry Reedy) Date: Sat, 6 Mar 2021 16:24:41 -0500 Subject: Please don't feed the trolls In-Reply-To: References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: Trolling, among other things, is fishing with a moving line, especially with a revolving lure, as from a moving boat. A troll, among other things, is that method or the lure used. On the internet, 'troll' is used metaphorically. A troll is a flashy post designed to catch peoples emotions and hook them into responding. Trolling is posting such posts. People do this either out of compulsion or for entertainment. Quite separately, a troll in Scandinavian folklore is an unpleasant mythical creature living in a cave, or perhaps under or around a bridge. Bridge trolls are reputed to disrupt communication by travel. Fishermen would not call a person trolling for fish a troll. It would be an insult. On the internet, we do call people trolling trolls, again methphorically, because they disrupt communication. The proper response to trolls is to not feed them by responding as they wish. When people respond, they continue trolling, and a moderator has to ban them. People reading python-list posts on google groups or comp.lang.python should not help them evade their bans by quoting them. On 3/6/2021 2:11 PM, Bonita Montero, responding to a banned troll for at least a third time: > Someone who says that he is capable of writing a compiler that > translates every language has megalomania. No one can do this. We certainly need not believe so until it is done. But we do not know whether X is an actual megalomaniac acting like a troll or an actual troll acting like a megalomaniac. The same can apply to any other character type that can lead to trolling or be assumed as a pose by a troll. In Spanish, bonito/a means a pretty male/female. By coincidence, it is also a tuna-like fish caught by trolling. (Decades ago, my father caught one on a boat one a Mexican river/lagoon.) Please unhook yourself and swim away. -- Terry Jan Reedy From hjp-python at hjp.at Sun Mar 7 14:42:53 2021 From: hjp-python at hjp.at (Peter J. Holzer) Date: Sun, 7 Mar 2021 20:42:53 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: <60440506.2020004@googlemail.com> References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> <87sg58c6ws.fsf@bsb.me.uk> <60440506.2020004@googlemail.com> Message-ID: <20210307194253.GA11051@hjp.at> On 2021-03-06 23:41:10 +0100, Mirko via Python-list wrote: > I even wonder why they have tried. Writing a universal > compiler/interpreter sounds logically impossible to me, Here's a > simple Python expression: > > >>> 3+3*5 > 18 > > And here's the same expression in (GNU) Smalltalk: > > st> 3+3*5 > 30 > > > How would such a universal compiler know which evaluation strategy > to follow, if not by writing a parser end evaluator for every > supported language? That depends on what you mean by "writing". If we stick to your example, you would need to specify in some way that in Python * has higher precedence than +, while in Smalltalk it doesn't. You could write some code in Python or Smalltalk or C or Assembler or even for a Turing machine to do that. Or you can write the grammar in some formal language (e.g. BNF) and let the compiler interpret that (or generate native code from it and run that). The latter is what a "universal compiler" would do and parser generators have been around for a long time (they were nothing new when I studied CS in the 1980's). While there is still progress here (I've come across a few interesting papers over the last year or so), I'd say that part of the problem is solved. The second part is converting a parse tree into code. I am quite sure that it is possible to devise a formal language to specify the semantics of any programming language and then to use this to generate the code. However, I strongly suspect that such a language would be comparable in expressiveness and ease of use to other programming languages - or in other worlds it would be just another programming language. Certainly better suited to compiler construction (otherwise why would you use it?), but probably not massively so (unlike writing a Yacc grammar is a lot easier/quicker than writing a top-down parser), So there wouldn't be a huge incentive to use it unless you plan to write compilers for lots of languages. On the other hand there are downsides: Such a generic system might be slow and/or memory-hungry, it might not run on every platform, it might have a steep learning curve, and it's probably not so well-suited for non-compiler programs. > And if it's hard for this simple problem, how about more complex > cases. For this simple problem it's easy :-) hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp at hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From jcasale at activenetwerx.com Sun Mar 7 15:14:16 2021 From: jcasale at activenetwerx.com (Joseph L. Casale) Date: Sun, 7 Mar 2021 20:14:16 +0000 Subject: How to implement logging for an imported module? In-Reply-To: References: Message-ID: <472f5a7c02b3428392f6981e954c56e3@activenetwerx.com> > I couldn't find any information on how to implement logging in a library that > doesn't know the name of the application that uses it. How is that done? Hello, That's not how it works, it is the opposite. You need to know the name of its logger, and since you imported it, you do. Logging is hierarchical, organized by dot separated names. However, all loggers share the same root (top level) logger (a logger without any name, or in other words, no hierarchical specificity). Loggers are singletons, all loggers share the same root and each time you get a logger, if any code has previously asked for that logger by name and therefore created it, you'll get that instance. When you create a logger, it starts at level WARNING, which means only warnings or higher are considered. When you create a handler, it starts at level NOTSET, which means only level 0 and above are considered. Since NOTSET is 0, everything is considered by default. Loggers pass messages that they are considering to all their handlers, which then each filter again by the handlers own distinct level. Don't add handlers in library code (except a null handler). Do set a level on your library logger that you deem appropriate (INFO is likely not appropriate). Then, in your consuming code, if you instantiate a named logger, you won't see messages that fall below the threshold of the library, and root defaults. Create (get) a root logger (you don't have to use it) and set the level, and attach a handler to it. Then get the logger your library uses and set the level to what you want. Proceed with creating your own named logger and using that in your code, however when the library emits a log message, it will traverse up, unfiltered and be passed to a handler. Think of the process like a tree data structure, with the single root at the top, and each immediate child being a named logger without additional specificity (no dot), and each child of those taking the named plus one dot, followed by another name. That helps when understanding the design behavior of propagation, and rather than restate what is already well done, see https://docs.python.org/3/library/logging.html#logging.Logger.propagate. It does make a lot of sense, and it facilitates a concise and powerful ability to configure an application where some messages can be ignored, written to different files, combined into one, or some even emailed. Last word of advice, don't fight it by hacking up or patching (somehow?), it will simply not work right for any other case even slightly different than the one you somehow beat into submission. I hope that helps, Joseph Casale From avigross at verizon.net Sun Mar 7 15:52:02 2021 From: avigross at verizon.net (Avi Gross) Date: Sun, 7 Mar 2021 15:52:02 -0500 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: <20210307194253.GA11051@hjp.at> References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> <87sg58c6ws.fsf@bsb.me.uk> <60440506.2020004@googlemail.com> <20210307194253.GA11051@hjp.at> Message-ID: <01fd01d71393$b9b64750$2d22d5f0$@verizon.net> The precedence example used below made a strange assumption that the imaginary program would not be told up-front what computer language it was being asked to convert from. That is not the scenario being discussed as we have described. In any particular language, there usually is a well-known precedence order such as "*" coming before "+" unless you use something like parentheses to make your intent clear and over-ride it. But it makes me think of a related question. Assume you are writing code in a language like Python and the language has been analyzed and all kinds of info stored that describes it and that includes things like precedence rules for operators. Suppose it works fine and YOU want to break it. Could you? If your language supports constructs like creating what looks like new infix operators as an example, or overloading existing ones, could you write expressions this mystical product would interpret differently than the original compiler or interpreter? As an example, what does this simple statement mean: A + B I mean A can be an integer or floating point number or character string but can also be a complex number or a data.frame or just about any arbitrary object. So can B. And in many cases, the operation is not at all Abelian and B+A is something else. In many cases, the logic is to look at the right-hand or left-hand variable and see if it has a method defined to be called such as __ADD__ or __RADD__ or maybe inherited such a method from another class perhaps using some specific method with complicated multiple inheritance scenarios. Or the language may choose to convert either A or B or both to some other format and perform some kind of addition and maybe convert the result to something. Lots of work is in the Python interpreter to deal with this and some of it has to be flexible enough to deal with times when a class or object is changed as the program runs. Might it be possible to create edge cases that break a static set of description files? If not, how much more complex must the imaginary program get to handle these challenges and what might that do to the purported gains in efficiency claimed? I am currently studying a language called Kotlin. They, like some other languages, allow the creation of new infix operators and once I have defined "myplus" I can write code like: A myplus B What if it would also allow me to specify dynamically what the priority of "myplus" is? Clearly it cannot be a reserved keyword in some table loaded in the language in advance. R lets me do something similar like create "%myplus%" as an operator and even weirder things like rebinding "+" to mean something else that no longer has a particular priority that was pre-ordained. So if we had a contest on finding ways to break a sort of general purpose customizable any-language mangler, I wonder if it might be easy to mangle it at first. To get around that, you might have to not handle languages you declare as misbehaving, or make a more complex system that handles all known cases. But even then, can we design a new language for the express purpose of exposing some hidden flaw and make them deal with that? New languages keep popping up, some with no prior intent on breaking anything, but I think a universal translator may not be imminent. -----Original Message----- From: Python-list On Behalf Of Peter J. Holzer Sent: Sunday, March 7, 2021 2:43 PM To: python-list at python.org Subject: Re: neonumeric - C++ arbitrary precision arithmetic library On 2021-03-06 23:41:10 +0100, Mirko via Python-list wrote: > I even wonder why they have tried. Writing a universal > compiler/interpreter sounds logically impossible to me, Here's a > simple Python expression: > > >>> 3+3*5 > 18 > > And here's the same expression in (GNU) Smalltalk: > > st> 3+3*5 > 30 > > > How would such a universal compiler know which evaluation strategy to > follow, if not by writing a parser end evaluator for every supported > language? That depends on what you mean by "writing". If we stick to your example, you would need to specify in some way that in Python * has higher precedence than +, while in Smalltalk it doesn't. You could write some code in Python or Smalltalk or C or Assembler or even for a Turing machine to do that. Or you can write the grammar in some formal language (e.g. BNF) and let the compiler interpret that (or generate native code from it and run that). The latter is what a "universal compiler" would do and parser generators have been around for a long time (they were nothing new when I studied CS in the 1980's). While there is still progress here (I've come across a few interesting papers over the last year or so), I'd say that part of the problem is solved. The second part is converting a parse tree into code. I am quite sure that it is possible to devise a formal language to specify the semantics of any programming language and then to use this to generate the code. However, I strongly suspect that such a language would be comparable in expressiveness and ease of use to other programming languages - or in other worlds it would be just another programming language. Certainly better suited to compiler construction (otherwise why would you use it?), but probably not massively so (unlike writing a Yacc grammar is a lot easier/quicker than writing a top-down parser), So there wouldn't be a huge incentive to use it unless you plan to write compilers for lots of languages. On the other hand there are downsides: Such a generic system might be slow and/or memory-hungry, it might not run on every platform, it might have a steep learning curve, and it's probably not so well-suited for non-compiler programs. > And if it's hard for this simple problem, how about more complex > cases. For this simple problem it's easy :-) hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp at hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" From svshahbrd at gmail.com Sun Mar 7 17:23:01 2021 From: svshahbrd at gmail.com (sarang shah) Date: Sun, 7 Mar 2021 14:23:01 -0800 (PST) Subject: Apriori Algorithm In-Reply-To: References: <1aabc84a-f00e-4c4c-bd81-7c902d2283f2n@googlegroups.com> <030301d7137a$fb41f2a0$f1c5d7e0$@verizon.net> <923f9f08-32a7-feb9-cf96-aa1e68401fd6@DancesWithMice.info> Message-ID: On Sunday, March 7, 2021 at 11:55:21 AM UTC-6, Avi Gross wrote: > I apologize for my earlier snide remark as I was not then aware there was an > algorithm called apriori based on the Latin term and wondered if someone was > pulling someone's leg, in advance. > > Someone has posted a pointer to Python code that is supposed to do that. If > that is suitable, then the serious task is to read what they say and use it. > I note the data you show below is ambiguous and not in the format that code > asks for. > > Are you saying each line I see of what looks like integers is a grouping you > want to contrast to other such lines in the algorithm? I doubt it can be > used as is but needs to become some kind of data structure such as a list of > tuples or whatever the algorithm wants. > -----Original Message----- > From: Python-list On > Behalf Of dn via Python-list > Sent: Sunday, March 7, 2021 3:09 AM > To: pytho... at python.org > Subject: Re: Apriori Algorithm > > On 07/03/2021 20.56, sarang shah wrote: > > I have this dataset in a text file I need to make an apriori algorithm > based on it. Please help. > > > > 25 52 164 240 274 328 368 448 538 561 630 687 730 775 825 834 > > 39 120 124 205 401 581 704 814 825 834 > > 35 249 674 712 733 759 854 950 > > 39 422 449 704 825 857 895 937 954 964 > > 15 229 262 283 294 352 381 708 738 766 853 883 966 978 > > 26 104 143 320 569 620 798 > > 7 185 214 350 529 658 682 782 809 849 883 947 970 979 > > 227 390 > > 71 192 208 272 279 280 300 333 496 529 530 597 618 674 675 720 855 914 932 > > > 183 193 217 256 276 277 374 474 483 496 512 529 626 653 706 878 939 > > 161 175 177 424 490 571 597 623 766 795 853 910 960 > > 125 130 327 698 699 839 > > 392 461 569 801 862 > > 27 78 104 177 733 775 781 845 900 921 938 > > 101 147 229 350 411 461 572 579 657 675 778 803 842 903 > > 71 208 217 266 279 290 458 478 523 614 766 853 888 944 969 > > 43 70 176 204 227 334 369 480 513 703 708 835 874 895 > > 25 52 278 730 > > 151 432 504 830 890 > Great! > For what purpose - is this a 'homework assignment'? > What code do you have so far? > > -- > Regards, > =dn > -- > https://mail.python.org/mailman/listinfo/python-list Yes. Each line is a group set. a.Pleaseimplement analgorithm of your choice (Apriori, or FP-Tree) tofind frequent itemsets. You can importstandardlibraries/modules, but thealgorithm should be written by yourself. Min-support should be a user input parameter. Two sample of transaction datasets, Dataset1and Dataset2, are providedto test if your program works correctly.You can usePython, Java or C++. b. Extend your program to output all the maximal frequent itemsets and closed frequent itemsets. c. Extend your program to output all the association rules. Min-Confidence should be a user input parameter. For all the association rules, output measures include support, confidence, lift, all-confidence and cosine. From ml_news at posteo.de Sun Mar 7 16:24:57 2021 From: ml_news at posteo.de (Manfred Lotz) Date: Sun, 7 Mar 2021 22:24:57 +0100 Subject: Choosable dependency References: <20210306120033.0fd573e1@arcor.com> Message-ID: <20210307222457.49bcc6bf@arcor.com> On Sat, 6 Mar 2021 15:40:41 -0000 (UTC) Grant Edwards wrote: > On 2021-03-06, Manfred Lotz wrote: > > Let us say I have a package which reads a TOML file. > > > > I want to give the user of my package the choice to decide if he > > wants to use the toml, tomlkit or rtoml package. > > Why would the user choose one over the other? Does the user get > different functions/features depending on which one they choose? > I am a user of my package and I like to use rtoml which however is not available on another OS (due to Rust no being available there) where I also want to use my package. Here I can use toml which is always possible to install. Therefore, toml is the default so that the ordinary user doesn't need to care. -- Manfred From avigross at verizon.net Sun Mar 7 17:44:55 2021 From: avigross at verizon.net (Avi Gross) Date: Sun, 7 Mar 2021 17:44:55 -0500 Subject: Apriori Algorithm In-Reply-To: References: <1aabc84a-f00e-4c4c-bd81-7c902d2283f2n@googlegroups.com> <030301d7137a$fb41f2a0$f1c5d7e0$@verizon.net> <923f9f08-32a7-feb9-cf96-aa1e68401fd6@DancesWithMice.info> Message-ID: <004501d713a3$7eed0ae0$7cc720a0$@verizon.net> Speaking for myself, that is a very significant piece of homework to do and unless you do quite a bit and get stuck and ask for help in some aspect, this is not the place to ask if anyone wishes to do all the work. The assignment seems to want you to write your own code to implement the algorithm. So unless the outlines of the algorithm were taught in class or a textbook, you need to find the algorithm by searching the internet and you may find places with more or less of a good description: https://en.wikipedia.org/wiki/Apriori_algorithm Once you find one you need to choose a language you are able to program in from the list of choices and see what libraries of allowed components are likely to be helpful so you do not have to start from nothing but the basics. If you decide on JAVA or C++, this is not the forum to ask. As I noted earlier, your data will need to be read in by any program and made into whatever format your algorithm uses. What this is will be up to you but note you have a collection of collections where you are told of two very specific datasets that must be handled by the algorithm. So your algorithm might be asked to just handle interest, or perhaps also character strings and arbitrary items. You need to know what is expected so you design your code to handle it. Given the nature of the data you show, it should not use anything that holds a fixed number of items as the number of items per line varies and presumably it should handle any number of such lines. It looks like for a basic version they suggest a particular parameter be included and they want an extended version that does more and another that does even more. Looks like a serious amount of work and way too detailed to expect anything but this kind of answer. Many people get paid hundreds of dollars per hour to do things like this and if you learn how, you could be one. Presumably your class has taught you most of what is needed to understand the assignment and how to find out more. I, like most others here, have not been in the class or had any reason to think about this problem before. Any voluntary role here is generally to help with questions about fairly specific python code as compared to big projects. Good luck! -----Original Message----- From: Python-list On Behalf Of sarang shah Sent: Sunday, March 7, 2021 5:23 PM To: python-list at python.org Subject: Re: Apriori Algorithm On Sunday, March 7, 2021 at 11:55:21 AM UTC-6, Avi Gross wrote: > I apologize for my earlier snide remark as I was not then aware there > was an algorithm called apriori based on the Latin term and wondered > if someone was pulling someone's leg, in advance. > > Someone has posted a pointer to Python code that is supposed to do > that. If that is suitable, then the serious task is to read what they say and use it. > I note the data you show below is ambiguous and not in the format that > code asks for. > > Are you saying each line I see of what looks like integers is a > grouping you want to contrast to other such lines in the algorithm? I > doubt it can be used as is but needs to become some kind of data > structure such as a list of tuples or whatever the algorithm wants. > -----Original Message----- > From: Python-list > On Behalf Of dn via Python-list > Sent: Sunday, March 7, 2021 3:09 AM > To: pytho... at python.org > Subject: Re: Apriori Algorithm > > On 07/03/2021 20.56, sarang shah wrote: > > I have this dataset in a text file I need to make an apriori > > algorithm > based on it. Please help. > > > > 25 52 164 240 274 328 368 448 538 561 630 687 730 775 825 834 > > 39 120 124 205 401 581 704 814 825 834 > > 35 249 674 712 733 759 854 950 > > 39 422 449 704 825 857 895 937 954 964 > > 15 229 262 283 294 352 381 708 738 766 853 883 966 978 > > 26 104 143 320 569 620 798 > > 7 185 214 350 529 658 682 782 809 849 883 947 970 979 > > 227 390 > > 71 192 208 272 279 280 300 333 496 529 530 597 618 674 675 720 855 > > 914 932 > > > 183 193 217 256 276 277 374 474 483 496 512 529 626 653 706 878 939 > > 161 175 177 424 490 571 597 623 766 795 853 910 960 > > 125 130 327 698 699 839 > > 392 461 569 801 862 > > 27 78 104 177 733 775 781 845 900 921 938 > > 101 147 229 350 411 461 572 579 657 675 778 803 842 903 > > 71 208 217 266 279 290 458 478 523 614 766 853 888 944 969 > > 43 70 176 204 227 334 369 480 513 703 708 835 874 895 > > 25 52 278 730 > > 151 432 504 830 890 > Great! > For what purpose - is this a 'homework assignment'? > What code do you have so far? > > -- > Regards, > =dn > -- > https://mail.python.org/mailman/listinfo/python-list Yes. Each line is a group set. a.Pleaseimplement analgorithm of your choice (Apriori, or FP-Tree) tofind frequent itemsets. You can importstandardlibraries/modules, but thealgorithm should be written by yourself. Min-support should be a user input parameter. Two sample of transaction datasets, Dataset1and Dataset2, are providedto test if your program works correctly.You can usePython, Java or C++. b. Extend your program to output all the maximal frequent itemsets and closed frequent itemsets. c. Extend your program to output all the association rules. Min-Confidence should be a user input parameter. For all the association rules, output measures include support, confidence, lift, all-confidence and cosine. -- https://mail.python.org/mailman/listinfo/python-list From rsstinnett at gmail.com Sun Mar 7 18:46:41 2021 From: rsstinnett at gmail.com (Russell) Date: Sun, 7 Mar 2021 23:46:41 +0000 (UTC) Subject: editor recommendations? References: <41697044-4479-97c6-4913-11de27f79565@stoneleaf.us> Message-ID: Dan Stromberg wrote: > On Tue, Mar 2, 2021 at 8:11 PM Dan Stromberg wrote: > >> >> On Tue, Mar 2, 2021 at 8:00 PM Russell wrote: >> >>> Ethan Furman wrote: >>> > I'm currently using vim, and the primary reason I've stuck with it for >>> so long is because I can get truly black screens with it. By which I mean >>> that I have a colorful window title bar, a light-grey menu bar, and then a >>> light-grey frame around the text-editing window (aka the only window), and >>> a nice, black-background editing area. >>> >>> I use vim. It's actually extremely powerful, especially for text/code >>> editing. I'd recommend reading one of the many books on using vim >>> effectively. Also, plugins can really add a lot... >>> >> >> On the subject of learning vim: There's an excellent vi cheat sheet >> available on the internet. I've put a copy of it at >> https://stromberg.dnsalias.org/~strombrg/vi.ref.6 >> >> vi is of course the predecessor of vim. But that cheat sheet is still >> great for learning much of vim. >> > > I just ran across: http://lib.ru/MAN/viref.txt > ...which is pretty much the same thing, but converted to nice HTML. To that end, vim also has extensive documentation built in. Just type :help to get started. There's a pretty good tutorial accessible from the main help screen. And I'll stop talking about vim in the Python group now, I promise. :) -- rust 0x68caecc97f6a90122e51c0692c88d9cb6b58a3dc From alan.gauld at yahoo.co.uk Sun Mar 7 19:21:02 2021 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Mon, 8 Mar 2021 00:21:02 +0000 Subject: python curses constant names for mouse wheel movements? In-Reply-To: <000001d71321$d5aaad60$81000820$@earthlink.net> References: <000001d71321$d5aaad60$81000820$@earthlink.net> Message-ID: On 07/03/2021 07:16, pjfarley3 at earthlink.net wrote: > Where can I find any documentation of the correct curses constant name(s) to > use for detecting a "wheel down" action? Or do I just have to manually > define my own BUTTON5 constant name for the wheel-down event? I suspect you need to look in the ncurses documentation or even the C code. And that is no guarantee that the Python curses module will expose any values you do find other than as numeric codes. I would have expected the mouse wheel down/click to appear as a BUTTON2 event to be honest. I didn't even realize there was a BUTTON4 event defined let alone BUTTON5. Incidentally, when you talk about wheel up/down are you talking about wheel rotation events rather than actual button down/up events? In that case 4 and 5 might make sense. If you find the answer please post back, I'm very interested since I'm in the middle of writing a book on the Python curses module and was unaware of this behaviour. A whole new area to explore.... I'm also interested in any documentation you have already found on it - where did you get this understanding? -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos From drsalists at gmail.com Sun Mar 7 23:38:30 2021 From: drsalists at gmail.com (Dan Stromberg) Date: Sun, 7 Mar 2021 20:38:30 -0800 Subject: Choosable dependency In-Reply-To: <20210306120033.0fd573e1@arcor.com> References: <20210306120033.0fd573e1@arcor.com> Message-ID: I sometimes do things like: try: import rtoml as toml except ImportError: import toml ...but I don't like it very much, because it tends to confuse static analyzers like pyflakes and pylint. Maybe mypy will deal with it better? Not sure yet. On Sat, Mar 6, 2021 at 3:05 AM Manfred Lotz wrote: > Let us say I have a package which reads a TOML file. > > I want to give the user of my package the choice to decide if he wants > to use the toml, tomlkit or rtoml package. > > So, in case the user chose to use rtoml then there should be an import > only for rtoml, aso. > > How could I achieve this? > > -- > Thanks, > Manfred > > -- > https://mail.python.org/mailman/listinfo/python-list > From grant.b.edwards at gmail.com Sun Mar 7 21:59:41 2021 From: grant.b.edwards at gmail.com (Grant Edwards) Date: Mon, 8 Mar 2021 02:59:41 -0000 (UTC) Subject: Choosable dependency References: <20210306120033.0fd573e1@arcor.com> <20210307222457.49bcc6bf@arcor.com> Message-ID: On 2021-03-07, Manfred Lotz wrote: > On Sat, 6 Mar 2021 15:40:41 -0000 (UTC) > Grant Edwards wrote: > >> On 2021-03-06, Manfred Lotz wrote: >> > Let us say I have a package which reads a TOML file. >> > >> > I want to give the user of my package the choice to decide if he >> > wants to use the toml, tomlkit or rtoml package. >> >> Why would the user choose one over the other? Does the user get >> different functions/features depending on which one they choose? > > I am a user of my package and I like to use rtoml which however is not > available on another OS (due to Rust no being available there) where I > also want to use my package. Here I can use toml which is always > possible to install. Therefore, toml is the default so that the ordinary > user doesn't need to care. I still don't understand why the user needs to choose. Why not just use whichever one is installed? Import whichever one you prefer, and if that fails, import one of the others, if that fails, import the third one. -- Grant From pankaj at codeisgreat.org Sun Mar 7 22:48:25 2021 From: pankaj at codeisgreat.org (Pankaj Jangid) Date: Mon, 08 Mar 2021 09:18:25 +0530 Subject: How to implement logging for an imported module? References: <472f5a7c02b3428392f6981e954c56e3@activenetwerx.com> Message-ID: "Joseph L. Casale" writes: >> I couldn't find any information on how to implement logging in a >> library that doesn't know the name of the application that uses >> it. How is that done? > Create (get) a root logger (you don't have to use it) and set the > level, and attach a handler to it. Then get the logger your library > uses and set the level to what you want. So does that mean if we change the following code to get a logger without any name then it will work? Without any further change. >> logger = logging.getLogger('foo') >> logger.addHandler(ch) >> logger.setLevel(logging.DEBUG) -- Regards, Pankaj Jangid From cs at cskk.id.au Mon Mar 8 01:09:41 2021 From: cs at cskk.id.au (Cameron Simpson) Date: Mon, 8 Mar 2021 17:09:41 +1100 Subject: editor recommendations? In-Reply-To: <874khs8vd7.fsf@metapensiero.it> References: <874khs8vd7.fsf@metapensiero.it> Message-ID: On 03Mar2021 10:00, Lele Gaifax wrote: >Cameron Simpson writes: >> My fingers know vim. Some others' fingers know emacs. > >Emacs has also an Evil[1] mode, that mimics some vi/vim features. Whenever I've tries emulate-vi modes they tend to lack some coner case known to my fingers. [... Doom Emacs recommendation - I have no opinion ...] >-- Emacs outshines all other editing software in approximately the same >way that the noonday sun does the stars. It is not just bigger and >brighter; it simply makes everything else vanish. ? Neal Stephenson A novice of the temple once approached the Chief Priest with a question. "Master, does Emacs have the Buddha nature?" the novice asked. The Chief Priest had been in the temple for many years and could be relied upon to know these things. He thought for several minutes before replying. "I don't see why not. It's got bloody well everything else." With that, the Chief Priest went to lunch. The novice suddenly achieved enlightenment, several years later. Commentary: His Master is kind, Answering his FAQ quickly, With thought and sarcasm. Cheers, Cameron Simpson From auriocus at gmx.de Mon Mar 8 02:38:31 2021 From: auriocus at gmx.de (Christian Gollwitzer) Date: Mon, 8 Mar 2021 08:38:31 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> <87sg58c6ws.fsf@bsb.me.uk> <60440506.2020004@googlemail.com> <20210307194253.GA11051@hjp.at> Message-ID: Am 07.03.21 um 20:42 schrieb Peter J. Holzer: > The second part is converting a parse tree into code. I am quite sure > that it is possible to devise a formal language to specify the semantics > of any programming language and then to use this to generate the code. > However, I strongly suspect that such a language would be comparable in > expressiveness and ease of use to other programming languages - or in > other worlds it would be just another programming language. As far as I understand the idea, Leigh (aka Mr Flibble) thinks that he can create a "library" of code translators that translate the individual pieces of the parse tree into some intermediate code, and by specifying these codelets within the grammar the semantics of a language can be fully described. My argument against this whole thing is that the library would be enormous. He seems to think that big chunks can be reused for different languages, but I don't believe this. A simple example: int a = -3 unsigned int b = 5; in C: a < b is false. This is insane but follows from the type casting rules in C. in Python or any other language with sane integers, -3 < 5 will always be true. For large enough values you must convert them to big integers. CPython simply uses big integers for everything, but that obviously slows down the whole thing. If you want to compile that to fast machine code, you need to do the computation in fixed integers and check for overflow *after every single step*. And there are myriads of differences. Introducing JavaScript again will bring myriads of differences and so on. The closest thing to such a project I can think of is LLVM. It still requires you to write the actual code generator, but features many intrinsics and libriaries that could be reused and therefore it is easy to add a new language. The approximate value of LLVM is estimated here: https://chriscummins.cc/2019/llvm-cost/ It's over 5000 man years of work. There is no way a single developer, regardless how brilliant he may be, can recreate this in his lifetime. Maybe focussed to a single language or two, but not "universal" in any sense. Christian From mirkok.lists at googlemail.com Mon Mar 8 03:29:31 2021 From: mirkok.lists at googlemail.com (Mirko) Date: Mon, 8 Mar 2021 09:29:31 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: <01fd01d71393$b9b64750$2d22d5f0$@verizon.net> References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> <87sg58c6ws.fsf@bsb.me.uk> <60440506.2020004@googlemail.com> <20210307194253.GA11051@hjp.at> <01fd01d71393$b9b64750$2d22d5f0$@verizon.net> Message-ID: <6045E06B.6070607@googlemail.com> Am 07.03.2021 um 21:52 schrieb Avi Gross via Python-list: > The precedence example used below made a strange assumption that the > imaginary program would not be told up-front what computer language it was > being asked to convert from. That is not the scenario being discussed as we > have described. In any particular language, there usually is a well-known > precedence order such as "*" coming before "+" unless you use something like > parentheses to make your intent clear and over-ride it. Well, no I did not assume some kind of magical universal translator ala Star Trek. ;-) The OP seems to claim, that he could compile any language by just providing a JSON schema file which describes the language. I assumed that those who tried this before did something similar. And that is what sounds logically impossible (or at least unfeasible) to me. How can one write a comparatively small descriptive schema that covers all of a language's subtleties in syntax, grammar, semantics and behavior? I agree that my example wasn't good, since it would be just a matter of specifying operator precedence. But there are numerous little and large aspects to cover for any language. In the end, one would have to write a more or less full blown parser. Or at least a schema that is so long, that all advantages of this approach go away. From bluebox03 at gmail.com Mon Mar 8 03:43:27 2021 From: bluebox03 at gmail.com (tommy yama) Date: Mon, 8 Mar 2021 17:43:27 +0900 Subject: gTTS in python Message-ID: Hi, Anyone might be familiar with gTTS ? https://pypi.org/project/gTTS/ Thanks. From boblatest at yahoo.com Mon Mar 8 04:16:27 2021 From: boblatest at yahoo.com (Robert Latest) Date: 8 Mar 2021 09:16:27 GMT Subject: How to implement logging for an imported module? References: <472f5a7c02b3428392f6981e954c56e3@activenetwerx.com> Message-ID: Joseph L. Casale wrote: >> I couldn't find any information on how to implement logging in a library that >> doesn't know the name of the application that uses it. How is that done? > > That's not how it works, it is the opposite. You need to know the name of its > logger, and since you imported it, you do. [much snipping] > Last word of advice, don't fight it by hacking up or patching (somehow?), it > will simply not work right for any other case even slightly different than > the one you somehow beat into submission. I didn't waht to hack the logging system, it's just that I wasn't sure of its design principles. I had hoped that if I set up a logger (including levels and formatter) in my main app, the loggers in the imported modules would somwhow automagically follow suit. Now I understand that for each imported module I must import its logger, too, and decide how to deal with its messages. > I hope that helps, Much appreciated, robert From cl at isbd.net Mon Mar 8 04:27:40 2021 From: cl at isbd.net (Chris Green) Date: Mon, 8 Mar 2021 09:27:40 +0000 Subject: editor recommendations? References: <874khs8vd7.fsf@metapensiero.it> Message-ID: Cameron Simpson wrote: > On 03Mar2021 10:00, Lele Gaifax wrote: > >Cameron Simpson writes: > >> My fingers know vim. Some others' fingers know emacs. > > > >Emacs has also an Evil[1] mode, that mimics some vi/vim features. > > Whenever I've tries emulate-vi modes they tend to lack some coner case > known to my fingers. > I use [x]vile, "vi like Emacs". It's vi in terms of what the keys do (I can use vim and 'real' vi without issues) but it's built on an old eMacs engine and so has quite a few eMacs-like abiliities. For example it has a gnuclient type mode where it runs as a server and you can squirt files at it to be edited. It's available in most distributions and is actively maintained and developed still. -- Chris Green ? From tjol at tjol.eu Mon Mar 8 04:41:10 2021 From: tjol at tjol.eu (Thomas Jollans) Date: Mon, 8 Mar 2021 10:41:10 +0100 Subject: Choosable dependency In-Reply-To: <20210306120033.0fd573e1@arcor.com> References: <20210306120033.0fd573e1@arcor.com> Message-ID: <16cd4289-02fb-cf9f-ba4b-78f7de0f3468@tjol.eu> On 06/03/2021 12:00, Manfred Lotz wrote: > Let us say I have a package which reads a TOML file. > > I want to give the user of my package the choice to decide if he wants > to use the toml, tomlkit or rtoml package. > > So, in case the user chose to use rtoml then there should be an import > only for rtoml, aso. > > How could I achieve this? > I expect in this case the best thing to do is to simply try to import your favourite TOML module (rtoml or what have you), and if that doesn't work import a fallback ? accepting that there might be two TOML parser modules loaded in the same process in some cases. But this dilemma is fairly common in the Qt GUI world, as there are two competing Python bindings for the Qt framework (and multiple nearly-compatible versions of both) and in that case all packages need to use the same one. So you could have a look at what modules depending on Qt do. For example: https://pyqtgraph.readthedocs.io/en/latest/how_to_use.html#pyqt-and-pyside PyQtGraph checks if any supported Qt bindings are already imported and uses those. If not, it imports its own favourite. The rules are fairly complex in their case (they're supporting 6 almost-but-not-quite-compatible backends), so they have an internal wrapper module https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/Qt.py and do something like from . import Qt in every file. Matplotlib does it the other way around: https://matplotlib.org/stable/api/matplotlib_configuration_api.html#matplotlib.use there the user imports matplotlib and then optionally calls a function to select a backend. Then every function within matplotlib that uses the backend has to defer to some wrapper (not sure where or how) Hope that helps Thomas -- Dr. Thomas Jollans e ? tjol at tjol.eu From ml_news at posteo.de Mon Mar 8 05:55:09 2021 From: ml_news at posteo.de (Manfred Lotz) Date: Mon, 8 Mar 2021 11:55:09 +0100 Subject: Choosable dependency References: <20210306120033.0fd573e1@arcor.com> Message-ID: <20210308115509.441bf809@arcor.com> On Sun, 7 Mar 2021 20:38:30 -0800 Dan Stromberg wrote: > I sometimes do things like: > > try: > import rtoml as toml > except ImportError: > import toml > Also a possibility. Thanks. > ...but I don't like it very much, because it tends to confuse static > analyzers like pyflakes and pylint. Maybe mypy will deal with it > better? Not sure yet. > Good to know that there could be problems here. -- Manfred From Richard at Damon-Family.org Mon Mar 8 08:58:44 2021 From: Richard at Damon-Family.org (Richard Damon) Date: Mon, 8 Mar 2021 08:58:44 -0500 Subject: How to implement logging for an imported module? In-Reply-To: References: <472f5a7c02b3428392f6981e954c56e3@activenetwerx.com> Message-ID: On 3/8/21 4:16 AM, Robert Latest via Python-list wrote: > Joseph L. Casale wrote: >>> I couldn't find any information on how to implement logging in a library that >>> doesn't know the name of the application that uses it. How is that done? >> That's not how it works, it is the opposite. You need to know the name of its >> logger, and since you imported it, you do. > [much snipping] > >> Last word of advice, don't fight it by hacking up or patching (somehow?), it >> will simply not work right for any other case even slightly different than >> the one you somehow beat into submission. > I didn't waht to hack the logging system, it's just that I wasn't sure of its > design principles. I had hoped that if I set up a logger (including levels and > formatter) in my main app, the loggers in the imported modules would somwhow > automagically follow suit. Now I understand that for each imported module I > must import its logger, too, and decide how to deal with its messages. > > Each instance of the logger inherents from a 'parent' logger, except for the top level logger which has the name None (as in the singleton of NoneType), and unless told otherwise will inherit it properties from its parent. Thus, if you get the root logger with logging.getLogger() you can set properties there, and unless a child logger has specifical been told not to inherit or has been specifically given a different value. General convention is that modules will use their name as the name of their logger, as that is generally unique. -- Richard Damon From rsstinnett at gmail.com Mon Mar 8 10:12:50 2021 From: rsstinnett at gmail.com (Russell) Date: Mon, 8 Mar 2021 15:12:50 +0000 (UTC) Subject: editor recommendations? References: <874khs8vd7.fsf@metapensiero.it> Message-ID: Cameron Simpson wrote: >>-- Emacs outshines all other editing software in approximately the same >>way that the noonday sun does the stars. It is not just bigger and >>brighter; it simply makes everything else vanish. ??? Neal Stephenson Neal Stephenson's book Cryptonomicon was the reason I became borderline obsesseed with Emacs 20 years ago. I've only come to my senses in about the last 5 years when I started using vim. lol! Admittedly, Normal Mode takes some getting used to. I remember a quote from years ago that went something like, "Vi has two modes, edit and beep." > > A novice of the temple once approached the Chief Priest with a question. > > "Master, does Emacs have the Buddha nature?" the novice asked. > > The Chief Priest had been in the temple for many years and could be relied > upon to know these things. He thought for several minutes before replying. > > "I don't see why not. It's got bloody well everything else." > > With that, the Chief Priest went to lunch. The novice suddenly achieved > enlightenment, several years later. > > Commentary: > > His Master is kind, > Answering his FAQ quickly, > With thought and sarcasm. > > Cheers, > Cameron Simpson This is awesome! -- rust 0x68caecc97f6a90122e51c0692c88d9cb6b58a3dc From darcy at VybeNetworks.com Mon Mar 8 06:04:10 2021 From: darcy at VybeNetworks.com (D'Arcy Cain) Date: Mon, 8 Mar 2021 06:04:10 -0500 Subject: Please don't feed the trolls In-Reply-To: References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: On 2021-03-06 4:24 p.m., Terry Reedy wrote: > Trolling, among other things, is fishing with a moving line, especially > with a revolving lure, as from a moving boat.? A troll, among other > things, is that method or the lure used. You are confusing "troll" with "trawl" -- D'Arcy J.M. Cain Vybe Networks Inc. A unit of Excelsior Solutions Corporation - Propelling Business Forward http://www.VybeNetworks.com/ IM:darcy at VybeNetworks.com VoIP: sip:darcy at VybeNetworks.com From rosuav at gmail.com Mon Mar 8 16:35:52 2021 From: rosuav at gmail.com (Chris Angelico) Date: Tue, 9 Mar 2021 08:35:52 +1100 Subject: Please don't feed the trolls In-Reply-To: References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: On Tue, Mar 9, 2021 at 8:31 AM D'Arcy Cain wrote: > > On 2021-03-06 4:24 p.m., Terry Reedy wrote: > > Trolling, among other things, is fishing with a moving line, especially > > with a revolving lure, as from a moving boat. A troll, among other > > things, is that method or the lure used. > > You are confusing "troll" with "trawl" > https://en.wikipedia.org/wiki/Trolling_(fishing) ChrisA From grant.b.edwards at gmail.com Mon Mar 8 16:42:45 2021 From: grant.b.edwards at gmail.com (Grant Edwards) Date: Mon, 8 Mar 2021 21:42:45 -0000 (UTC) Subject: Please don't feed the trolls References: <82O0I.152099$cEz2.58349@fx43.ams4> Message-ID: On 2021-03-08, D'Arcy Cain wrote: > On 2021-03-06 4:24 p.m., Terry Reedy wrote: >> Trolling, among other things, is fishing with a moving line, especially >> with a revolving lure, as from a moving boat.? A troll, among other >> things, is that method or the lure used. > > You are confusing "troll" with "trawl" No, he's not. Trolling is dragging a lure through the water with a boat (usually a smallish one). https://www.minnkotamotors.com/learn/buying-guide/trolling-motors Trawling is dragging a net through the water with a boat (usually a rather large one). https://en.wikipedia.org/wiki/Fishing_trawler From pjfarley3 at earthlink.net Mon Mar 8 20:05:48 2021 From: pjfarley3 at earthlink.net (pjfarley3 at earthlink.net) Date: Mon, 8 Mar 2021 20:05:48 -0500 Subject: python curses constant names for mouse wheel movements? In-Reply-To: <000001d71321$d5aaad60$81000820$@earthlink.net> References: <000001d71321$d5aaad60$81000820$@earthlink.net> Message-ID: <002201d71480$5790dd40$06b297c0$@earthlink.net> I am replying to my own message due to the digest not appearing in my inbox yet today. I will add Alan Gould's responses and my reply to him manually. alan.gauld at yahoo.co.uk wrote: > > Where can I find any documentation of the correct curses constant name(s) to > > use for detecting a "wheel down" action? Or do I just have to manually > > define my own BUTTON5 constant name for the wheel-down event? > > I suspect you need to look in the ncurses documentation or > even the C code. And that is no guarantee that the Python > curses module will expose any values you do find other > than as numeric codes. > > I would have expected the mouse wheel down/click to appear as > a BUTTON2 event to be honest. I didn't even realize there was > a BUTTON4 event defined let alone BUTTON5. > > Incidentally, when you talk about wheel up/down are you > talking about wheel rotation events rather than actual > button down/up events? In that case 4 and 5 might make sense. > > If you find the answer please post back, I'm very interested > since I'm in the middle of writing a book on the Python curses > module and was unaware of this behaviour. A whole new area > to explore.... I'm also interested in any documentation you > have already found on it - where did you get this understanding? Alan, Yes, when I talk about wheel up/down I do mean wheel rotation events, not wheel-button-down or up click events. The latter are correctly reported by the PDCurses implementation used by windows-curses V2.2.0 as BUTTON2 events. Christoph Gohlke gave me this link to the current-version PDCurses implementation definitions for the mouse state constants, which I found very helpful: https://github.com/wmcbrine/PDCurses/blob/master/curses.h#L199 The PDCurses names defined there are exactly what I needed to see, even if the current cpython and windows-curses implementations do not support them quite yet. I can safely define them myself and adjust my code as later releases of cpython and windows-curses are updated to support them natively. This link to an ncurses man page concerning mouse events is also instructive: https://invisible-island.net/ncurses/man/curs_mouse.3x.html On that page, he says: The ALL_MOUSE_EVENTS class does not include REPORT_MOUSE_POSITION. They are distinct. For example, in xterm, wheel/scrolling mice send position reports as a sequence of presses of buttons 4 or 5 without matching button-releases. With python 3.8.7 and windows-curses 2.2.0 I am seeing from my logging that the mouse wheel rotation up/down events are indeed reported by PDCurses (and presumably by ncurses on a *ix system) as BUTTON4_PRESSED and BUTTON5_PRESSED respectively, based on the constant values listed in the PDCurses link above. HTH Peter -- From Bischoop at vimart.net Mon Mar 8 21:08:59 2021 From: Bischoop at vimart.net (Bischoop) Date: Tue, 9 Mar 2021 02:08:59 -0000 (UTC) Subject: Button placement Message-ID: I try for a while place the top button in a a middle of column=0 with span to column2 below so the button being centered to those, tried with canvas as well but with no success. Is someone with Tkinter experience able to advice what I could do? from tkinter import * from tkinter import ttk root = Tk() root.title('Password Generator') root.config(padx=10, pady=10) backg = '#06090f' canvas = Canvas(root, width=80, height=40).grid(column=0, row=0, columnspan=2,sticky=E) bgs = Button(canvas, text="Password Manager & Generator", background='#0f2a52', foreground="orange", font=("Times New Roman", 15, 'bold')).grid(column=0, row=0, pady=10, columnspan=2) long_t = Label(text='Password Length:') long_t.grid(column=0, row=1) choice_n = IntVar() choice = ttk.Combobox(width=10) w = [x for x in range(8, 16)] choice['values'] = w choice.grid(row=1, column=1) choice.current() choice.bind("<>") password_text = Label(text='Password: ') password_text.grid(row=2, column=0) password_entry = Entry(width=20) password_entry.grid(row=2, column=1) gen = Button(text='Generate Password') gen.grid(row=1, column=2, sticky=W) From __peter__ at web.de Tue Mar 9 03:00:23 2021 From: __peter__ at web.de (Peter Otten) Date: Tue, 9 Mar 2021 09:00:23 +0100 Subject: Button placement In-Reply-To: References: Message-ID: <95405b7e-029d-697a-0828-64a05430d44e@web.de> On 09/03/2021 03:08, Bischoop wrote: > > I try for a while place the top button in a a middle of column=0 with > span to column2 below so the button being centered to those, I'm not sure what you mean, do you perhaps need columnspan=3? > tried with > canvas as well but with no success. Is someone with Tkinter experience > able to advice what I could do? > > from tkinter import * > from tkinter import ttk > > root = Tk() > > root.title('Password Generator') > root.config(padx=10, pady=10) > > backg = '#06090f' # no Canvas bgs = Button( root, text="Password Manager & Generator", background='#0f2a52', foreground="orange", font=("Times New Roman", 15, 'bold') ) bgs.grid(column=0, row=0, pady=10, columnspan=3) > long_t = Label(text='Password Length:') > long_t.grid(column=0, row=1) > choice_n = IntVar() > choice = ttk.Combobox(width=10) > w = [x for x in range(8, 16)] > choice['values'] = w > choice.grid(row=1, column=1) > choice.current() > choice.bind("<>") > password_text = Label(text='Password: ') > password_text.grid(row=2, column=0) > password_entry = Entry(width=20) > password_entry.grid(row=2, column=1) > gen = Button(text='Generate Password') > gen.grid(row=1, column=2, sticky=W) > From larry.martell at gmail.com Tue Mar 9 08:00:16 2021 From: larry.martell at gmail.com (Larry Martell) Date: Tue, 9 Mar 2021 05:00:16 -0800 Subject: Best practices regarding PYTHONPATH Message-ID: Which is considered better? Having a long import path or setting PYTHONPATH? For example, in a project where 50% of the imports come from the same top level directory is it better to add that dir to the path or reference it in the import statements? From hjp-python at hjp.at Tue Mar 9 09:52:15 2021 From: hjp-python at hjp.at (Peter J. Holzer) Date: Tue, 9 Mar 2021 15:52:15 +0100 Subject: neonumeric - C++ arbitrary precision arithmetic library In-Reply-To: <6045E06B.6070607@googlemail.com> References: <82O0I.152099$cEz2.58349@fx43.ams4> <1QQ0I.503272$B9r4.27147@fx12.ams4> <87sg58c6ws.fsf@bsb.me.uk> <60440506.2020004@googlemail.com> <20210307194253.GA11051@hjp.at> <01fd01d71393$b9b64750$2d22d5f0$@verizon.net> <6045E06B.6070607@googlemail.com> Message-ID: <20210309145215.GA26932@hjp.at> On 2021-03-08 09:29:31 +0100, Mirko via Python-list wrote: > Am 07.03.2021 um 21:52 schrieb Avi Gross via Python-list: > > The precedence example used below made a strange assumption that the > > imaginary program would not be told up-front what computer language it was > > being asked to convert from. That is not the scenario being discussed as we > > have described. In any particular language, there usually is a well-known > > precedence order such as "*" coming before "+" unless you use something like > > parentheses to make your intent clear and over-ride it. > > Well, no I did not assume some kind of magical universal translator > ala Star Trek. ;-) > > The OP seems to claim, that he could compile any language by just > providing a JSON schema file which describes the language. Right. Using JSON is probably not the best choice (20 years ago everybody was using XML for everything, now everybody uses JSON for everything), but that's merely a question of readability. The functionality doesn't depend on the (meta-)syntax. > I assumed that those who tried this before did something similar. And > that is what sounds logically impossible (or at least unfeasible) to > me. How can one write a comparatively small descriptive schema that > covers all of a language's subtleties in syntax, grammar, semantics > and behavior? How does one design a programming language which covers all the subtleties in algorithms? I think these are quite similar problems. Except that it has already been proven that a very primitive programming language (the Turing machine) is sufficient to describe all algorithms, and I'm not sure that a similar prove exists for formal languages. Still, I think that the latter can be reduced to the former (I compiler is essentially such a description, so you could just use any programming language). (Such formal languages exist, for example, for formal verification of programs. I don't think any of these is truely universal, but I suspect that the restrictions are more caused by having to be "provable" in the mathematical sense and less with the variety in possible semantics.) Where the OP is wrong, IMHO, is the "comparatively small" aspect. A formal description of C will not fit into a few lines. The C standard is 670 pages, about 150 pages of which are the language proper (the rest is library, concepts, etc.) All that information has to be expressed in that formal language. Depending on the expressiveness of the language such a formal description might be quite a bit shorter (or much longer) than English prose, but it won't be dramatically shorter. And C is a relatively small language ... > I agree that my example wasn't good, since it would be just a matter > of specifying operator precedence. But there are numerous little and > large aspects to cover for any language. In the end, one would have > to write a more or less full blown parser. Yes, but writing a parser is (comparatively) easy. Parser generators have existed for decades. It's the semantics that are difficult. I'm not saying that you are wrong. I am saying that you haven't even looked at the real problems yet. hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp at hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: From qberz2005 at gmail.com Tue Mar 9 15:03:54 2021 From: qberz2005 at gmail.com (Quentin Bock) Date: Tue, 9 Mar 2021 15:03:54 -0500 Subject: "unexpected argument" Message-ID: Error 1: Space Invaders.py:90: SyntaxWarning: "is" with a literal. Did you mean "=="? if bullet_state is "fire": Error 2: line 66, in if event.key == pygame.K_SPACE: AttributeError: 'Event' object has no attribute 'key' Code: import pygame import random # Space Invaders! background = pygame.image.load('space_invader_background.png') # Title and Icon pygame.display.set_caption ("Space Invaders") icon = pygame.image.load ('space-invaders.png') pygame.display.set_icon (icon) # Player player_Image = pygame.image.load ('player.png') player_X = 370 player_Y = 480 player_X_change = 0 # Enemy enemy_Image = pygame.image.load ('invader_enemy.png.') enemy_X = random.randint(0, 800) enemy_Y = random.randint(50, 150) enemy_X_change = 5 enemy_Y_change = 35 # Bullet bullet_Image = pygame.image.load ('bullet.png') bullet_X = 0 bullet_Y = 480 bullet_X_change = 0 bullet_Y_change = 10 bullet_state = "ready" def player(x, y): screen.blit (player_Image, (x, y)) def enemy(x, y): screen.blit (enemy_Image, (x, y)) def fire_bullet(): global bullet_state bullet_state = "fire" screen.blit(bullet_Image, (x + 16, y + 10)) # Game Loop pygame.init() screen = pygame.display.set_mode ((800, 600)) running = True while running: screen.fill ((0, 0, 0)) screen.blit(background, (0, 0)) for event in pygame.event.get (): if event.type == pygame.QUIT: running = False # Check whether keystroke is being pressed if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: player_X_change = -6 if event.key == pygame.K_RIGHT: player_X_change = 6 if event.key == pygame.K_SPACE: fire_bullet(player_X, bullet_Y) if event.type == pygame.KEYUP: if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT: player_X_change = 0 #Player Movement and Boundaries player_X += player_X_change if player_X <= 0: player_X = 0 elif player_X >= 736: player_X = 736 #Enemy Movement and Boundaries enemy_X += enemy_X_change if enemy_X <= 0: enemy_X_change = 4 enemy_Y += enemy_Y_change elif enemy_X >= 736: enemy_X_change = -4 enemy_Y += enemy_Y_change # Bullet Movement if bullet_state == "fire": fire_bullet(player_X, bullet_Y) bullet_Y -= bullet_Y_change player(player_X, player_Y) enemy(enemy_X, enemy_Y) pygame.display.update() Why is it saying unexpected argument? Youtube Tutorial I'm Following: https://www.youtube.com/watch?v=FfWpgLFMI7w From pkpearson at nowhere.invalid Tue Mar 9 15:11:48 2021 From: pkpearson at nowhere.invalid (Peter Pearson) Date: 9 Mar 2021 20:11:48 GMT Subject: "unexpected argument" References: Message-ID: On Tue, 9 Mar 2021 15:03:54 -0500, Quentin Bock wrote: > Error 1: > Space Invaders.py:90: SyntaxWarning: "is" with a literal. Did you mean "=="? > if bullet_state is "fire": > > Error 2: > line 66, in > if event.key == pygame.K_SPACE: > AttributeError: 'Event' object has no attribute 'key' > > Code: > import pygame > import random [snip] > > Why is it saying unexpected argument? > Youtube Tutorial I'm Following: > https://www.youtube.com/watch?v=FfWpgLFMI7w Who is saying "unexpected argument"? I see two error messages, neither of which is "unexpected argument". -- To email me, substitute nowhere->runbox, invalid->com. From python at mrabarnett.plus.com Tue Mar 9 15:50:09 2021 From: python at mrabarnett.plus.com (MRAB) Date: Tue, 9 Mar 2021 20:50:09 +0000 Subject: "unexpected argument" In-Reply-To: References: Message-ID: On 2021-03-09 20:03, Quentin Bock wrote: > Error 1: > Space Invaders.py:90: SyntaxWarning: "is" with a literal. Did you mean "=="? > if bullet_state is "fire": > > Error 2: > line 66, in > if event.key == pygame.K_SPACE: > AttributeError: 'Event' object has no attribute 'key' > > Code: > import pygame > import random > # Space Invaders! > [snip] I see 2 problems: 1. You define "fire_bullet" to take 0 arguments, but then try to call it with 2 arguments. 2. What attributes an event has depends on the type of event. For example, KEYDOWN events have a "key" attribute, but most other types of event don't. Your code tries to look at the "key" attribute even when it's not a KEYDOWN event because of the amount of indentation. From tjreedy at udel.edu Tue Mar 9 02:20:40 2021 From: tjreedy at udel.edu (Terry Reedy) Date: Tue, 9 Mar 2021 02:20:40 -0500 Subject: Button placement In-Reply-To: References: Message-ID: On 3/8/2021 9:08 PM, Bischoop wrote: > > I try for a while place the top button in a a middle of column=0 with > span to column2 below so the button being centered to those, tried with > canvas as well but with no success. Is someone with Tkinter experience > able to advice what I could do? Say more clearly what you want/expect and what you are getting and why you are unhappy. -- Terry Jan Reedy From alan.gauld at yahoo.co.uk Tue Mar 9 05:11:37 2021 From: alan.gauld at yahoo.co.uk (Alan Gauld) Date: Tue, 9 Mar 2021 10:11:37 +0000 Subject: python curses constant names for mouse wheel movements? In-Reply-To: <002201d71480$5790dd40$06b297c0$@earthlink.net> References: <000001d71321$d5aaad60$81000820$@earthlink.net> <002201d71480$5790dd40$06b297c0$@earthlink.net> Message-ID: On 09/03/2021 01:05, pjfarley3 at earthlink.net wrote: > I am replying to my own message due to the digest not appearing in my inbox > yet today. I will add Alan Gould's responses and my reply to him manually. > Yes, when I talk about wheel up/down I do mean wheel rotation events, not > wheel-button-down or up click events. The latter are correctly reported by > the PDCurses implementation used by windows-curses V2.2.0 as BUTTON2 events. > > Christoph Gohlke gave me this link to the current-version PDCurses > implementation definitions for the mouse state constants, which I found very > helpful: > > https://github.com/wmcbrine/PDCurses/blob/master/curses.h#L199 > > The PDCurses names defined there are exactly what I needed to see, even if > the current cpython and windows-curses implementations do not support them > quite yet. I can safely define them myself and adjust my code as later > releases of cpython and windows-curses are updated to support them natively. Thanks, I've done some tests and I see the events as WHEEL FORWARD - 0x10000 or curses.BUTTON4_PRESSED WHEEL BACK - 0x200000 but not defined in the curses module That's using ncurses on Linux. Do you get the same mask value under PDcurses on Windows? I suspect in the real world I'd probably create my own definitions as WHEEL_FORWARD and WHEEL_BACKWARD just for readability. > This link to an ncurses man page concerning mouse events is also > instructive: > > https://invisible-island.net/ncurses/man/curs_mouse.3x.html Thanks for that, I hadn't spotted that there was a mouse man page before... -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos From Bischoop at vimart.net Tue Mar 9 06:24:35 2021 From: Bischoop at vimart.net (Bischoop) Date: Tue, 9 Mar 2021 11:24:35 -0000 (UTC) Subject: Button placement References: <95405b7e-029d-697a-0828-64a05430d44e@web.de> Message-ID: On 2021-03-09, Peter Otten <__peter__ at web.de> wrote: > On 09/03/2021 03:08, Bischoop wrote: >> >> I try for a while place the top button in a a middle of column=0 with >> span to column2 below so the button being centered to those, > > I'm not sure what you mean, do you perhaps need columnspan=3? > > You were sure :-) columnspan=3 helped, I didn't know that I can apply it to 3 when not having column=3, was trying just with columnspan=2 but as you know it didn't do the job. I was swearing when fighting with it with padding lol. -- Thanks > From sb.monzur at gmail.com Tue Mar 9 16:07:14 2021 From: sb.monzur at gmail.com (S Monzur) Date: Wed, 10 Mar 2021 03:07:14 +0600 Subject: How to loop over a text file (to remove tags and normalize) using Python Message-ID: Dear List, Newbie here. I am trying to loop over a text file to remove html tags, punctuation marks, stopwords. I have already used Beautiful Soup (Python v 3.8.3) to scrape the text (newspaper articles) from the site. It returns a list that I saved as a file. However, I am not sure how to use a loop in order to process all the items in the text file. In the code below I have used listfilereduced.text(containing data from one news article, link to listfilereduced.txt here ), however I would like to run this code on listfile.text(containing data from multiple articles, link to listfile.text ). Any help would be greatly appreciated! P.S. The text is in a Non-English script, but the tags are all in English. #The code below is for a textfile containing just one item. I am not sure how to tweak this to make it run for listfile.text (which contains raw data from multiple articles) with open('listfilereduced.txt', 'r', encoding='utf8') as my_file: rawData = my_file.read() print(rawData) #Separating body text from other data articleStart = rawData.find("
") articleData = rawData[:articleStart] articleBody = rawData[articleStart:] print(articleData) print("*******") print(articleBody) print("*******") #First, I define a function to strip tags from the body text def stripTags(pageContents): insideTag = 0 text = '' for char in pageContents: if char == '<': insideTag = 1 elif (insideTag == 1 and char == '>'): insideTag = 0 elif insideTag == 1: continue else: text += char return text #Calling the function articleBodyText = stripTags(articleBody) print(articleBodyText) ##Isolating article title and publication date TitleEndLoc = articleData.find("") dateStartLoc = articleData.find("