python | Unsorted

Telegram-канал python - Python

135201

You will be muted until you read the rules. Read them! @Rules_for_Python A group about the Python programming language. Offtopic things go here: @pythonofftopic Resources to learn python: @pythonres Group for Hy: @hylang Selenium: @SeleniumPython

Subscribe to a channel

Python

This is the correct code
for i in range(1, 6):
for j in range(1, i + 1):
print(j, end=" ")
print()

Читать полностью…

Python

looks like you need an offtopic group, please delete the off-topic message(s) and continue this conversation at @pythonofftopic

Читать полностью…

Python

I need a algorithm that solves constraint problems, rooms, teachers

Читать полностью…

Python

made migrations, migrated, checked data base, there are objects with IDs, but this keeps coming up

Читать полностью…

Python

how can I get over this goddamn "NoReverseMatch at /" error in django?

views.py

from django.shortcuts import render
from .models import Topic

def index(request):
"""The home page for learning log"""
return render(request, 'learning_logs/index.html')


def topic(request, topic_id):

topic = Topic.objects.get(id=topic_id)
entries = topic.entry_set.order_by("-date_added")
context = {"topic": topic, "entries":entries}
return render(request, "learning_logs/topics.html", context)


learning_logs/urls.py (learning_logs is the name of the app)
"""Define URL patterns for learning_logs."""

from django.urls import path
from . import views

app_name = 'learning_logs'
urlpatterns = [
# Home page
path('', views.index, name='index'),
path('topics/<int:topic_id>/', views.topic, name="topics")
]


base.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p>
<a href="{% url 'learning_logs:index' %}">Learning Log</a> -
<a href="{% url 'learning_logs:topic' topic_id %}">Topics</a>
</p>
{% block content %}{% endblock content %}
</body>
</html>


topics.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Topics</title>
</head>
<body>
{% extends 'learning_logs/base.html' %}

{% block content %}
<p>Topic: {{ topic.text }}</p>
<p>Entries:</p>
<ul>
{% for entry in entries %}
<li>
<a href="{% url 'learning_logs:topic' topic.id %}">
{{ topic.text }}
</a>
</li>
{% empty %}
<li>There are no entries for this topic yet.</li>
{% endfor %}
</ul>
{% endblock content %}
</body>
</html>

Читать полностью…

Python

I need a Python programmer to fix a script for posting tweets.

Читать полностью…

Python

This is not a Python specific question, please delete your offtopic message, move to @PythonOfftopic and ask there.

Читать полностью…

Python

what's on your mind? What have you tried so far

Читать полностью…

Python

Hi everyone, is there anyone to suggest which way is best to fix scheduling problems like school class

Читать полностью…

Python

This isn't really my area of expertise.

Читать полностью…

Python

Any one here to teach python high level online

Читать полностью…

Python

More over the compute capability of my gpu is (7,5)

Читать полностью…

Python

Using torch.compile raises the can't find triton installment issue any fix to this problem?

Читать полностью…

Python

but I can do it using default pip

Читать полностью…

Python

Which means chatGPT-written code is even harder for computers to understand

Читать полностью…

Python

This will only print 1 to 5

Читать полностью…

Python

These are called Constraint Satisfaction Problems, and there are many ways to solve them I'd say backtracking is one of the common options but read more here: https://en.wikipedia.org/wiki/Constraint_satisfaction_problem

Читать полностью…

Python

when I replace topic.id with a number like 1, it works just fine

<a href="{% url 'learning_logs:topic' topic.id %}">  <!-- doesnt work -->

<a href="{% url 'learning_logs:topic' 1 %}"> <!-- works -->


so how am I messing up this part?

Читать полностью…

Python

Reverse for 'topics' with arguments '('',)' not found. 1 pattern(s) tried: ['topics/(?P<topic_id>[0-9]+)/\\Z']
Django Version: 5.2.7

Читать полностью…

Python

Rules in our groups are strictly enforced. It is strongly recommended to read our rules before engaging in any other activity!

Читать полностью…

Python

Don't ignore the bot message

Читать полностью…

Python

Hi! People.

What are doing this Sunday?

Читать полностью…

Python

How does this relate to python?

Читать полностью…

Python

This conversation has taken a direction I'm not comfortable with.

Читать полностью…

Python

This is neither a job board nor a bulletin board.

Читать полностью…

Python

make terminal based tick-toc game.
my first project was to find given number is prime no.,
then prime factorization of a number

Читать полностью…

Python

Show the full error, did you searched about htis error in google?

Читать полностью…

Python

The error is not full so hard to say what's exactly the issue

Читать полностью…

Python

Hi everyone. May be someone faced with an issue. I have fastapi application and uv and cannot install asyncpg using this tool. Firstly I got C++ 14.0+ build tools but now I'm getting

check.warn(importable)
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

hint: This usually indicates a problem with the package or the build environment.
help: If you want to add the package regardless of the failed resolution, provide the `--frozen` flag to skip locking and syncing.

Читать полностью…

Python

because those are compiled, and Python is interpreted

Читать полностью…
Subscribe to a channel