Projektgruppe¶
(15 min)
Danne en projektgruppe med max 4 personer. Vælg et navn til deres gruppe, som kan gerne være sjovt. Følge Classroom50 group assignments og:
RobotLab certification¶
(120 min)
create a robot control program on the pendant
differentiate between moveL and moveJ commands
Gennemføre UR e-learning modul. Modulen vil formodentlig tage omkring 1.5-2 time. Certifikaterne skal afleveres som gruppe i
projectrepositorium sådan:certs/s123456.pdf certs/s123457.pdf ...Gå til http://
engtech .dtu .dk /designbuildlab og læse de generelle regler for brug af laboratorier, under Generel info => Sikkerhed og regler for brug.
Coding environment continued¶
(30 min)
Git installation¶
We will use Git to communicate with the repositories on GitHub.
Open a terminal and run:
winget install git.gitbrew install gitAfter installation, set your name. Use the mail address you used for GitHub.[1].
git config --global user.name "YOUR NAME"Then your email:
git config --global user.email "YOUR_EMAIL"Python installation¶
Run the following in the terminal:
brew install pythonwinget install python.python.3.14Editor extension installation¶
Run the following in the terminal:
codium --install-extension ms-python.python --install-extension ms-python.black-formatter --install-extension ms-pyright.pyright --install-extension github.vscode-pull-request-githubFolder structure for the semester¶
Every project, will have its own folder and repository, e.g., repository1 and repository2. Based on this, my recommended directory structure is:
📁 your home folder, e.g., /Users/u/
├── 📁 Desktop
├── 📁 uni
├── 📁 26WS
├── 📁 indprog
├── 📁 code
├── 📁 repository1
├── 📁 repository2
├── 📁 ...You can create this structure using the following command in terminal:
mkdir Desktop\uni\26WS\indprog\codemkdir -p Desktop/uni/26WS/indprog/codeRunning programs in the editor¶
Start the editor.
Open a terminal using the menu
Terminal→New Terminalor CtrlShift`:
The following command will change your directory to your
codefolder and clone the template repository into yourcodefolder. Change the path to yourcodefolder if you have a different structure.In the terminal, change your directory to the
codefolder:cd Desktop/uni/26WS/indprog/codeAnd then copy the template repository into your
codefolder, calledclone:git clone https://github.com/indprog/python-template-multiAfter cloning, you should see:

In our editor, opening a project means opening the folder containing the projects files. These are in our case
repository1,repository2, and notcodefolder.Open the folder that we cloned with git in the editor using File -> Open Folder:

We trust each other, so click Manage

Click Add Folder instead of Trust to trust the whole
codefolder[2]:
Select the
codefolder and click Trust Folder. You should see:
Close Workspace Trust window.
On the left activity bar, click Explorer and click the folder src-> hello.*.

We will now build and run the code using the debugger. Press F5 or Run -> Start Debugging. You should see:

If you don’t see the emoji on Windows, refer here: Configuring PowerShell for rendering special symbols.
You can also try a program with input. Click the file pi-estimator.* and run it.

The assignments will have their own repository, which you will clone into your code folder. We will practice this in the next lecture.
Reading & exercises¶
From Think Python notebooks do Chapter 1 and 2. To run the notebooks, you need to sign in with a Google account.
At the end of the reading you try to explain the following concepts and why they are important for Python programming. If you have doubts, note them and write them in Discussions, and move on. We will focus on these points in the next lecture.
design a simple program
input data and output results
perform arithmetic operations
Chapter 1
Programming as a way of thinking
Arithmetic operators
integers and floating-point numbers
division using
/and//
Expressions
Paranthesis in arithmetic expressions
Every expression has a value
Arithmetic functions
round,abscalling a function using
()SyntaxError
Strings
Defining a string using single or double quotes
plus operation on strings -- concatenation
multiplication on strings
lenErrors if other quotes are used
Values and types
typeConversion between types using
int,float,strTypeErrorif you, e.g., try to add a string and an integer_separator in numbers
Formal and natural languages
Ambiguity vs exactness, redundancy
Debugging Chapter 2
Variables and statements
Assignment (variable
=expression)Variables can be used in functions
round(x)State diagrams (we used them in flowchart drawings)
Valid variable names
importUsing variables in a module, e.g.,
math.pi
Expressions and statements
Definition and difference
printprint(x, y, z)
Arguments
Optional arguments
Endless number of arguments, e.g.,
print(x, y, z, ...)
Comments
#for commentsDensity of formal languages is sometimes not comprehensible
Comprehensible (and long) variable names vs short (but readable in complex expressions) variable names
Debugging
Syntax, runtime vs semantic errors
We meet in Robotlab G2.61 and classroom nearby G2.58¶
G2.58 er tilstødende
Robotlabben kan ikke holde så mange studerende, så vi vil dele hele holdet i to grupper – mens den ene halvdel arbejder med robotterne, vil den anden gruppe arbejde i det tilstødende lokale.
Den ene halvdel (gruppe 1-6) af grupperne 13 til 1430 i G2.61
anden halvdel fra 1445 til 1615 i G2.58
og vi skifter kl 1445
Because we will add additional repositories to the
codefolder.