--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+unsubscribe@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/7bf3540d-cdde-4ba7-a73b-40df26242670%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
you can't read local files with brython. brython uses the XML_HTTP_REQUEST given by the browser to load aditional files. it restricts to 'same origin' or you need a webserver to perform a cross-site request.
2017-09-08 4:37 GMT+02:00 Steph Reed <gothica...@gmail.com>:
Hi all,I'm looking to use Brython to automate some AutoCAD related tasks I do a lot at work by processing local DXF (text based) files.I have most of the code I need already in Python which I've translated over from an existing app I wrote in Java, but am stuck reading local files with Brython.I started with the Drag and Drop example and based on an earlier discussion had a look at this sample.Unfortunately I still can't make any progress, what am I missing?From the Drag & Drop example, it seems we receive a list of File objects so I tried opening the first one with open( f, 'rt' ) but get this error:ReferenceError: $OpenFile is not definedat Object.$url_open [as open] (brython.js:5927)at handleFileSelect0 (eval at run_script (brython.js:4131), <anonymous>:50:41)It does seem I have a real handle to the file, I can obtain info about it, but how can I read it into a string?Thanks
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+unsubscribe@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/af9b4e0e-6a07-4ff1-ba7a-fd31b673f231%40googlegroups.com.
2017-09-08 4:37 GMT+02:00 Steph Reed <gothica...@gmail.com>:Hi all,I'm looking to use Brython to automate some AutoCAD related tasks I do a lot at work by processing local DXF (text based) files.I have most of the code I need already in Python which I've translated over from an existing app I wrote in Java, but am stuck reading local files with Brython.I started with the Drag and Drop example and based on an earlier discussion had a look at this sample.Unfortunately I still can't make any progress, what am I missing?From the Drag & Drop example, it seems we receive a list of File objects so I tried opening the first one with open( f, 'rt' ) but get this error:ReferenceError: $OpenFile is not definedat Object.$url_open [as open] (brython.js:5927)at handleFileSelect0 (eval at run_script (brython.js:4131), <anonymous>:50:41)It does seem I have a real handle to the file, I can obtain info about it, but how can I read it into a string?
------Thanks
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/7bf3540d-cdde-4ba7-a73b-40df26242670%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+unsubscribe@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/af9b4e0e-6a07-4ff1-ba7a-fd31b673f231%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+unsubscribe@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/CABctKxtoidAuoT0sHhAL6EDUnfjRuz0YaBLPN0KZFosjWirVww%40mail.gmail.com.
My situation is a little odd.* Very heavily restricted corporate network.* Installation of Python environment not allowed* Existing Java desktop app requires upto 4 weeks of 'security' testing before IT will install to users - not ideal for small / frequent changes* Uploading files to any server outside company not allowed (and theoretically blocked by firewall)* Using in-browser processing by Javascript is allowed as long as data is not sent back to server.Files are basically large (30 - 45Mb) text based files exported from AutoCAD.The workflow I would like to achieve is as follows:1) Users opens web page2) User drags & drops single file (or uses Filepicker)3a) Page shows some info / calculations / deviation from required standards etc.3B) Page may make an updated DXF file (text) available for user to save to diskI've found it's fairly trivial to read a local text file into a Javascript variable using the tutorial here: https://www.html5rocks.com/en/tutorials/file/dndfiles/This works great, even allows me to slice the file if too big for processing in one go.That leaves only a remaining issues I can see, can I get that Javascript variable (which now contains the content of the local file) into Brython?
--
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+u...@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/d437b4c9-750b-4633-9221-175d66b7e5cd%40googlegroups.com.