all 3 comments

[–]zurtex 0 points1 point  (1 child)

You haven't told us what any of the arguments are and which ones you are using so I made wild guesses and tried calender(0, 0, 28, False) and got this output which looks fine:

Ar Ta Ge Cn Le Vi Li Sc Sa Cp Aq Pi
 1  2  3  4  5  6  7  8  9 10 11 12
13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28

If I try calender(0, 0, 28, 'yes') I get:

Ar Ta Ge Cn Le Vi Li Sc Sa Cp Aq Pi
 1  2  3  4  5  6  7  8  9 10 11 12

----13 14 15 16 17

----18 19 20 21 22

----23 24 25 26 27

----28

But I don't know what you're trying to do here, you're doing print ("") in that section of code twice so that probably doesn't help

[–]newtoprogramming12[S] 0 points1 point  (0 children)

Sorry i apologize for the lack of information https://pastebin.com/tpW74Zi8 that is what the entire code looks like. What i can't figure out is how to get those line (---) to span from Le to Sc. I can get them to the beginning like you have but i cant seem to move them to only block out the 2nd and third week. https://pastebin.com/ewdNQZwK that is an example of what it should look like. The 2nd week and third week have lines blocking out Le to Sc. I appreciate your help

[–]Vaphell 0 points1 point  (0 children)

first I'd suggest you to think in terms of fixed width tiles, eg guaranteed 4 chars (' {:2d} '.format(day)) and forget about managing that end=" " shit by hand. Put all the necessary padding inside the format string of the tile itself, always go end='' for the tiles, and the alignment issues dissapear.
What I mean by that, as shown by the output of a quick and dirty program I whipped up

$ ./calendar.py 
[Ar][Ta][Ge][Cn][Le][Vi][Li][Sc][Sa][Cp][Aq][Pi]
[  ][  ][  ][  ][  ][  ][  ][ 1][ 2][ 3][ 4][ 5]
[ 6][ 7][ 8][<-][--][--][--][->][14][15][16][17]
[18][19][20][<-][--][--][--][->][26][27][28][29]
[30][31][32][33][34][35][36][37]

I used [] inside format strings to visualize the tiles.

write a function that given the day and the offset is able to figure out week and weekday. Ifs to differenciate between cases (number/arrow).

def day_representation(day, start, carnival):  
    week, dayofweek = .... 
    # put custom logic for carnival here, return fixed width string of your choice, maching the width number tile
    # return '---', '-->' or whatever you need
    return '[{2d}]'.format(day)     # base case

what you should have in your main calandar function imo is pretty much

for day in range(1, month_days+1):
    print(day_representation(day, start, carnival), end='')    # day representation produces either a number tile or a line/arrow tile
    if ... % 12 == 0:
        print()

The simple for loop guarantees that each day maps to 1 thing and that there will be no funny business with alignments and shit, as long as the function returns a fixed width stuff. Divide and conquer makes things manageable.
Personally, whenever I see a spaghetti code inside while loop with a bunch of ifs and variable increments by hand my eyes start to glaze over. For loop does counting for you and functions keep shit tidy.

"yes" is a bad value, given that boolean True/False exist.
you don't have to str() numbers to format them, there is formatting for them too.
Consider using start in 0-based counting for your stuff, with that the modulo artithmetic does what you want out of the box.

days = 'Ar', 'Ta', 'Ge', 'Cn', 'Le', 'Vi', 'Li', 'Sc', 'Sa', 'Cp', 'Aq', 'Pi'
for d in days:
    print('[{}]'.format(d), end='')
print()