{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The autoreload extension is already loaded. To reload it, use:\n",
      "  %reload_ext autoreload\n",
      "C:/Users/ahmet/AppData/Local/Temp/bmes\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'a:\\\\b'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2\n",
    "\n",
    "import bmes\n",
    "\n",
    "print(bmes.tempdir())\n",
    "#print(bmes.downloadurl('http://sacan.biomed.drexel.edu/lib/exe/fetch.php?rev=&media=course:bcomp2:db:homework_mirdb_dog75.txt','homework_mirdb_dog75.txt'))\n",
    "\n",
    "#dbfile = bmes.downloadurl('http://sacan.biomed.drexel.edu/ftp/binf/targetscandb.sqlite');\n",
    "#print(dbfile)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "system_redirecttofile() missing 1 required positional argument: 'cmd'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-6-ccde16ad8196>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mbmes\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msystem_redirecttofile\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m: system_redirecttofile() missing 1 required positional argument: 'cmd'"
     ]
    }
   ],
   "source": [
    "bmes.system_redirecttofile()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def test():\n",
    "    import bmes_ahmet_loader\n",
    "test();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os,sys;\n",
    "os.system(sys.executable + ' -m pip install -U wxPython')\n",
    "%gui wx\n",
    "import wx\n",
    "app=wx.App()\n",
    "msgbox=wx.MessageDialog(None, 'It works!');\n",
    "msgbox.ShowModal()\n",
    "msgbox.Destroy()\n",
    "app.MainLoop()\n",
    "del app"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Anaconda3\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "import sys,os,re;\n",
    "dirname=os.path.dirname(sys.executable);\n",
    "dirbasename=os.path.basename(dirname);\n",
    "print(dirbasename)\n",
    "print(re.match(dirbasename,'anaconda.*',re.IGNORECASE))\n",
    "if re.match(dirbasename,'anaconda.*',re.IGNORECASE):\n",
    "    print(sys.executable);\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
