please help with python code, i will need to open a file, but inside the text file has three columns the first column is english, second column morse code, third column is phoneticand  i want to find the morse code inside the file, and make it morse dictionary, for example make it like this: {"A":  ".-", "B": "-...", etc}  or is there anyway that i can use dictionary to covert all three column into the dictionary then i can skip part above? heres my code, and the file that i need to open.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

please help with python code, i will need to open a file, but inside the text file has three columns the first column is english, second column morse code, third column is phoneticand 

i want to find the morse code inside the file, and make it morse dictionary, for example make it like this: {"A":  ".-", "B": "-...", etc} 

or is there anyway that i can use dictionary to covert all three column into the dictionary then i can skip part above? heres my code, and the file that i need to open.

def fonts(font):
#morse_dic= {(}
with open(font,"r") as infile:
for line in infile:
morse= dict(line.findall(r'(\w)\d+([-]+)'))
#(key, val) = line.split()
#new[str(key)] = val
#return morse
Transcribed Image Text:def fonts(font): #morse_dic= {(} with open(font,"r") as infile: for line in infile: morse= dict(line.findall(r'(\w)\d+([-]+)')) #(key, val) = line.split() #new[str(key)] = val #return morse
METADATA ENGLISH MORSE PHONETIC
A.- ALPHA
B -.. BRAVO
C--. CHARLIE
-.-.
D -. DELTA
E. ECHO
F.-. FOXTROT
G --. GOLF
H . HOTEL
---.
I. INDIA
J.--- JULIETT
K-.- KILO
L-. LIMA
....
M-- MIΚΕ
N-. NOVEMBER
O --- OSCAR
Р-- РАРА
Q --- QUEBEC
R.-. ROMEO
S . SIERRA
T- TANGO
U.- UNIFORM
V .- VICTOR
WHISKEY
--
X--- XRAY
- YANKEE
Z --. ZULU
Y-
---
...
ZEE-ROW
1
WUN
----
2 .--- TOO
3
- TREE
-
4
FOW-ER
5
FIFE
6 -
SIX
7 -
SEV-VEN
---.. ATE
NIN-ER
9 -
---.
!
BANG
.--
STOP
Transcribed Image Text:METADATA ENGLISH MORSE PHONETIC A.- ALPHA B -.. BRAVO C--. CHARLIE -.-. D -. DELTA E. ECHO F.-. FOXTROT G --. GOLF H . HOTEL ---. I. INDIA J.--- JULIETT K-.- KILO L-. LIMA .... M-- MIΚΕ N-. NOVEMBER O --- OSCAR Р-- РАРА Q --- QUEBEC R.-. ROMEO S . SIERRA T- TANGO U.- UNIFORM V .- VICTOR WHISKEY -- X--- XRAY - YANKEE Z --. ZULU Y- --- ... ZEE-ROW 1 WUN ---- 2 .--- TOO 3 - TREE - 4 FOW-ER 5 FIFE 6 - SIX 7 - SEV-VEN ---.. ATE NIN-ER 9 - ---. ! BANG .-- STOP
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education