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
160bf4aa
Commit
160bf4aa
authored
6 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
format with autopip8
parent
eede25ae
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Readme-python.txt
+9
-9
9 additions, 9 deletions
Readme-python.txt
ctd.py
+370
-342
370 additions, 342 deletions
ctd.py
roscop/roscop.py
+35
-24
35 additions, 24 deletions
roscop/roscop.py
with
414 additions
and
375 deletions
Readme-python.txt
+
9
−
9
View file @
160bf4aa
Sous Windows, VSCode et Python 3.
6
Sous Windows, VSCode et Python 3.
7.2
> pip3
> pip3
Fatal error in launcher: Unable to create process using '"'
Fatal error in launcher: Unable to create process using '"'
[ntird-us191-jg4:jgrelet]/c/git/python/pirata
[ntird-us191-jg4:jgrelet]/c/git/python/pirata
> python3 -m pip install --upgrade pip
> python3 -m pip install --upgrade pip
Collecting pip
...
Downloading https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 72kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-19.0.3
Successfully installed pip-19.0.3
[ntird-us191-jg4:jgrelet]/c/git/python/pirata
[ntird-us191-jg4:jgrelet]/c/git/python/pirata
> pip install toml
> pip install toml
...
@@ -56,4 +50,10 @@ Configuration du fichier setting.json de jgrelet:
...
@@ -56,4 +50,10 @@ Configuration du fichier setting.json de jgrelet:
Pour utiliser le bash de git, modifier la ligne:
Pour utiliser le bash de git, modifier la ligne:
"terminal.integrated.shell.windows": "C:\\MinGW\\msys\\1.0\\bin\\bash.exe",
"terminal.integrated.shell.windows": "C:\\MinGW\\msys\\1.0\\bin\\bash.exe",
par
par
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
\ No newline at end of file
Autoformatting
----------------------
> pip install autopep8
Installer l'extension Python-autopep8
Cmd+P choisir autopip
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ctd.py
+
370
−
342
View file @
160bf4aa
This diff is collapsed.
Click to expand it.
roscop/roscop.py
+
35
−
24
View file @
160bf4aa
...
@@ -2,35 +2,46 @@
...
@@ -2,35 +2,46 @@
code roscop
code roscop
"""
"""
import
csv
,
shelve
,
sys
import
csv
import
shelve
import
sys
# class roscop
class
db
:
def
__setattr__
(
self
,
name
,
value
):
self
.
__dict__
[
name
]
=
value
# class roscop
# ------------
# ------------
class
Roscop
:
class
Roscop
:
# constructor with values by default
# constructor with values by default
def
__init__
(
self
,
file
):
def
__init__
(
self
,
file
):
self
.
file
=
file
self
.
file
=
file
# call by print()
# call by print()
def
__repr__
(
self
):
def
__repr__
(
self
):
return
"
class Roscop, file: {}
"
.
format
(
self
.
file
)
#print("%s:" % row[key], end='')
# print()
# read code roscop file
return
"
class Roscop, file: {}
"
.
format
(
self
.
file
)
def
read
(
self
):
print
(
"
Code roscop file: %s
"
%
self
.
file
)
# read code roscop file
with
open
(
self
.
file
,
'
rt
'
)
as
f
:
def
read
(
self
):
reader
=
csv
.
DictReader
(
f
,
delimiter
=
'
;
'
)
print
(
"
Code roscop file: %s
"
%
self
.
file
)
print
(
reader
.
fieldnames
)
with
open
(
self
.
file
,
'
rt
'
)
as
f
:
for
row
in
reader
:
reader
=
csv
.
DictReader
(
f
,
delimiter
=
'
;
'
)
for
key
in
reader
.
fieldnames
:
for
row
in
reader
:
print
(
"
%s:
"
%
row
[
key
],
end
=
''
)
d
=
db
()
print
()
for
key
in
reader
.
fieldnames
:
return
d
.
key
=
row
[
key
]
return
# for testing in standalone context
# for testing in standalone context
# ---------------------------------
# ---------------------------------
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
from
roscop
import
Roscop
from
roscop
import
Roscop
r
=
Roscop
(
"
code_roscop.csv
"
).
read
()
r
=
Roscop
(
"
code_roscop.csv
"
).
read
()
print
(
r
)
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