1

I'd like to know if in Python I can write something similar:

FILE *file = fopen(path, mode);
char tmp[block_size] = {0};

while(ftell(file) < file_length)
{
    fread(tmp, 1, (file_size - fw.tell()) > block_size ?
                     block_size : (file_size - ftell(file)), file);

    // do something
}

fclose(file);
  • 3
    Is this what you are looking for: [Does Python have a ternary conditional operator?](http://stackoverflow.com/questions/394809/does-python-have-a-ternary-conditional-operator) – Martin R Dec 13 '15 at 21:17

0 Answers0