Skip to content

Commit

Permalink
fix: Use absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Penguinmaster2001 committed Jul 11, 2024
1 parent aab6877 commit e5749dc
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/pi_startup/auto_update_service/setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

#! /bin/bash
# No shebang, not executable run this with bash directly

# Test script
# Runs some other scripts

echo $(pwd) >> testing.txt
echo $(pwd) > testing.txt

bash ../startup_stuff/test.sh
/home/pi/Documents/ug-pi/src/pi_startup/startup_stuff/test.sh

python3 /home/pi/Documents/ug-pi/src/pi_startup/startup_stuff/test.py > ~/Documents/test_py_output.txt
2 changes: 2 additions & 0 deletions src/pi_startup/startup_stuff/localtesting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

python3 $1 > test_py_output.txt
32 changes: 32 additions & 0 deletions src/pi_startup/startup_stuff/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

# Python script that does something



num = 100

fib_memory = [-1] * (num + 1)

fib_memory[0] = 1
fib_memory[1] = 1



def fib(n: int) -> int:
if n <= 1:
return 1

if fib_memory[n] == -1:
fib_num = fib(n - 1) + fib(n - 2)
fib_memory[n] = fib_num

return fib_num

return fib_memory[n]



print(f"The first {num} Fibonacci Numbers:")

for i in range(num + 1):
print(f"{i}: {fib(i)}")
2 changes: 1 addition & 1 deletion src/pi_startup/startup_stuff/test.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

# Makes a file somewhere

echo $(pwd) >> test2.txt
echo $(pwd) > test2.txt
102 changes: 102 additions & 0 deletions src/pi_startup/startup_stuff/test_py_output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
The first 100 Fibonacci Numbers:
0: 1
1: 1
2: 2
3: 3
4: 5
5: 8
6: 13
7: 21
8: 34
9: 55
10: 89
11: 144
12: 233
13: 377
14: 610
15: 987
16: 1597
17: 2584
18: 4181
19: 6765
20: 10946
21: 17711
22: 28657
23: 46368
24: 75025
25: 121393
26: 196418
27: 317811
28: 514229
29: 832040
30: 1346269
31: 2178309
32: 3524578
33: 5702887
34: 9227465
35: 14930352
36: 24157817
37: 39088169
38: 63245986
39: 102334155
40: 165580141
41: 267914296
42: 433494437
43: 701408733
44: 1134903170
45: 1836311903
46: 2971215073
47: 4807526976
48: 7778742049
49: 12586269025
50: 20365011074
51: 32951280099
52: 53316291173
53: 86267571272
54: 139583862445
55: 225851433717
56: 365435296162
57: 591286729879
58: 956722026041
59: 1548008755920
60: 2504730781961
61: 4052739537881
62: 6557470319842
63: 10610209857723
64: 17167680177565
65: 27777890035288
66: 44945570212853
67: 72723460248141
68: 117669030460994
69: 190392490709135
70: 308061521170129
71: 498454011879264
72: 806515533049393
73: 1304969544928657
74: 2111485077978050
75: 3416454622906707
76: 5527939700884757
77: 8944394323791464
78: 14472334024676221
79: 23416728348467685
80: 37889062373143906
81: 61305790721611591
82: 99194853094755497
83: 160500643816367088
84: 259695496911122585
85: 420196140727489673
86: 679891637638612258
87: 1100087778366101931
88: 1779979416004714189
89: 2880067194370816120
90: 4660046610375530309
91: 7540113804746346429
92: 12200160415121876738
93: 19740274219868223167
94: 31940434634990099905
95: 51680708854858323072
96: 83621143489848422977
97: 135301852344706746049
98: 218922995834555169026
99: 354224848179261915075
100: 573147844013817084101

0 comments on commit e5749dc

Please sign in to comment.