What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-27 21:11:03
reading doc in python
from bs4 import BeautifulSoup as bs soup = bs(open(filename).read()) [s.extract() for s in soup(['style', 'script'])] tmpText = soup.get_text() text = "".join("".join(tmpText.split('\t')).split('\n')).encode('utf-8').strip() print text Add solution -
Python 2021-09-26 01:33:04
matplotlib get and chan values of tick labels
import matplotlib.pyplot as plt fig, ax = plt.subplots() # We need to draw the canvas, otherwise the labels won't be positioned and # won't have values yet. fig.canvas.draw() labels = [item.get_text() for item in ax.get_xticklabels()] labels[1] = 'Tes... Add solution -
Javascript 2021-09-24 19:45:02
text color in react js
import React from 'react'; export const UserContext = React.createContext(); export default function App() { return ( <UserContext.Provider value="Reed"> <User /> </UserContext.Provider> ) } function User()... Add solution -
Java 2021-09-24 19:27:06
get string of radio button in android
import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Toast; pub... Add solution -
Python 2021-09-24 12:41:04
high precision, decimal, float, mpmath
#!/usr/bin/python from decimal import Decimal, getcontext import math import mpmath getcontext().prec = 50 mpmath.mp.dps = 50 num = Decimal(1) / Decimal(7) num2 = mpmath.mpf(1) / mpmath.mpf(7) print(" math.sqrt: {0}".format(Decimal(math.s... Add solution -
Javascript 2021-09-24 11:54:02
show more implementation jquery
var $li = $('ul li'); var $shPets = $('.shPets'); $shPets.each(function() { var petType = $(this).data('pet'); $('ul li[data-pet=' + petType + ']') .not('.shPets') //not shPets .not(':first') //everything except first .hide(); }); $('.sh... Add solution
Best helpers
Ranking is empty