Merge branch 'develop' of https://raspithekgit.srv64.de/raspithek/pythonkurs into develop
This commit is contained in:
		
							
								
								
									
										26
									
								
								argparse/action.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										26
									
								
								argparse/action.py
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,26 @@ | |||||||
|  | #! /usr/bin/python3 | ||||||
|  |  | ||||||
|  | import argparse | ||||||
|  |  | ||||||
|  | def do_test(): | ||||||
|  |   print('do_test()') | ||||||
|  |  | ||||||
|  | parser = argparse.ArgumentParser(prog='action',description='Demonstration der Action',epilog='Ende der Hilfe') | ||||||
|  |  | ||||||
|  | parser.add_argument('--update',help='update Hilfe') | ||||||
|  | parser.add_argument('--dry-run',help='dry-run Hilfe') | ||||||
|  | parser.add_argument('--verbose','-v', action='count') | ||||||
|  | parser.add_argument('--true', action='store_true') | ||||||
|  | parser.add_argument('-append', action='append', nargs=1) | ||||||
|  | parser.add_argument('--false', action='store_false') | ||||||
|  | parser.add_argument('--store', action='store') | ||||||
|  | parser.add_argument('--const', action = 'store_const', const=19) | ||||||
|  |  | ||||||
|  | parser.add_argument('--delete', action = argparse.BooleanOptionalAction) | ||||||
|  | #parser.add_argument('--no-delete', action = argparse.BooleanOptionalAction) | ||||||
|  |  | ||||||
|  |  | ||||||
|  | args=parser.parse_args() | ||||||
|  | print(f'args={args}') | ||||||
|  | print(f'verbose={args.verbose}') | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								argparse/help.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								argparse/help.py
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | #! /usr/bin/python3 | ||||||
|  |  | ||||||
|  | import argparse | ||||||
|  |  | ||||||
|  | parser = argparse.ArgumentParser(prog='HILFE',description='Demonstration der Hilfeseite',epilog='Ende der Hilfe im Epilog') | ||||||
|  |  | ||||||
|  | parser.add_argument('--update',help='update Hilfe') | ||||||
|  | parser.add_argument('--dry-run',help='dry-run Hilfe') | ||||||
|  |  | ||||||
|  | args=parser.parse_args() | ||||||
|  |  | ||||||
| @@ -1,22 +1,22 @@ | |||||||
| # Verwenden Sie ein Basis-Image mit Python | # Python Basis-Image | ||||||
| FROM python:3.8 | FROM python:3.8 | ||||||
|  |  | ||||||
| # Setzen Sie das Arbeitsverzeichnis innerhalb des Containers | # Arbeitsverzeichnis innerhalb des Containers | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
|  |  | ||||||
| # Kopieren Sie die Anwendungsabhängigkeiten in das Container-Image | # Anwendungsabhängigkeiten in das Container-Image kopieren | ||||||
| COPY requirements.txt . | COPY requirements.txt . | ||||||
|  |  | ||||||
| # Installieren Sie die Abhängigkeiten | # Abhängigkeiten installieren | ||||||
| RUN pip install --no-cache-dir -r requirements.txt | RUN pip install --no-cache-dir -r requirements.txt | ||||||
|  |  | ||||||
| # Geben Sie den Port an, auf dem Ihre Flask-Anwendung ausgeführt wird | # Port der Flask-Anwendung | ||||||
| EXPOSE 8085 | EXPOSE 8085 | ||||||
|  |  | ||||||
| # Kopieren Sie den Rest des Codes in das Container-Image | # eigenen Code in das Container-Image kopieren | ||||||
| COPY fib/*.py /app/ | COPY fib/*.py /app/ | ||||||
| COPY fib/static /app/static | COPY fib/static /app/static | ||||||
| COPY fib/templates /app/templates | COPY fib/templates /app/templates | ||||||
|  |  | ||||||
| # Setzen Sie den Befehl aus, der Ihre Anwendung startet | # Befehl, der die Anwendung startet | ||||||
| CMD ["python", "app.py"] | CMD ["python", "app.py"] | ||||||
|   | |||||||
| @@ -1,18 +0,0 @@ | |||||||
| # Verwenden Sie ein Basis-Image mit Python |  | ||||||
| FROM python:3.8 |  | ||||||
|  |  | ||||||
| # Setzen Sie das Arbeitsverzeichnis innerhalb des Containers |  | ||||||
| WORKDIR /app |  | ||||||
|  |  | ||||||
| # Kopieren Sie die Anwendungsabhängigkeiten in das Container-Image |  | ||||||
| COPY requirements.txt . |  | ||||||
| COPY FIB/*.py /app |  | ||||||
|  |  | ||||||
| # Installieren Sie die Abhängigkeiten |  | ||||||
| RUN pip install --no-cache-dir -r requirements.txt |  | ||||||
|  |  | ||||||
| # Kopieren Sie den Rest des Codes in das Container-Image |  | ||||||
| COPY . . |  | ||||||
|  |  | ||||||
| # Setzen Sie den Befehl aus, der Ihre Anwendung startet |  | ||||||
| CMD ["python", "app.py"] |  | ||||||
		Reference in New Issue
	
	Block a user
	 Olli Graf
					Olli Graf