Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oceano2python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
Oceano2python
Commits
b3ba8cd8
Commit
b3ba8cd8
authored
6 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
create roscop module (objetct)
update gitignore
parent
fb0bf728
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
roscop/code_roscop.csv
+0
-0
0 additions, 0 deletions
roscop/code_roscop.csv
roscop/roscop.py
+35
-0
35 additions, 0 deletions
roscop/roscop.py
with
36 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
b3ba8cd8
...
...
@@ -11,4 +11,5 @@
*.nc
*.xml
*.stackdump
__pycache__
This diff is collapsed.
Click to expand it.
code_roscop.csv
→
roscop/
code_roscop.csv
+
0
−
0
View file @
b3ba8cd8
File moved
This diff is collapsed.
Click to expand it.
roscop/roscop.py
0 → 100644
+
35
−
0
View file @
b3ba8cd8
"""
code roscop
"""
import
csv
,
shelve
,
sys
# class roscop
# ------------
class
Roscop
:
# constructor with values by default
def
__init__
(
self
,
file
):
self
.
file
=
file
# call by print()
def
__repr__
(
self
):
return
"
class Roscop, file: {}
"
.
format
(
self
.
file
)
# read code roscop file
def
read
(
self
):
print
(
"
Code roscop file: %s
"
%
self
.
file
)
with
open
(
self
.
file
,
'
rt
'
)
as
f
:
reader
=
csv
.
DictReader
(
f
,
delimiter
=
'
;
'
)
for
row
in
reader
:
print
(
"
%s : %s : %s : %s : %s
"
%
(
row
[
'
key
'
],
row
[
'
long_name
'
],
row
[
'
standard_name
'
],
row
[
'
units
'
],
row
[
'
format
'
]))
return
# for testing in standalone context
# ---------------------------------
if
__name__
==
"
__main__
"
:
from
roscop
import
Roscop
r
=
Roscop
(
"
code_roscop.csv
"
)
r
.
read
()
print
(
r
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment