Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Display blog posts in two columns
Post: RE: Display blog posts in two columns

I had to do a little tweak to get the desired result: {% for post in posts %} {% cycle 'odd' 'even' %} {% if cycle=='odd' %} <div class="col-md-6">Odd posts</div> {% else %} ...
saladgg Web Scraping & Web Development 3 3,380 Dec-28-2018, 05:17 AM
    Thread: Display blog posts in two columns
Post: Display blog posts in two columns

I want to diplay the list of my blog posts in a row with two columns. So I tried; {% for post in posts %} {% set oddOrEven = cycle(['odd', 'even'], loop.index0) %} {% if oddOrEven == 'odd' %}...
saladgg Web Scraping & Web Development 3 3,380 Dec-27-2018, 08:24 PM
    Thread: ModuleNotFoundError
Post: RE: ModuleNotFoundError

(Nov-10-2018, 10:00 AM)Larz60+ Wrote: hard to say without seeing all code involved. Is the code that is doing the importing in the same directory as the imported code? do you have an __init__.py fil...
saladgg General Coding Help 2 3,658 Nov-11-2018, 07:06 AM
    Thread: ModuleNotFoundError
Post: ModuleNotFoundError

I got two .py files in the same folder. (post.py and user.py) I'm importing user model to post.py using from user import User When I run the code I get an error: ModuleNotFoundError: No module named ...
saladgg General Coding Help 2 3,658 Nov-10-2018, 06:22 AM
    Thread: unit test roll die
Post: RE: unit test roll die

(Nov-06-2018, 11:43 AM)stullis Wrote: def integer_input(message):     while True:         try:             x = int(input(message))             return x         except ValueError:             print("...
saladgg General Coding Help 5 4,204 Nov-06-2018, 02:50 PM
    Thread: unit test roll die
Post: RE: unit test roll die

I know there's not much to test. It's part of test that I am taking. I am also a beginner in python, your approach has taught me new ways to write code that I didn't know before. Thanks @stullis **smi...
saladgg General Coding Help 5 4,204 Nov-06-2018, 12:44 PM
    Thread: unit test roll die
Post: unit test roll die

I am beginner at tests. I am trying to do a unit test for a roll die program. I have tried many options and failed. Here is the code: from random import randint def run(): try: num = int(...
saladgg General Coding Help 5 4,204 Nov-06-2018, 04:41 AM
    Thread: TypeError: string indices must be integers
Post: RE: TypeError: string indices must be integers

@burah, that works fine too. **smile**
saladgg General Coding Help 4 3,663 Oct-03-2018, 08:20 PM
    Thread: TypeError: string indices must be integers
Post: RE: TypeError: string indices must be integers

I may have left out some important info. I am using firebase realtime db. This solved my problem. I was supposed to loop through by means of key,value. class Student(Resource): dbStudents = db.r...
saladgg General Coding Help 4 3,663 Sep-30-2018, 05:32 AM
    Thread: TypeError: string indices must be integers
Post: TypeError: string indices must be integers

Am learning to create a python API. I want to get a return a student object whenever there's a match of student name when I loop through the students data. Please tell me what I am doing wrong. I ge...
saladgg General Coding Help 4 3,663 Sep-29-2018, 05:32 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020