Conversation
Notices
-
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 02:07:08 JST menherahair loli haet python -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 02:07:17 JST Machismo @menherahair What about loli snek? -
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 03:13:01 JST menherahair @Zerglingman I keep writing it like it has autovivification but it doesn't Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 03:14:30 JST Machismo @menherahair ... And has vowed to vanquish these vile and virulent vermin vanguarding vice and violently vouchsafing the violation of volition! -
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 03:23:02 JST menherahair @Zerglingman howw do I access variables in main() if I run the file with python -i -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 03:23:19 JST Machismo @menherahair main() as in a function defined in that file? -
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 03:24:06 JST menherahair @Zerglingman yee Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 03:24:41 JST Machismo @menherahair Same way you extract variables from a function any other time.
I'm a fan of returning them, myself. -
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 03:29:14 JST menherahair @Zerglingman no I'm trying to debug the file with -i. I run python -i ./baz.py, it loads the file, runs main() because I told it to, main() craps out some error and I want to inspect the state inside that in the repl Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 03:34:16 JST Machismo @menherahair Do you need __name__=='__main__' in baz? If not just use pdb and step through it. (ie. just open python interp, import pdb and baz, wrap baz in pdb.run or w/e)
If you do...
... It's probably less hassle to play with importlib to forcibly set __name__ before loading it than it is to do it with -i (or read the file in as a string, set __name__ before the first line, and eval it 笑) -
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 03:37:10 JST menherahair @Zerglingman could've just said python -m pdb Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 03:37:49 JST Machismo @menherahair -m is weird, I never use it -
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 03:41:29 JST menherahair @Zerglingman does python believe there is preferably only one ideal way to import every module Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 03:41:35 JST Machismo @menherahair import module -
menherahair (menherahair@eientei.org)'s status on Sunday, 17-Dec-2023 14:06:38 JST menherahair @Zerglingman import module as NIGGERS -
Machismo (zerglingman@freespeechextremist.com)'s status on Sunday, 17-Dec-2023 14:06:42 JST Machismo @menherahair Based -
Hachikuji Mayoi (douse_niggers_in_gasoline_and_light_them_up@eientei.org)'s status on Sunday, 17-Dec-2023 14:07:58 JST Hachikuji Mayoi @menherahair @Zerglingman python has at least 10 ways to import a module and that's just standard documented syntax ignoring any obscure variables. Machismo likes this.
-