diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-05-28 12:15:54 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-05-28 12:15:54 +1000 |
| commit | c547ba59906bdd0ccebe5d4592739227dd0c73eb (patch) | |
| tree | 99e35a5c0edd4c473b3b760a2d1cc75153572b6b /backend/data/genEnwikiDescData.py | |
| parent | 9f0dcdea1049a59cd1fb4f0872edee1b7a87a4e6 (diff) | |
Convert from python "...".format() to f"..."
Diffstat (limited to 'backend/data/genEnwikiDescData.py')
| -rwxr-xr-x | backend/data/genEnwikiDescData.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/data/genEnwikiDescData.py b/backend/data/genEnwikiDescData.py index 40a6c92..57e4194 100755 --- a/backend/data/genEnwikiDescData.py +++ b/backend/data/genEnwikiDescData.py @@ -25,7 +25,7 @@ nodeNames = set() query = "SELECT nodes.name FROM nodes LEFT JOIN descs ON nodes.name = descs.name WHERE desc IS NULL" for row in dbCur.execute(query): nodeNames.add(row[0]) -print("Found {} names".format(len(nodeNames))) +print(f"Found {len(nodeNames)} names") # Find page id for each node name print("Getting node page-ids") nodeToPageId = {} @@ -33,7 +33,7 @@ iterNum = 0 for name in nodeNames: iterNum += 1 if iterNum % 1e4 == 0: - print("At iteration {}".format(iterNum)) + print(f"At iteration {iterNum}") # row = enwikiCur.execute("SELECT id FROM pages WHERE pages.title = ? COLLATE NOCASE", (name,)).fetchone() if row != None: @@ -45,7 +45,7 @@ iterNum = 0 for (name, pageId) in nodeToPageId.items(): iterNum += 1 if iterNum % 1000 == 0: - print("At iteration {}".format(iterNum)) + print(f"At iteration {iterNum}") # row = enwikiCur.execute( "SELECT pages.id FROM redirects INNER JOIN pages ON redirects.target = pages.title WHERE redirects.id = ?", @@ -59,7 +59,7 @@ iterNum = 0 for (name, pageId) in nodeToPageId.items(): iterNum += 1 if iterNum % 1000 == 0: - print("At iteration {}".format(iterNum)) + print(f"At iteration {iterNum}") # row = enwikiCur.execute("SELECT desc FROM descs where descs.id = ?", (pageId,)).fetchone() if row != None: |
