Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想问如何制作一个“python manage.py shell”并添加一个“from myapp.model import Contact c = Contact.objects.all().count() print c”。这可能在批处理文件中吗?
尝试类似:
echo "from myapp.model import Contact; c = Contact.objects.all().count(); print c" | python manage.py shell
或者这个How do you read from stdin in Python?