Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
lavachemist committed Jun 1, 2020
1 parent 2506323 commit 0a9aa10
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Community-PythonScripts/Scripts/PushToPrinter_USB.py
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from OpenFL import Printer, FLP
import glob
import Tkinter, tkFileDialog
import os
from datetime import datetime

startTime = datetime.now()

root = Tkinter.Tk()
root.withdraw()
folderPath = tkFileDialog.askdirectory()
os.chdir(folderPath)

p=Printer.Printer()
p.initialize()
layerNum=0
lastBlock = (len(glob.glob("*.flp"))-1)


while layerNum <= lastBlock:
layerStartTime = datetime.now()
fileName =(str(layerNum).zfill(8)+'.flp')
layer=FLP.fromfile(fileName)
p.write_block_flp(layerNum, layer)
print("layer " +str(layerNum)+ " of "+ str(lastBlock) + " saved in " + str(datetime.now() - layerStartTime))
layerNum += 1
print("All FLP files written to Printer, total time to complete - "+str(datetime.now() - startTime))

0 comments on commit 0a9aa10

Please sign in to comment.