Skip to content

Commit

Permalink
just starting to create functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sswallace committed Dec 10, 2022
1 parent 685053b commit 1554e10
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import rov
import csv
from pathlib import *

manrs_asns = []
manrs_csv_filename = "manrs.csv"

def read_manrs_participant_file(filename):
global manrs_asns
read_manrs_participant = Path.cwd() / filename
with open(read_manrs_participant) as csvfile:
fi_reader = csv.DictReader(csvfile, delimiter=',', quotechar='"')
for row in fi_reader:
for asn in row['ASNs'].split(','):
asn = asn.strip()
manrs_asns.append(asn)


def is_manrs_participant(asn):
global manrs_asns
if len(manrs_asns) == 0:
read_manrs_participant_file(manrs_csv_filename)
if asn.strip() in manrs_asns:
return True
else:
return False


# This is a sample Python script.

# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.


def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint.


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print(f"is ASN 123 {is_manrs_participant('123')}")
print_hi('PyCharm')

# See PyCharm help at https://www.jetbrains.com/help/pycharm/

0 comments on commit 1554e10

Please sign in to comment.