Thursday, March 30, 2023
Wednesday, March 29, 2023
Toggle Visibility of a SelectBox with a CheckBox without JavaScript, only with CSS
<html>
<body>
<style>
select {
display: none;
}
.toggleselectbox:checked + .selectpivot {
display: inline;
}
</style>
<fieldset>
<legend>Display select box when the checkbox is checked:</legend>
<div class="custom-select" style="width:400px;">
<label for="toggleselectbox">Toggle pivot language</label>
<input type="checkbox" id="toggleselectbox" class="toggleselectbox" name="toggleselectbox" value="Toggle">
<select class="selectpivot" id="selectpivot">
<option value="0" disabled>Select pivot language:</option>
<option value="DE">DE</option>
<option value="EN" selected>EN</option>
<option value="RO">RO</option>
<option value="IT">IT</option>
<option value="SP">SP</option>
</select>
</fieldset>
</div>
</body>
</html>
Friday, March 17, 2023
Culori HTML
- Abanos - #000000
- Absint - #7fdd4c
- Acaju - #88421d
- Acaju închis - #2f1b0c
- Acvamarin - #79f8f8
- Alabastru - #fefefe
- Alb - #ffffff
- Alb de lapte - #fbfcfa
- Alb de Lună - #f4fefe
- Alb de Spania (pigment) - #fefdf0
- Alb de zinc (pigment) - #f6fefe
- Alb-roșcat - #e9c9b1
- Albastru canar - #048b9a
- Albastru celest - #26c4ec
- Albastru cobalt (pigment) - #22427c
- Albastru de chiciură - #80d0d0
- Albastru electric - #2c75ff
- Albastru foca - #03224c
- Albastru metalic - #3a8eba
- Albastru mineral - #24445c
- Albastru persan - #6600ff
- Albastru petrol - #1d4851
- Albastru primar - #0000ff
- Albastru regal - #318ce7
- Albastru safir - #0131b4
- Albastru turcoaz - #25fde9
- Albastrul cerului - #77b5fe
- Alună - #955628
- Ametist - #884da7
- Antracit - #303030
- Argilă - #efefef
- Argintiu - #cecece
- Arsenic - #fcd21c
- Arămiu - #ad4f09
- Asfințit - #ffcb60
- Auriu - #d2cb0f
- Avocado - #568203
- Azur (heraldic) - #1e7fcb
- Azur brumă - #f0ffff
- Azurin - #a9eafe
- Azuriu - #74d0f1
- Banană - #d1b606
- Bej - #c8ad7f
- Bitum - #4e3d28
- Blond (păr) - #e2bc74
- Blond flav (culoare) - #e6e697
- Blond venețian (păr) - #e7a854
- Bordo - #6d071a
- Bronz - #87591a
- Bronz - #614e1a
- Brun - #5b3c11
- Brun deschis - #cd853f
- Brun închis - #3f2204
- Brunet (ten, păr) - #2f1e0e
- Caca d'oie - #cdcd0d
- Cacao - #614b3a
- Cafea - #462e01
- Cafea cu lapte - #785e2f
- Cafeniu deschis (heraldic) - #a75502
- Caisă - #e67e30
- Capucin - #ff5e4d
- Caramel - #7e3300
- Carmin - #960018
- Castaniu - #8b6c42
- Castană - #806d5a
- Celadon - #83a697
- Cerulen - #357ab7
- Chamois - #d0c07a
- Chaudron - #85530f
- Chihlimbar galben - #f0c300
- Chihlimbar roșu - #ad390e
- Cinabre - #db1702
- Ciocolată - #5a3a22
- Cireașă - #bb0b0b
- Clarissimo (trabuc) - #b9b276
- Claro (trabuc) - #845a3b
- Claro claro (trabuc) - #ba9b61
- Coacăză neagră - #3a020d
- Coacăză roșie - #cf0a1d
- Coadă-de-vacă deschis - #c3b470
- Coadă-de-vacă închis - #a89874
- Coajă de ou - #fde9e0
- Coapsă de nimfă - #fee7f0
- Colombin (învechit) - #6a455d
- Colorado (trabuc) - #703516
- Colorado claro (trabuc) - #6a4b21
- Coral - #e73e01
- Cositor oxidat - #bababa
- Cositor pur - #ededed
- Crem - #fdf1b8
- Cupru - #b36700
- Căpșună - #bf3030
- Căpșună zdrobită - #a42424
- Cărbune - #000010
- Cărămiziu - #842e1b
- Denim - #1560bd
- Dovleac - #df6d14
- Drojdie de vin - #ac1e44
- Fier (heraldic) - #848484
- Fildeș - #ffffd4
- Fistic - #bef574
- Floare de sulf - #ffff6b
- Foc viu - #ff4901
- Foiță de ceapă (enologie) - #d58490
- Frunză moartă - #99512b
- Fucsia - #fd3f92
- Galben auriu - #efd242
- Galben canar - #e7f00d
- Galben de aur - #efd807
- Galben de crom (pigment) - #edff0c
- Galben de martie - #eed153
- Galben de Napoli (pigment) - #fff0bc
- Galben imperial - #ffe436
- Galben mimoză - #fef86c
- Galben muștar - #c7cf00
- Galben nanchin - #f7e269
- Galben nasture de aur - #f6dc12
- Galben pai - #fee347
- Galben porumb - #ffde75
- Galben puișor - #f7e35f
- Galben secundar - #ffff00
- Garoafă (heraldic) - #fec3ac
- Glycine - #c9a0dc
- Grej - #bbae98
- Grenadină - #e9383f
- Gri - #606060
- Gri afumat - #bbd2e1
- Gri bej (heraldic) - #f1e2be
- Gri cârtiță - #463f32
- Gri de in - #d2caec
- Gri de Payne - #677179
- Gri fier - #7f7f7f
- Gri gălbui (cabalin) - #c1bfb1
- Gri maur - #685e43
- Gri oțel - #afafaf
- Gri Pinchard (cabalin) - #cccccc
- Gri plumb - #798081
- Gri turturea - #bbacac
- Gri închis - #766f64
- Gri șoarece - #9e9e9e
- Grâu - #e8d630
- Havana - #947f60
- Heliotrop - #df73ff
- In - #faf0e6
- Indigo - #791cf8
- Indigo închis - #2e006c
- Jad - #87e990
- Kaki - #94812b
- Lapis-lazuli - #26619c
- Lavallière (copertă) - #8f5922
- Lavandă - #9683ec
- Liliac - #b666d2
- Lișiță - #008e8e
- Lămâie - #f7ff3c
- Mac - #c60800
- Maduro (trabuc) - #372f25
- Magenta fucsia (cerneală) - #db0073
- Magenta secundar - #ff00ff
- Magenta închis - #800080
- Malachită - #1fa055
- Mandarină - #fea347
- Maro - #582900
- Mastic - #b3b191
- Mentă - #16b84e
- Mentă de apă - #54f98d
- Miere - #dab30a
- Morcov - #f4661b
- Mov - #d473d4
- Nacarat - Roșu sidef - #fc5d5d
- Negru de anilină - #120d16
- Negru de carbon (pigment) - #130e0a
- Ocru - #fefee0
- Ocru galben - #dfaf2c
- Ocru roșu - #dd985c
- Oliv - #708d23
- Opalin - #f2ffff
- Orhidee - #da70d6
- Oscuro (trabuc) - #292107
- Papaia - #ffefd5
- Papier bulle - #edd38c
- Parma - #cfa0e9
- Passe-velours - #91283b
- Pastel - #56739a
- Pepene galben - #de9816
- Pervenche - #ccccff
- Piele de cămilă - #b67823
- Piersică - #fdbfb7
- Platină - #faf0c5
- Portocaliu - #ed7f10
- Portocaliu închis - #cc5500
- Prasin - #4ca66b
- Prună - #811453
- Purice - #4e1609
- Purpură - #9e0e40
- Purpură (heraldic) - #965578
- Pământ de Siena ars - #967c5c
- Rouge tomette - #ae4a34
- Roz - #fd6c9e
- Roz balais (minéraux) - #c4698f
- Roz bonbon - #f9429e
- Roz ceai - #ff866a
- Roz drajeu - #febfd2
- Roz Incarnadin - #fe96a0
- Roz Incarnat - #ff6f7d
- Roz Mountbatten - #997a8d
- Roșu - #ff0000
- Roșu Andrinopol - #a91101
- Roșu aprins - #ed0000
- Roșu Bismarck - #a5260a
- Roșu bourgogne - #6b0d0d
- Roșu cardinal - #b82010
- Roșu cărămiziu - #bc2001
- Roșu de alizarină (pigment) - #d90115
- Roșu de cuarț (heraldic) - #149414
- Roșu de roibă - #ee1010
- Roșu de sânge - #850606
- Roșu de tomată - #de2916
- Roșu englez - #f7230c
- Roșu Ferrari - #d32232
- Roșu Gueules (heraldic) - #e21313
- Roșu înfocat - #fe1b00
- Roșu-violet - #c71585
- Ruginiu - #985717
- Réglisse - #2d241e
- Sable - #e0cda9
- Scorțișoară - #7e5835
- Senois (heraldic) - #8d4024
- Sepia - #ae8964
- Smalt - #003399
- Smarald - #01d758
- Somon - #f88e55
- Stacojiu - #ff0921
- Sânge de vită - #730800
- Tabac - #9f551e
- Terre d'ombre - #926d27
- Terre de Sienne - #8e5434
- Topaz - #faea73
- Turcoaz - #2bfafa
- Turcoaz secundar - #00ffff
- Unt - #f0e36b
- Vanilie - #e1ce9a
- Verde amandă - #82c46c
- Verde anis - #9fe855
- Verde chartreuse - #c2f732
- Verde de apă - #b0f2b6
- Verde de Hooker - #1b4f08
- Verde de primăvară - #00fe7e
- Verde de sticlă - #096a09
- Verde de tei - #a5d152
- Verde de Verona (pigment) - #5a6521
- Verde de vezică - #22780f
- Verde englez - #18391e
- Verde gazon - #3a9d23
- Verde gri - #95a595
- Verde imperial - #00561b
- Verde kaki - #798933
- Verde lariță - #386f48
- Verde lichen - #85c17e
- Verde lime - #9efd38
- Verde marin - #649b88
- Verde militar - #596643
- Verde mușchi - #679f5a
- Verde măr - #34c924
- Verde opalin - #97dfc6
- Verde papagal - #3af24b
- Verde pin - #01796f
- Verde preri - #57d53b
- Verde primaire - #00ff00
- Verde salvie - #689d71
- Verde sapin - #095228
- Verde spanac - #175732
- Verde turcoaz - #1ffed8
- Violet - #8806ce
- Violet episcopal - #723e64
- Violine - #a10684
- Viride - #40826d
- Vișiniu - #6e0b14
- Zinzolin (fr) (Conabiu) - #6c0277
- Zmeură - #c72c48
- Șampanie - #fbf2b7
- șofran - #f3d617
HTML Colours - English
- aliceblue - #f0f8ff
- antiquewhite - #faebd7
- aqua / cyan - #00ffff
- aquamarine - #7fffd4
- azure - #f0ffff
- beige - #f5f5dc
- bisque - #ffe4c4
- black - #000000
- blanchedalmond - #ffebcd
- blue - #0000ff
- blueviolet - #8a2be2
- brown - #a52a2a
- burlywood - #deb887
- cadetblue - #5f9ea0
- chartreuse - #7fff00
- chocolate - #d2691e
- coral - #ff7f50
- cornflowerblue - #6495ed
- cornsilk - #fff8dc
- crimson - #dc143c
- darkblue - #00008b
- darkcyan - #008b8b
- darkgoldenrod - #b8860b
- darkgray - #a9a9a9
- darkgreen - #006400
- darkkhaki - #bdb76b
- darkmagenta - #8b008b
- darkolivegreen - #556b2f
- darkorange - #ff8c00
- darkorchid - #9932cc
- darkred - #8b0000
- darksalmon - #e9967a
- darkseagreen - #8fbc8f
- darkslateblue - #483d8b
- darkslategray - #2f4f4f
- darkturquoise - #00ced1
- darkviolet - #9400d3
- deeppink - #ff1493
- deepskyblue - #00bfff
- dimgray - #696969
- dodgerblue - #1e90ff
- firebrick (Fire Brick) - #b22222
- floralwhite - #fffaf0
- forestgreen - #228b22
- fuchsia / magenta - #ff00ff
- gainsboro - #dcdcdc
- ghostwhite - #f8f8ff
- gold - #ffd700
- goldenrod - #daa520
- gray - #808080
- green - #008000
- greenyellow - #adff2f
- honeydew - #f0fff0
- hotpink - #ff69b4
- indianred - #cd5c5c
- indigo - #4b0082
- ivory - #fffff0
- khaki - #f0e68c
- lavender - #e6e6fa
- lavenderblush - #fff0f5
- lawngreen - #7cfc00
- lemonchiffon - #fffacd
- lightblue - #add8e6
- lightcoral - #f08080
- lightcyan - #e0ffff
- lightgoldenrodyellow - #fafad2
- lightgray - #d3d3d3
- lightgreen - #90ee90
- lightpink - #ffb6c1
- lightsalmon - #ffa07a
- lightseagreen - #20b2aa
- lightskyblue - #87cefa
- lightslategray - #778899
- lightsteelblue - #b0c4de
- lightyellow - #ffffe0
- lime - #00ff00
- limegreen - #32cd32
- linen - #faf0e6
- maroon - #800000
- mediumaquamarine - #66cdaa
- mediumblue - #0000cd
- mediumorchid - #ba55d3
- mediumpurple - #9370db
- mediumseagreen - #3cb371
- mediumslateblue - #7b68ee
- mediumspringgreen - #00fa9a
- mediumturquoise - #48d1cc
- mediumvioletred - #c71585
- midnightblue - #191970
- mintcream - #f5fffa
- mistyrose - #ffe4e1
- moccasin - #ffe4b5
- navajowhite - #ffdead
- navy - #000080
- oldlace - #fdf5e6
- olive - #808000
- olivedrab - #6b8e23
- orange - #ffa500
- orangered - #ff4500
- orchid - #da70d6
- palegoldenrod - #eee8aa
- palegreen - #98fb98
- paleturquoise - #afeeee
- palevioletred - #db7093
- papayawhip - #ffefd5
- peachpuff - #ffdab9
- peru - #cd853f
- pink - #ffc0cb
- plum - #dda0dd
- powderblue - #b0e0e6
- purple - #800080
- red - #ff0000
- rosybrown - #bc8f8f
- royalblue - #4169e1
- saddlebrown - #8b4513
- salmon - #fa8072
- sandybrown - #f4a460
- seagreen - #2e8b57
- seashell - #fff5ee
- sienna - #a0522d
- silver - #c0c0c0
- skyblue - #87ceeb
- slateblue - #6a5acd
- slategray - #708090
- snow - #fffafa
- springgreen - #00ff7f
- steelblue - #4682b4
- tan - #d2b48c
- teal - #008080
- thistle - #d8bfd8
- tomato - #ff6347
- turquoise - #40e0d0
- violet - #ee82ee
- wheat - #f5deb3
- white - #ffffff
- whitesmoke - #f5f5f5
- yellow - #ffff00
- yellowgreen - #9acd32
Tuesday, March 14, 2023
Python - Get All Variables in a Module
Searching for: python get all variables in module
There are different ways to get all the variables in a Python module. One way is to use the dir() function, which returns a list of names of all the functions and variables present in a module1. Another way is to use the inspect library, which has a getmembers() function that gets all the members, such as methods, variables, classes, etc., present inside a class or a module21.
1. tutorialspoint.com2. delftstack.com3. stackoverflow.com4. stackoverflow.com5. w3schools.com
Searching for: python get variables of a module
To get the variables of a module, you can use the getattr() function, which takes a module object and a variable name as arguments and returns the value of that variable1. Another way is to use the vars() function, which returns a dictionary of all the attributes and values of a module object2.
1. stackoverflow.com2. stackoverflow.com3. w3schools.com
Here are some examples of how to use the getattr() and vars() functions to get the variables of a module.
Let’s say you have a module called mymodule.py that contains the following code:
# mymodule.py
x = 10
y = 20
z = 30
def add(a, b):
return a + b
To get the value of the variable x from this module, you can use the getattr() function like this:
# another file that imports mymodule
import mymodule
x_value = getattr(mymodule, "x")
print(x_value) # prints 10
To get a dictionary of all the attributes and values of this module, you can use the vars() function like this:
# another file that imports mymodule
import mymodule
mymodule_dict = vars(mymodule)
print(mymodule_dict) # prints {'__name__': 'mymodule', '__doc__': None, '__package__': None, '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x000001E9B6F8A4C0>, '__spec__': None, '__file__': 'C:\\Users\\User\\Desktop\\mymodule.py', '__cached__': None, 'x': 10, 'y': 20, 'z': 30, 'add': <function add at 0x000001E9B6F8A940>}
I hope these examples help you understand how to get the variables of a module in Python.
How do I filter out only the variables and not the functions or other attributes?
Searching for: python filter variables from module dictionary
To filter out only the variables and not the functions or other attributes from a module dictionary, you can use a filtering function that checks the type of each value. For example, you can use the isinstance() function to check if a value is an instance of a certain class, such as int, str, float, etc. You can also use the filter() function to apply the filtering function to each key-value pair in the dictionary and return an iterable of the filtered items1.
Here is an example of how to filter out only the variables from the module dictionary we got earlier:
# another file that imports mymodule
import mymodule
mymodule_dict = vars(mymodule)
# define a filtering function that returns True if the value is an instance of int, str or float
def is_variable(item):
key, value = item # unpack each key-value pair into two variables
return isinstance(value, (int, str, float)) # check if value is an instance of int, str or float
# use filter() to apply the filtering function to each item in mymodule_dict and get an iterable of filtered items
filtered_items = filter(is_variable, mymodule_dict.items())
# convert filtered_items into a dictionary using dict()
filtered_dict = dict(filtered_items)
print(filtered_dict) # prints {'x': 10, 'y': 20, 'z': 30}