Handling nested directories with recursion /u/iBerk07 Python Education

Handling nested directories with recursion /u/iBerk07 Python Education

So we have this assignment, which wants us to traverse nested directories (e.g. “root[file1(10),file2(20),files[file(15),subdir2[myfile4(25),file5(30)]]]”) and count files, find the file with the maximum size, sum all the file sizes. I am very lost with this, I thought of many ways but could not figure out one working. Using lists, dictionaries, for-while loops are restricted. We have to use recursion. Any hints or recommendations on how to approach the problem would be very useful. Thank you.

submitted by /u/iBerk07
[link] [comments]

​r/learnpython So we have this assignment, which wants us to traverse nested directories (e.g. “root[file1(10),file2(20),files[file(15),subdir2[myfile4(25),file5(30)]]]”) and count files, find the file with the maximum size, sum all the file sizes. I am very lost with this, I thought of many ways but could not figure out one working. Using lists, dictionaries, for-while loops are restricted. We have to use recursion. Any hints or recommendations on how to approach the problem would be very useful. Thank you. submitted by /u/iBerk07 [link] [comments] 

So we have this assignment, which wants us to traverse nested directories (e.g. “root[file1(10),file2(20),files[file(15),subdir2[myfile4(25),file5(30)]]]”) and count files, find the file with the maximum size, sum all the file sizes. I am very lost with this, I thought of many ways but could not figure out one working. Using lists, dictionaries, for-while loops are restricted. We have to use recursion. Any hints or recommendations on how to approach the problem would be very useful. Thank you.

submitted by /u/iBerk07
[link] [comments]  So we have this assignment, which wants us to traverse nested directories (e.g. “root[file1(10),file2(20),files[file(15),subdir2[myfile4(25),file5(30)]]]”) and count files, find the file with the maximum size, sum all the file sizes. I am very lost with this, I thought of many ways but could not figure out one working. Using lists, dictionaries, for-while loops are restricted. We have to use recursion. Any hints or recommendations on how to approach the problem would be very useful. Thank you. submitted by /u/iBerk07 [link] [comments]

Read more

Local environment variables with venv? /u/Coptochad Python Education

Local environment variables with venv? /u/Coptochad Python Education

I’m a beginner working with flask and venv. I want to store an api key in a local environment variable. I can’t find a way to do that with venv. All resources I found show a library called python-dotenv, should I just use that or is there a way to do it in venv?

submitted by /u/Coptochad
[link] [comments]

​r/learnpython I’m a beginner working with flask and venv. I want to store an api key in a local environment variable. I can’t find a way to do that with venv. All resources I found show a library called python-dotenv, should I just use that or is there a way to do it in venv? submitted by /u/Coptochad [link] [comments] 

I’m a beginner working with flask and venv. I want to store an api key in a local environment variable. I can’t find a way to do that with venv. All resources I found show a library called python-dotenv, should I just use that or is there a way to do it in venv?

submitted by /u/Coptochad
[link] [comments]  I’m a beginner working with flask and venv. I want to store an api key in a local environment variable. I can’t find a way to do that with venv. All resources I found show a library called python-dotenv, should I just use that or is there a way to do it in venv? submitted by /u/Coptochad [link] [comments]

Read more

Need a project /u/MAVP1234 Python Education

Need a project /u/MAVP1234 Python Education

Hi,

I am a learner too. I have been learning about data types and syntax and how they work and when best to use different data tyes but i need a project. What is a very basic first project?

submitted by /u/MAVP1234
[link] [comments]

​r/learnpython Hi, I am a learner too. I have been learning about data types and syntax and how they work and when best to use different data tyes but i need a project. What is a very basic first project? submitted by /u/MAVP1234 [link] [comments] 

Hi,

I am a learner too. I have been learning about data types and syntax and how they work and when best to use different data tyes but i need a project. What is a very basic first project?

submitted by /u/MAVP1234
[link] [comments]  Hi, I am a learner too. I have been learning about data types and syntax and how they work and when best to use different data tyes but i need a project. What is a very basic first project? submitted by /u/MAVP1234 [link] [comments]

Read more

Should I do this on python? Yes/No and why /u/QuestboardWorkshop Python Education

Should I do this on python? Yes/No and why /u/QuestboardWorkshop Python Education

Hello

I’m learning Python (very early on) for several reasons.

Now, my father has a store, and I’m planning to make him a site, an app, and a selling bot to fully automate the work (his store right now only sells in person, and sales are declining). From what I understand, I could do this only with Python and Django, right?

Or should I learn something else like HTML and CSS?

My time is kinda limited due to work, so If would help if I could do all that with just python.

submitted by /u/QuestboardWorkshop
[link] [comments]

​r/learnpython Hello I’m learning Python (very early on) for several reasons. Now, my father has a store, and I’m planning to make him a site, an app, and a selling bot to fully automate the work (his store right now only sells in person, and sales are declining). From what I understand, I could do this only with Python and Django, right? Or should I learn something else like HTML and CSS? My time is kinda limited due to work, so If would help if I could do all that with just python. submitted by /u/QuestboardWorkshop [link] [comments] 

Hello

I’m learning Python (very early on) for several reasons.

Now, my father has a store, and I’m planning to make him a site, an app, and a selling bot to fully automate the work (his store right now only sells in person, and sales are declining). From what I understand, I could do this only with Python and Django, right?

Or should I learn something else like HTML and CSS?

My time is kinda limited due to work, so If would help if I could do all that with just python.

submitted by /u/QuestboardWorkshop
[link] [comments]  Hello I’m learning Python (very early on) for several reasons. Now, my father has a store, and I’m planning to make him a site, an app, and a selling bot to fully automate the work (his store right now only sells in person, and sales are declining). From what I understand, I could do this only with Python and Django, right? Or should I learn something else like HTML and CSS? My time is kinda limited due to work, so If would help if I could do all that with just python. submitted by /u/QuestboardWorkshop [link] [comments]

Read more

Why does python think that 0.1 plus 0.2 is ~0.3000000000004 /u/HoskinZo Python Education

Why does python think that 0.1 plus 0.2 is ~0.3000000000004 /u/HoskinZo Python Education

I’m new to python and really enjoying it so far!

I’m reading Eric Matthes’ Python Crash Course to learn–there’s a section on floats and basic math and it shows that if you input answer = 0.1 + 0.2 and then print(answer), it gives you the answer of 0.30000000004 (possibly with more or less zeroes before the 4).

It’s okay but I’m just curious why python does this? Does anyone know the behind-the-scenes of how it computes this?

submitted by /u/HoskinZo
[link] [comments]

​r/learnpython I’m new to python and really enjoying it so far! I’m reading Eric Matthes’ Python Crash Course to learn–there’s a section on floats and basic math and it shows that if you input answer = 0.1 + 0.2 and then print(answer), it gives you the answer of 0.30000000004 (possibly with more or less zeroes before the 4). It’s okay but I’m just curious why python does this? Does anyone know the behind-the-scenes of how it computes this? submitted by /u/HoskinZo [link] [comments] 

I’m new to python and really enjoying it so far!

I’m reading Eric Matthes’ Python Crash Course to learn–there’s a section on floats and basic math and it shows that if you input answer = 0.1 + 0.2 and then print(answer), it gives you the answer of 0.30000000004 (possibly with more or less zeroes before the 4).

It’s okay but I’m just curious why python does this? Does anyone know the behind-the-scenes of how it computes this?

submitted by /u/HoskinZo
[link] [comments]  I’m new to python and really enjoying it so far! I’m reading Eric Matthes’ Python Crash Course to learn–there’s a section on floats and basic math and it shows that if you input answer = 0.1 + 0.2 and then print(answer), it gives you the answer of 0.30000000004 (possibly with more or less zeroes before the 4). It’s okay but I’m just curious why python does this? Does anyone know the behind-the-scenes of how it computes this? submitted by /u/HoskinZo [link] [comments]

Read more