This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while True: | |
| try: | |
| height = int(input("Enter a number between 0 and 23: ")) | |
| except (ValueError): | |
| print("Not an integer!") | |
| continue | |
| else: | |
| if not 0 <= height <= 23: | |
| print("Height's smaller than 0 or bigger than 23") | |
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def addCoin(): | |
| coinlist = [] | |
| while True: | |
| coinlist.append(input("\nPlease select a coin you want to track:\n").upper()) | |
| print("\nThe list of coins you're currently tracking is: \n" + "\n".join(coinlist) + "\n") | |
| yesorno = input("Do you want to add another one? (Y/N): ").upper() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def removeCoin(): | |
| coinlist = ["a", "b", "c", "d"] | |
| while True: | |
| print("\nThe list of coins you're currently tracking is: \n" + "\n".join(coinlist) + "\n") | |
| yes_or_no = input("Do you want to remove a coin from the list? (Y/N):").upper() | |
| if yes_or_no == "Y": | |
| try: | |
| coinlist.remove(input("Which coin do you want to remove?").upper()) | |
| print("\nThe list of coins you're currently tracking is: \n" + "\n".join(coinlist) + "\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var mammoth = require("mammoth"); | |
| mammoth.convertToHtml({path: "path/to/document.docx"}) | |
| .then(function(result){ | |
| var html = result.value; // The generated HTML | |
| var messages = result.messages; // Any messages, such as warnings during conversion | |
| }) | |
| .done(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> | |
| <Relationship Id="rId3" Target="settings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"/> | |
| <Relationship Id="rId7" Target="theme/theme1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"/> | |
| <Relationship Id="rId2" Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"/> | |
| <Relationship Id="rId1" Target="numbering.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var parseFile = require("./jsxmlparser.js"); | |
| // ReferenceError: mypath is not defined | |
| // at Object.<anonymous> (C:\Users\Aquazi\Desktop\Traducee\jsxmlparser.js:4:17) | |
| // | |
| // at Module._compile (module.js:624:30) | |
| // at Object.Module._extensions..js (module.js:635:10) | |
| // at Module.load (module.js:545:32) | |
| // at tryModuleLoad (module.js:508:12) | |
| // at Function.Module._load (module.js:500:3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require("fs"); | |
| var path = require("path"); | |
| var cheerio = require("cheerio"); | |
| module.exports = (mypath) => { | |
| var inputFile = fs.readFileSync(mypath, "utf8"); | |
| var $ = cheerio.load(inputFile, {xmlMode:true}); | |
| // defines the selector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > $("w\\:body").children().eq(2) | |
| initialize { | |
| '0': | |
| { type: 'tag', | |
| name: 'w:p', | |
| attribs: | |
| { 'w:rsidRPr': '008D7D78', | |
| 'w:rsidR': '00AA2A68', | |
| 'w:rsidP': '008D7D78', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let x function(){ | |
| console.log("i am called from inside a function") | |
| }; | |
| let y = function(callback){ | |
| console.log("do something"); | |
| callback(); | |
| }; | |
| y(x); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let x function(){ | |
| console.log("i am called from inside a function") | |
| }; | |
| let y = function(callback){ | |
| console.log("do something"); | |
| callback(); | |
| }; | |
| y(x); |
OlderNewer