A printer, comprising: a printing unit including a main body portion, a printing portion, a ribbon supply shaft, a ribbon roll up shaft, and a partition member, wherein the printing portion is constituted by a thermal head and configured to print on a print medium together with a platen roller on a casing side of the printer, the ribbon supply shaft is configured to hold an ink ribbon to be supplied to the printing portion, the ribbon roll up shaft is configured to roll up the ink ribbon used in the printing portion, the thermal head is attached to the main body portion, and the ribbon roll up shaft and the partition member are provided in the main body portion, an end portion of the main body portion is supported by a support shaft so that the main body portion is swingable so as to separate the thermal head from the platen roller, the partition member is configured to partition the ink ribbon and the print medium, and has a support portion that rotatably supports the ribbon supply shaft, the partition member is configured to be swingable with respect to the main body portion between a close position for printing and an open position for replacing the ink ribbon, a ribbon supply shaft lock mechanism is configured to hinder rotation of the ribbon supply shaft, wherein the ribbon supply shaft lock mechanism is switched between a lock state and a non-lock state in conjunction with swing actions of the partition member, wherein the lock state is a state where the rotation of the ribbon supply shaft is hindered when the partition member is at the open position, and wherein the non-lock state is a state where the rotation of the ribbon supply shaft is permitted when the partition member is at the close position, and the ribbon supply shaft lock mechanism has: a gear coupled to the ribbon supply shaft; and a lock member, slidably supported by a projected portion of the partition member so as to be movable between a meshing position in which a claw portion of the lock member meshes with the gear and a non-meshing position where meshing between the claw portion and the gear is released, a guide rail provided in the main body portion in which the lock member slides along a guide surface following swing of the partition member, and a bias member biasing the lock member toward the guide rail. a printing unit including a main body portion, a printing portion, a ribbon supply shaft, a ribbon roll up shaft, and a partition member, wherein the printing portion is constituted by a thermal head and configured to print on a print medium together with a platen roller on a casing side of the printer, the ribbon supply shaft is configured to hold an ink ribbon to be supplied to the printing portion, the ribbon roll up shaft is configured to roll up the ink ribbon used in the printing portion, the thermal head is attached to the main body portion, and the ribbon roll up shaft and the partition member are provided in the main body portion, an end portion of the main body portion is supported by a support shaft so that the main body portion is swingable so as to separate the thermal head from the platen roller, the partition member is configured to partition the ink ribbon and the print medium, and has a support portion that rotatably supports the ribbon supply shaft, the partition member is configured to be swingable with respect to the main body portion between a close position for printing and an open position for replacing the ink ribbon, a ribbon supply shaft lock mechanism is configured to hinder rotation of the ribbon supply shaft, wherein the ribbon supply shaft lock mechanism is switched between a lock state and a non-lock state in conjunction with swing actions of the partition member, wherein the lock state is a state where the rotation of the ribbon supply shaft is hindered when the partition member is at the open position, and wherein the non-lock state is a state where the rotation of the ribbon supply shaft is permitted when the partition member is at the close position, and the ribbon supply shaft lock mechanism has: a gear coupled to the ribbon supply shaft; and a lock member, slidably supported by a projected portion of the partition member so as to be movable between a meshing position in which a claw portion of the lock member meshes with the gear and a non-meshing position where meshing between the claw portion and the gear is released, a guide rail provided in the main body portion in which the lock member slides along a guide surface following swing of the partition member, and a bias member biasing the lock member toward the guide rail. a gear coupled to the ribbon supply shaft; and a lock member, slidably supported by a projected portion of the partition member so as to be movable between a meshing position in which a claw portion of the lock member meshes with the gear and a non-meshing position where meshing between the claw portion and the gear is released, a guide rail provided in the main body portion in which the lock member slides along a guide surface following swing of the partition member, and a bias member biasing the lock member toward the guide rail.