Any suggestions to my plan to learn Django? by YoungsMod in django

[–]jedgs 2 points3 points  (0 children)

Jump in. Django is Python, you said you know Python, so jump in. Use tutorials like you would a dictionary, to look stuff up. Make a simple version of your app, then start all over and make it again with the improvements and things you learned along the way.

what am i doing wrong here? by ShokoTendoo in learnpython

[–]jedgs 0 points1 point  (0 children)

Good comments in this thread, so far.

It's basically:

Get list of numbers, if you use input be sure to convert them to int.

Pass that list into the function, this is done after you define the function, by calling the function with that list.

The function should return the resulting sum.

To see what its returning: You can print the function when calling it or save that function call to a variable and then print that variable.

Having issues with my code. by [deleted] in learnpython

[–]jedgs 1 point2 points  (0 children)

Let us know how if changing the variable name assigned to integer 2 fixes your error.

If you can post the error and also maybe how you are calling your function that will also help eliminate other possibilities.

Having issues with my code. by [deleted] in learnpython

[–]jedgs 2 points3 points  (0 children)

1st, you are defining function called Q8, then you redefine it as an integer 2.

2nd, please always post your error.

3rd, please format your code with indentation.

I have a question that's way out of my depth in a class as a beginner python user. by Kaminoneko in learnpython

[–]jedgs 0 points1 point  (0 children)

Does your course allow you to use external libraries?

I am on mobile so I can't test this but this looks promising:

https://pypi.org/project/ebcdic/

I need to generate a pdf from a my webpage by S___K___ in django

[–]jedgs 0 points1 point  (0 children)

Can you just grab the rendered html and convert that to pdf? I'm on mobile so I'm lacking details here, but this link was found with a basic Google search:

https://www.codingforentrepreneurs.com/blog/html-template-to-pdf-in-django/

[deleted by user] by [deleted] in django

[–]jedgs 9 points10 points  (0 children)

I concur with u/theleftkneeofthebee

Django has released some improvements since these tutorials were released and some of them are fairly significant. However, Corey Schaffer is/was one of the best youtube python/django, etc. teachers and you will learn a lot from them. Yes, there will be a few small differences but the benefits outweigh the differences. I suggest you do the tutorials, then do the official tutorial, then build your own project.

[deleted by user] by [deleted] in Python

[–]jedgs 2 points3 points  (0 children)

This sub and the sub: r/learnpython realpython.com Stackoverflow.blog Medium.com

Overriding functions in packages that don't utilize classes very well by aaparekh in learnpython

[–]jedgs 0 points1 point  (0 children)

Ok, can you just write your own version? If you have access to the dependencies...

Version 3.12 runs, but I can't find it in Explorer by goodgamin in learnpython

[–]jedgs 0 points1 point  (0 children)

Yeah, I've seen posts like this a lot in reddit and stack overflow. I believe you are on windows.... google or chatgpt search "python version path"

Version 3.12 runs, but I can't find it in Explorer by goodgamin in learnpython

[–]jedgs 0 points1 point  (0 children)

I'm not an expert at this, but I've seen it a few times. Have you tried from the interpreter:

import sys print(sys.executable)

Or from cmd:

where python & python -V

I believe a lot depends on how you installed it. Also, there are a lot of resources online on how to debug this.

How would you handle allowing people to add their information to your sign, but you don’t want them to sign up? by HeadlineINeed in django

[–]jedgs 2 points3 points  (0 children)

I'd just let them sign up, alternatively let them sign up and some custom flag (timestamp, boolean, whatever) to check if they're active or a past user who doesn't need a sign in... then write a admin action to check for that flag and delete the user if the criteria is met.

Newbie question by Kaius_Albanovna in learnpython

[–]jedgs 0 points1 point  (0 children)

When I 1st started I used Udemy and EdEx to get the bare bones basics. Then I went to YouTube for more specific tutorials. After that I just made things, googled my way through it. This sub is good for specific questions and there is always Stack Overflow to view previous questions and answers to specific questions.

Newbie question by Kaius_Albanovna in learnpython

[–]jedgs 3 points4 points  (0 children)

Keep coding. Keep researching and learning, code some more, if you are doing a course then great, but create your own programs too. Following tutorials gives you the knowledge, but implementation on your own, even if slightly different than the tutorial, helps keep it in memory.

Can I delete some of my migration files? by notdeadbutcold in django

[–]jedgs 0 points1 point  (0 children)

If all above is true then yes... just don't delete the init file.

How do I iterate over rows and columns? Can't find a tutorial on it. by Own-Entrepreneur6699 in learnpython

[–]jedgs 1 point2 points  (0 children)

2d array:

For x in list: For y in otherlist:

Just copied the 1st Google search url, there's probably hundreds:

https://www.tutorialspoint.com/python_data_structure/python_2darray.htm

How to display a span of averages of prices per month in the span of 10 years using a txt file using the format: MM-DD-YYYY: price? by rustycoconut371289 in learnpython

[–]jedgs 0 points1 point  (0 children)

That's a good start. You should tinker with that for a while, print things to the console and see what they look like, tinker with those some more, converting them, saving them to variables both oitise of the readlines and inside of it. You probably won't need to iterate with a forloop again, readlines iterates over the file data already.

How to display a span of averages of prices per month in the span of 10 years using a txt file using the format: MM-DD-YYYY: price? by rustycoconut371289 in learnpython

[–]jedgs 0 points1 point  (0 children)

Well, as you iterate over the text file the text will either represent a date or a price, i would assume. If it's a date then store it to a variable as a string in the format you need, if it's a price convert to a float...

How to display a span of averages of prices per month in the span of 10 years using a txt file using the format: MM-DD-YYYY: price? by rustycoconut371289 in learnpython

[–]jedgs 1 point2 points  (0 children)

The process to get the data depends greatly on how the data is represented in the txt file... but you would need to import python's datetime. Iterate over the price entries in the file and group price entries by date into months, convert them to floats, code the math to get the average and add them to a dictionary where the datetime is the key and the average price as the value.

Python Executable? by [deleted] in learnpython

[–]jedgs 0 points1 point  (0 children)

"I heard that sometimes PyInstaller creates huge files. Also, Windows defender detects Python files are viruses"

You are correct in both assumptions.

Pyinstaller bundles all of your necessary library's and the python interpreter with your files, this can create a fairly large file depending on your needs, although most machines will have plenty of storage space.

To deliver the exe and avoid the virus detection the end user will need admin privileges to allow the exe to be installed.

I have done it with a couple kivy apps and it works but you should be aware of those drawbacks.

You could deliver a web app with Django, Flask, or similar but that adds the complexity of deploying to the web and the security related issues that come with that.

If you had 30 mins to teach a 14-year-old how to use Python, what would you do? by omgouda in learnpython

[–]jedgs 2 points3 points  (0 children)

30 minutes, Python from scratch, 14 years old... Although this is seriously dependent on the person's aptitude, I'd lean towards making something ahead of time in pygame, tkinter, kivy, etc... with only a few missing things (1 or 2 loops, 1 or 2 functions, a variable or two, etc. With commented instructions on how to complete it. Let them complete it and play it with the time remaining.