• I looked up the documentation for dialog.alert, and was directed to look at console.alert.

    I found this topic from 3 years ago about a similar hang with console.alert.

    console.alert with SceneView
    https://forum.omz-software.com/topic/1699/console-alert-with-sceneview

  • Thank you! (Removing reprlib, revealed 4 more packages that must have been added by some package I installed. After they were all removed, all is working again). If that happens again, I now know where to look.

  • thank you. It works fine now.

  • @omz
    Hello you can u send my a video tutorial how to open pythonista file in google chrome I am a beginner in programming
    Thank you

  • I downloaded that app. I ran it under the latest Pythonist 3 beta, and got the following output in the console window.

    No compatible devices found.

    So, I didn't full test all functionality, but I got no errors.

  • Thanks omz. I ended up using the total play time to wait.

    I had thought of that, but polling for a time with short sleeps, so that the wait can be interrupted, is probably less efficient than a notification, although admittedly only slightly so. It certainly is a lot simpler.

  • Why does Apple make it so hard to do the simplest of things. (Like on Windows and Android they have API’s for this.)

    Like how is know what WIFI is around you going to hurt them or the End user.


  • Pythonista posted

    site://forum.omz-software.com midi

  • @condenado , hey you got your answer, sorry was not the one you are looking for. But I have never heard of theano, would have been better if you also included a link so those interested could easily see what it was. Look its not a big problem. But links can be handy and helpful. Saves ppl having to do searches and possibly landing on the wrong site. Often even ppl cant help you, but they still like to understand the question fully. Also a learning experience if you have never heard of it.

  • Here is a simple dialog template that uses a pyui file created using designer. This helps to use ui controls like images, textviews, segmentedcontrol in dialogs. The gist with sample pyui file is here. I hope it helps

    https://gist.github.com/73431fef1f00c462c3bee0551bd14be8

    import ui class PyuiDialogController (object): def __init__(self, title='Pyui Dialog', pyui_dialog='pyui_dialog.pyui', cancel_button_title='Cancel', done_button_title='Done'): self.params = None self.view = ui.load_view(pyui_dialog) self.view.frame = (0, 0, 500, 500) self.view.name = title done_button = ui.ButtonItem(title=done_button_title) done_button.action = self.done_action cancel_button = ui.ButtonItem(title=cancel_button_title) cancel_button.action = self.cancel_action self.view.right_button_items = [done_button, cancel_button] def get_params(self): params = {} params['switch1'] = self.view['switch1'].value params['textfield1'] = self.view['textfield1'].text sg = self.view['segmentedcontrol1'] params['segmentedcontrol1'] = sg.segments[sg.selected_index] return params def cancel_action(self, sender): self.view.close() def done_action(self, sender): self.params = self.get_params() self.view.close() def pyui_dialog(): c = PyuiDialogController() c.view.present('sheet') c.view.wait_modal() return c.params def button_action(sender): print(pyui_dialog()) v = ui.View(frame=(0,0,600,600), name='Test Pyui Dialog') v.add_subview(ui.Button(frame=(200,300, 100,100), title='Test Dialog', action=button_action)) v.present('sheet')
  • @mikael simple answer, pretty busy these days :/

  • @plessner - thanks for that - all up and running now.

    @omz admin - that's pretty much exactly what I was after - very much appreciated.

    Regards,

    Bruce

  • TKInter is a desktop GUI module that accepts mouse input, while the iPhone is a touch based UI. This means there are some interactions and gestures that don't map across between them. For example the phone interface has no analogue of right-click or click-and-drag. Similarly the desktop interaction model has no analogue of a long-press or swipe.

    You can arbitrarily try and assign mappings between some of these, so you could say long press equals right-click, but that might work fine in one application but poorly in another in which long-click might need to be used for another gesture such as to select something for drag-and-drop. No one mapping will work for every application, but at the framework level to make something portable you'd need to have fixed mappings.

    Then you have the issue that the phone doesn't have a concept of floating windows, re-sizable windows, overlapping windows, floating dialogs and menus, scroll bars and many others. How do you do shift-click or control-click on a phone? Conversely on the phone you have conventions like swiping from the edge of the screen and multi-touch gestures. There are very good reasons why even Apple's own OSX GUI framework was not ported directly to iOS.

    It is possible to write UI toolkits from scratch that are designed to map across between touch and desktop paradigms. The way to do this is to identify a subset of gestures and interactions in both models and creating strict mappings between them at the toolkit level. This gives you the portability, but at a cost of sacrificing the ability to use interactions that can't be deterministic-ally mapped to the other platforms. Unfortunately TKInter wasn't designed in terms of sacrificing desktop GUI capabilities in order to make the subset portable to phones, so it has a lot of GUI paradigm interactions and display widgets included that don't port over.

  • Just reporting back as we've been using this arrangement for two weeks now. So far, so good. Thanks!

  • @josephwang , hey. I dont have anything close to a complete answer for you. ButI will try to get the ball rolling. Firstly, I am not sure you are asking the right question. Why you say IDE (Intergrated Development Enviroment) that is a very different thing from asking about the differences of coding in Pythonista vrs to a desktop computer.
    I suspect you mean the differences between coding Python in Pythonista vrs on a desktop enviroment. I am just guessing.
    Coding in Pythonista as far as UI's go, could be said to be similar if not the same to a desktop. There are many IDE's available on desktops to code Python in. Some are more capable than others. Pythonista, at least to me feels like a nice IDE to work in. It has support for saving code snippets, refactoring code re tabs and spaces, a nice autocomplete implementation. Various navigation tools to move through your files etc. While I dont use a desktop much, I have used various IDE's. Some clearly better than Pythonista and others not not as good. IDE's are normally a very personal choice for people. Some will just use NotePad+ for example. After all you are just creating a bunch of text files with a .py extension.
    The other question (the difference about coding between Pythonista and on a desktop) is a lot harder to answer at least for me. I am not sure someone will take on this question here. Maybe they will. Maybe has a good link/resource they can point to.
    However, I think for the most part you will be fine in Pythonista. But because you have watched those videos they probably are very desktop centric and I assume they would promote best practices for developing on a desktop. I would say early in the course they show you how to setup virtual environments to work in. As far as I am aware, you cant setup up a virtual env in Pythonista. And its probably not as necessary to have compared to a desktop (ok, that could be argued I guess). But my point is, that there will be differences between your video learning and using Pythonista. Any other issue that was probably covered early in the course is the use of pip to install 3rd party modules. Pythonista itself does not support pip. But some of the nice users here created a shell you can install called StaSh that gives you access to the pip cmd. However because of some iOS rules, you can only pip install pure python modules. Keep in mind, Pythonista ships with a bunch of useful 3rd party libs also, you can see these in the docs.
    I will just finish by saying, please dont let my remarks discourage you. It was not my purpose. There are just some differences. I pointed out the 2 above, because I expect they are probably the first differences you will come across (I think) from your video tutorials.
    But dont let this deter you in anyway. The differences that exist, do so for a reason. In most cases you should be fine. Eg. The pip example, there is a work around.
    I honestly hope I have not confused you. I would have preferred not to tackle the question, mainly because I do not want to discourage you. In terms of the Python coding you learnt in the videos, you should not have a problem. Pythonista supports both Python 2.7 and 3.5, there is an active beta version that supports Python 3.6.
    Hope it helps

  • Black Mamba 1.4.1 released:

    Compatibility check with 3.1.1 (311016) Bundle refactoring enhanced with future, libfuturize, libpasteurize modules script/refactoring/futurize.py introduced (see Python Future) Equivalent of futurize -1 --all-imports -n -w --add-suffix 3 $editor.get_path() (Stage 1 only) When futurizer ends, editor text is replaced with content of the .py3 and .py3 is trashed You can run futurizer script with Cmd Option F Improved updates check Console is not cluttered with local / latest release info (installer prints this) Update check() doesn't ask if update should (not) be installer (installer also asks) If there's new update available, installer is executed, you will still be asked (just once, not twice) Script new_file.py modified File opened Asks for a file name (empty & Enter -> Cancel) New file path is currently opened file dirname + entered file name If file doesn't exist, new file is created and opened If file exists, file is opened No file opened Same behavior as now New tab created and New File... button tap emulated Installer Replaced ModuleNotFoundError (Python 3.6) with ImportError (Python 3.5)
  • Thanks @ccc Replacing if statements (particularly nested if statements) by a simple statement is always better

  • If you want to use your ipad as the peripheral, not the controller, then you would instead use
    CABTMIDILocalPeripheralViewController

    Either way adds your device to the CoreMidi devicelist, but i think you need to use CoreMIDI via objc_util to actually do anything with it.

Internal error.

Oops! Looks like something went wrong!