Issue so I have a MacBook Air running 11.2.1 Big Sur pip –version returns this output: pip 20.2.1 from /Library/Python/2.7/site-packages/pip-20.2.1-py2.7.egg/pip (python 2.7) when I type python into the terminal, it automatically loads python 2.7, and python3 loads python 3.8.2 like
Continue readingTag: python-2.7
[SOLVED] Problem of "Memory limit exceeded" and "Time limit exceeded" in Python
Issue I have a problem to solve on the online judge. Its solution is to make the sum of the integer for example input 4, so 1+2+3+4 the output 10. For another example, the input is 10, so get sum
Continue reading[SOLVED] Can a lambda function be a class attribute?
Issue I would like to have some lambda functions available to all instances of one class. Therefore, my idea was to declare the lambda function as class attribute. In the following simplistic code, why can’t I evaluate the following lambda
Continue reading[SOLVED] Adding delimiters and removing commas
Issue I have a file from which I’ve output several columns of information, 4 to be exact. At this moment they are separated by commas, but in order for my buddy to feed them into another script, he wants the
Continue reading[SOLVED] Brew fails to install Python: can not symlink
Issue I’m trying to install python 2.7 on the latest version of OSX using brew but I get the following error… .app bundles were installed. Run `brew linkapps` to symlink these to /Applications. Warning: Could not link python. Unlinking… Error:
Continue reading[SOLVED] Google Foobar L4: Bringing a gun to a trainer fight
Issue I started this problem a couple days ago (code below). Bringing a Gun to a Trainer Fight ================================= Uh-oh — you’ve been cornered by one of Commander Lambdas elite bunny trainers! Fortunately, you grabbed a beam weapon from an
Continue reading[SOLVED] tkinter grid manager not working, columns
Issue Python version 2.7 (I know it’s dated) I have searched throught several answers and haven’t found a solution. I’m trying to get this label : w = Label(root, text=”This label”, fg=”red”, font=(“Helvetica”, 16)) w.grid(row=5, column=20) to basically any other
Continue reading[SOLVED] Python 2.7 lxml: How to replace a tag with a comment
Issue I have the fallowing XML: <?xml version=’1.0′ encoding=’UTF-8′?> <A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://obe.nce.amadeus.net/bms/metadata/1-0/"> <B name="NAME" version="VERSION"> <AA>SOME NAME</AA> <CC>SOME OTHER NAME</CC> </B> <C> <SOME1> <TAG_3 name="NAME_1" path="path_1"/> <TAG_3 name="NAME_2" path="path_2"/> <TAG_3 name="NAME_3" path="path_3"/> </SOME1> <SOME2> <TAG_3 name="NAME_4" path="path_1"/> <TAG_3 name="NAME_5" path="path_2"/>
Continue reading[SOLVED] Python getpass.getpass() function call hangs
Issue I am trying to get a prompt that will ask for my password but when I try to call getpass.getpass() it just freezes. I am running on Windows 7 64 bit using Python 2.7 on Canopy. import sys import
Continue reading[SOLVED] Is del or pop preferred when removing elements from dicts
Issue I’m relatively new to Python, and was wondering if there is any reason to prefer one of these methods over the other when removing elements from a dict? A) Using del # d is a dict, k is a
Continue reading