Search Results

Search found 18238 results on 730 pages for 'python gui'.

Page 2/730 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How can I assert from Python C code?

    - by Joe
    I'm writing a Python class in C and I want to put assertions in my debug code. assert.h suits me fine. This only gets put in debug compiles so there's no chance of an assert failure impacting a user of the Python code*. I'm trying to divide my 'library' code (which should be separate to the code linked against Python) so I can use it from other C code. My Python methods are therefore thinnish wrappers around my pure-C code. So I can't do this in my 'library' code: if (black == white) { PyErr_SetString(PyExc_RuntimeError, "Remap failed"); } because this pollutes my pure-C code with Python. It's also far uglier than a simple assert(black != white); I believe that the Distutils compiler always sets NDEBUG, which means I can't use assert.h even in debug builds. Mac OS and Linux. Help! *one argument I've heard against asserting in C code called from Python.

    Read the article

  • How to add GUI to command-line Ubuntu?

    - by SlimGG
    I had installed Ubuntu on a VM, with a command-line only interface, now I have had enough of command-line interface experience and plan to proceed with GUI mode. But I dont want to install a fresh copy of Ubuntu with GUI mode; I want my current [CLI] to have GUI. I have Ubuntu 12.04 LTS installed as CLI, and desired to have some light-weight (less resource consuming, slow-system friendly) GUI. What are my options and how can I accomplish this?

    Read the article

  • Python version issues

    - by MidnightLightning
    I have a Mac which uses MacPorts to have multiple versions of Python installed and use the python_select application to switch between them. Currently, this Mac has OS 10.6.6, which comes with Python 2.6.1 installed as /usr/bin/python. Using MacPorts, I've installed the python27, python31, and python_select ports and now have this issue: python_select seems to not be switching the default python properly: $ which python /usr/bin/python $ python -V Python 2.6.1 $ /usr/bin/python -V Python 2.6.1 $ sudo python_select python27 Selecting version "python27" for python $ which python /opt/local/bin/python $ ls -l /opt/local/bin/python lrwxr-xr-x 1 root admin 24B Mar 18 10:24 /opt/local/bin/python -> /opt/local/bin/python2.7 $ python -V Python 2.6.1 # <-- Wrong!!! $ /opt/local/bin/python -V Python 2.7.1 # <-- Why are you not default? So, after running python_select, which python seems to think that the /opt/local/bin version is going to be used, but in reality, it seems that the /usr/bin one is taking precedent unless I specifically call the /opt/local/bin one. Is there something I'm doing wrong?

    Read the article

  • How can I get sikuli-ide to work?

    - by ayckoster
    I installed sikuli-ide with sudo apt-get install sikuli-ide Everything was fine until I tried to start it from the terminal. I typed sikuli-ide But the only response I got was [info] locale: en_US The application was not started, furthermore there is no desktop file and sikuli-ide does not show up in Dash Home. I guess there is something wrong with the package. I run Ubuntu 12.10 64bit. I tried to install it (Sikuli-X-1.0rc3 (r905)-linux-x86_64.zip) from their page, now the IDE starts, but when I try to execute a simple script I get the following error: [error] Stopped [error] An error occurs at line 1 [error] Error message: Traceback (most recent call last): File "", line 1, in File "/home/ayckoster/opt/Sikuli-IDE/sikuli-script.jar/Lib/sikuli/__init__.py", line 3, in File "/home/ayckoster/opt/Sikuli-IDE/sikuli-script.jar/Lib/sikuli/Sikuli.py", line 22, in java.lang.UnsatisfiedLinkError: /home/ayckoster/opt/Sikuli-IDE/libs/libVisionProxy.so: libml.so.2.1: cannot open shared object file: No such file or directory at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1935) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1860) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821) at java.lang.Runtime.load0(Runtime.java:792) at java.lang.System.load(System.java:1059) at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(NativeLoader.java:44) at org.sikuli.script.Finder.(Finder.java:33) at java.lang.Class.forName0(Native Method) at java.lang. Class.forName(Class.java:264) at org.python.core.Py.loadAndInitClass(Py.java:895) at org.python.core.Py.findClassInternal(Py.java:830) at org.python.core.Py.findClassEx(Py.java:881) at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133) at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28) at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122) at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137) at org.python.core.PyObject.__findattr__(PyObject.java:863) at org.python.core.imp.import_name(imp.java:849) at org.python.core.imp.importName(imp.java:884) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importFromAs(imp.java:978) at org.python.core.imp.importFrom(imp.java:954) at sikuli.Sikuli$py.f$0(/home/ayckoster/opt/Sikuli-IDE/siku li-script.jar/Lib/sikuli/Sikuli.py:211) at sikuli.Sikuli$py.call_function(/home/ayckoster/opt/Sikuli-IDE/sikuli-script.jar/Lib/sikuli/Sikuli.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:386) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161) at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:513) at org.python.core.imp.find_module(imp.java:467) at org.python.core.PyModule.impAttr(PyModule.java:100) at org.python.core.imp.import_next(imp.java:715) at org.python.core.imp.import_name(imp.java:824) at org.python.core.imp.importName(imp.java:884) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importAll(imp.java:998) at sikuli$py.f$0(/home/ayckoster/opt/Sikuli-IDE/sikuli-script.jar/Lib/sikuli/__init__.py:3) at sikuli$py.call_function(/home/ayckoster/opt/Sikuli-IDE/sikuli-script.jar/Lib/sikuli/__init__.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:386) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161) at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:513) at org.python.core.imp.find_module(imp.java:467) at org.python.core.imp.import_next(imp.java:713) at or g.python.core.imp.import_name(imp.java:824) at org.python.core.imp.importName(imp.java:884) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importAll(imp.java:998) at org.python.pycode._pyx2.f$0(:1) at org.python.pycode._pyx2.call_function() at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.Py.runCode(Py.java:1261) at org.python.core.Py.exec(Py.java:1305) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206) at org.sikuli.script.ScriptRunner.runPython(ScriptRunner.java:61) at org.sikuli.ide.SikuliIDE$ButtonRun.runPython(SikuliIDE.java:1572) at org.sikuli.ide.SikuliIDE$ButtonRun$1.run(SikuliIDE.java:1677) java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /home/ayckoster/opt/Sikuli-IDE/libs/libVisionProxy.so: libml.so.2.1: cannot open shared object file: No such file or directory If I try to use the click() method from the gui it fails. So I created my own click method and it look like this: This cannot be executed and produces the error above.

    Read the article

  • Build problems when adding `__str__` method to Boost Python C++ class

    - by Rickard
    I have started to play around with boost python a bit and ran into a problem. I tried to expose a C++ class to python which posed no problems. But I can't seem to manage to implement the __str__ functionality for the class without getting build errors I don't understand. I'm using boost 1_42 prebuild by boostpro. I build the library using cmake and the vs2010 compiler. I have a very simple setup. The header-file (tutorial.h) looks like the following: #include <iostream> namespace TestBoostPython{ class TestClass { private: double m_x; public: TestClass(double x); double Get_x() const; void Set_x(double x); }; std::ostream &operator<<(std::ostream &ostr, const TestClass &ts); }; and the corresponding cpp-file looks like: #include <boost/python.hpp> #include "tutorial.h" using namespace TestBoostPython; TestClass::TestClass(double x) { m_x = x; } double TestClass::Get_x() const { return m_x; } void TestClass::Set_x(double x) { m_x = x; } std::ostream &operator<<(std::ostream &ostr, TestClass &ts) { ostr << ts.Get_x() << "\n"; return ostr; } BOOST_PYTHON_MODULE(testme) { using namespace boost::python; class_<TestClass>("TestClass", init<double>()) .add_property("x", &TestClass::Get_x, &TestClass::Set_x) .def(str(self)) ; } The CMakeLists.txt looks like the following: CMAKE_MINIMUM_REQUIRED(VERSION 2.8) project (testme) FIND_PACKAGE( Boost REQUIRED ) FIND_PACKAGE( Boost COMPONENTS python REQUIRED ) FIND_PACKAGE( PythonLibs REQUIRED ) set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREAD ON) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) INCLUDE_DIRECTORIES ( ${PYTHON_INCLUDE_PATH} ) add_library(testme SHARED tutorial.cpp) target_link_libraries(testme ${Boost_PYTHON_LIBRARY}) target_link_libraries(testme ${PYTHON_LIBRARY} The build error I get is the following: Compiling... tutorial.cpp C:\Program Files (x86)\boost\boost_1_42\boost/python/def_visitor.hpp(31) : error C2780: 'void boost::python::api::object_operators::visit(ClassT &,const char *,const boost::python::detail::def_helper &) const' : expects 3 arguments - 1 provided with [ U=boost::python::api::object ] C:\Program Files (x86)\boost\boost_1_42\boost/python/object_core.hpp(203) : see declaration of 'boost::python::api::object_operators::visit' with [ U=boost::python::api::object ] C:\Program Files (x86)\boost\boost_1_42\boost/python/def_visitor.hpp(67) : see reference to function template instantiation 'void boost::python::def_visitor_access::visit,classT>(const V &,classT &)' being compiled with [ DerivedVisitor=boost::python::api::object, classT=boost::python::class_, V=boost::python::def_visitor ] C:\Program Files (x86)\boost\boost_1_42\boost/python/class.hpp(225) : see reference to function template instantiation 'void boost::python::def_visitor::visit>(classT &) const' being compiled with [ DerivedVisitor=boost::python::api::object, W=TestBoostPython::TestClass, classT=boost::python::class_ ] .\tutorial.cpp(29) : see reference to function template instantiation 'boost::python::class_ &boost::python::class_::def(const boost::python::def_visitor &)' being compiled with [ W=TestBoostPython::TestClass, U=boost::python::api::object, DerivedVisitor=boost::python::api::object ] Does anyone have any idea on what went wrrong? If I remove the .def(str(self)) part from the wrapper code, everything compiles fine and the class is usable from python. I'd be very greatful for assistance. Thank you, Rickard

    Read the article

  • How to organize Python modules for PyPI to support 2.x and 3.x

    - by Craig McQueen
    I have a Python module that I would like to upload to PyPI. So far, it is working for Python 2.x. It shouldn't be too hard to write a version for 3.x now. But, after following guidelines for making modules in these places: Distributing Python Modules The Hitchhiker’s Guide to Packaging it's not clear to me how to support multiple source distributions for different versions of Python, and it's not clear if/how PyPI could support it. I envisage I would have separate code for: 2.x 2.6 (maybe, as a special case to use the new buffer API) 3.x How is it possible to set up a Python module in PyPI so that someone can do: easy_install modulename and it will install the right thing whether the user is using 2.x or 3.x?

    Read the article

  • How to organize Python modules for PyPI to support 2.x and 3.x

    - by Craig McQueen
    I have a Python module that I would like to upload to PyPI. So far, it is working for Python 2.x. It shouldn't be too hard to write a version for 3.x now. But, after following guidelines for making modules in these places: Distributing Python Modules The Hitchhiker’s Guide to Packaging it's not clear to me how to support multiple source distributions for different versions of Python, and it's not clear if/how PyPI could support it. I envisage I would have separate code for: 2.x 2.6 (maybe, as a special case to use the new buffer API) 3.x How is it possible to set up a Python module in PyPI so that someone can do: easy_install modulename and it will install the right thing whether the user is using 2.x or 3.x?

    Read the article

  • Prevent Python from caching the imported modules

    - by Olivier
    While developing a largeish project (split in several files and folders) in Python with IPython, I run into the trouble of cached imported modules. The problem is that instructions import module only reads the module once, even if that module has changed! So each time I change something in my package, I have to quit and restart IPython. Painful. Is there any way to properly force reloading some modules? Or, better, to somehow prevent Python from caching them? I tried several approaches, but none works. In particular I run into really, really weird bugs, like some modules or variables mysteriously becoming equal to None... The only sensible resource I found is Reloading Python modules, from pyunit, but I have not checked it. I would like something like that. A good alternative would be for IPython to restart, or restart the Python interpreter somehow. So, if you develop in Python, what solution have you found to this problem?

    Read the article

  • Using Crypt function Python 3.3.2

    - by adampski
    In Windows and Python version 3.3.2, I try and call the python module like so: hash2 = crypt(word, salt) I import it at the top of my program like so: from crypt import * The result I get is the following: Traceback (most recent call last): File "C:\none\of\your\business\adams.py", line 10, in <module> from crypt import * File "C:\Python33\lib\crypt.py", line 3, in <module> import _crypt ImportError: No module named '_crypt' However, when I execute the same file adams.py in Ubuntu, with Python 2.7.3, it executes perfectly - no errors. I tried the following to resolve the issue for my Windows & Python 3.3.2 (though I'm sure the OS isn't the issue, the Python version or my use of syntax is the issue): Rename the directory in the Python33 directory from Lib to lib Rename the crypt.py in lib to _crypt.py. However, it turns out the entire crypt.py module depends on an external module called _crypt.py too. Browsed internet to download anything remotely appropriate to resemble _crypt.py It's not Python, right? It's me...(?) I'm using syntaxes to import and use external modules that are acceptable in 2.7.3, but not in 3.3.2. Or have I found a bug in 3.3.2?

    Read the article

  • Python 2 dict_items.sort() in Python 3

    - by DaveWeber
    I'm porting some code from Python 2 to 3. This is valid code in Python 2 syntax: def print_sorted_dictionary(dictionary): items=dictionary.items() items.sort() In Python 3, the dict_items have no method 'sort' - how can I make a workaround for this in Python 3?

    Read the article

  • Making python 3.3 default python 3 interpreter instead of 3.2

    - by user1873947
    So, to keep it simple. Ubuntu 12.10 has python 3.2 pre installed and it is linked to "python3". I downloaded python 3.3 and it's command is "python3.3". However, I downloaded pySide for python3 from synaptic. Using "from PySide.QtCore import *" fails on python3.3. BUT, when I ran just "python3" (aka 3.2) everything works fine. Synaptic just installed lib for python3.2 which is default for python3 in ubuntu. How can I force synaptic to install modules for python3.3? Thanks

    Read the article

  • how to write high quality GUI software with qt?

    - by Opetmar
    I want to write a project using QT library, so after learning the library and mastering it how should I start, what other libraries or things that I should learn? are there any other tools that will help me during the development or tools well help the end user to install the software and using it? What are the things that I should be aware? what are the things that I should avoid so it can run efficiently?

    Read the article

  • sudo apt-get install python.pip python-dev Gives Error

    - by user2539745
    I am learning Django from http://gettingstartedwithdjango.com/ and I have windows 7 32-bit. The tutorial asked to install virtualbox and vagrant(tutorial had precise64 and it had issues in my pc so I installed precise32) so I did it. Now the tutorial asked to do sudo apt-get install python-dev python.pip so I did it but it gave me this error > vagrant@precise32:~$ sudo apt-get install python.pip python-dev Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'python-pip' for regex 'python.pip' Note, selecting 'python-pipeline' for regex 'python.pip' The following extra packages will be installed: libexpat1 libexpat1-dev libpython2.7 python-pkg-resources python-setuptools python-support python2.7 python2.7-dev python2.7-minimal Suggested packages: python-distribute python-distribute-doc python2.7-doc binfmt-support The following NEW packages will be installed: libexpat1-dev libpython2.7 python-dev python-pip python-pipeline python-pkg-resources python-setuptools python-support python2.7-dev The following packages will be upgraded: libexpat1 python2.7 python2.7-minimal 3 upgraded, 9 newly installed, 0 to remove and 63 not upgraded. Need to get 34.7 MB/35.7 MB of archives. After this operation, 42.0 MB of additional disk space will be used. Do you want to continue [Y/n]? y Err (http removed)us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7 i386 2.7 .3-0ubuntu3.1 404 Not Found [IP: 91.189.91.15 80] Err (http removed)us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7-minimal i386 2.7.3-0ubuntu3.1 404 Not Found [IP: 91.189.91.15 80] Err (http removed)us.archive.ubuntu.com/ubuntu/ precise-updates/main libpython2.7 i386 2.7.3-0ubuntu3.1 404 Not Found [IP: 91.189.91.15 80] Err (http removed)us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7-dev i386 2.7.3-0ubuntu3.1 404 Not Found [IP: 91.189.91.15 80] Failed to fetch (http removed)us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python 2.7_2.7.3-0ubuntu3.1_i386.deb 404 Not Found [IP: 91.189.91.15 80] Failed to fetch (http removed)us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python 2.7-minimal_2.7.3-0ubuntu3.1_i386.deb 404 Not Found [IP: 91.189.91.15 80] Failed to fetch (http removed)us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/libpyt hon2.7_2.7.3-0ubuntu3.1_i386.deb 404 Not Found [IP: 91.189.91.15 80] Failed to fetch (http removed)us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python 2.7-dev_2.7.3-0ubuntu3.1_i386.deb 404 Not Found [IP: 91.189.91.15 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-mis sing? Please help what should I do ??

    Read the article

  • Python IDLE: How to type correct indentation?

    - by user2988464
    Mac: Maverick Python: 3.4 I tried to testtimeit module in Python's IDLE import timeit >>> timeit.timeit( "obj.method", """ class SomeClass: def method(self): pass obj = SomeClass() """) When I tried to type def method(self): on the next line of class SomeClass, I hit Tab, it prompted a window showing the files inside my Document directory. So I hit Ctrl+Tab instead. But I still got the error: Traceback (most recent call last): File "<pyshell#26>", line 6, in <module> """) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/timeit.py", line 213, in timeit return Timer(stmt, setup, timer).timeit(number) File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/timeit.py", line 122, in __init__ code = compile(src, dummy_src_name, "exec") File "<timeit-src>", line 9 _t0 = _timer() ^ IndentationError: unindent does not match any outer indentation level Can someone explain: how to fix it, and how to avoid the prompt of My Document appear? Thx!!!

    Read the article

  • How to install python modules for specific python version

    - by Zayatzz
    I needed to install UCS2 python next to UCS4 python. So I went to comp.lang.python and asked them about it. Probably not the best place to ask it, but they answered https://groups.google.com/forum/?fromgroups#!topic/comp.lang.python/bGuAfqa76W8 and now i have brand new python 2.7.3 ucs2 installed in /opt/bin/python What I need now is - how can I install all other python modules that I have installed for that python version also. Basically stuff like PIL and postgresql and mod_wsgi - basically everything needed to run Django for that python version. Is this the right the place to ask for it?

    Read the article

  • call python with system() in R to run a python script emulating the python console

    - by Yihui
    I want to pass a chunk of Python code to Python in R with something like system('python ...'), and I'm wondering if there is an easy way to emulate the python console in this case. For example, suppose the code is "print 'hello world'", how can I get the output like this in R? >>> print 'hello world' hello world This only shows the output: > system("python -c 'print \"hello world\"'") hello world Thanks! BTW, I asked in r-help but have not got a response yet (if I do, I'll post the answer here).

    Read the article

  • Unity GUI not in build, but works fine in editor

    - by Darren
    I have: GUITexture attached to an object A script that has GUIStyles created for the Textfield and Buttons that are created in OnGUI(). This script is attached to the same object in number 1 3 GUIText objects each separate from the above. A script that enables the GUITexture and the script in number 1 and 2 respectively This is how it is supposed to work: When I cross the finish line, number 4 script enables number 1 GUITexture component and number 2 script component. The script component uses one of number 3's GUIText objects to show you your best lap time, and also makes a GUI.Textfield for name entry and 2 GUI.Buttons for "Submit" and "Skip". If you hit "Submit" the script will submit the time. No matter which button you press, The remaining 2 GUIText objects from number 3 will show you the top 10 best times. For some reason, when I run it in editor, everything works 100%, but when I'm in different kinds of builds, the results vary. When I am in a webplayer, The GUITexture and the textfield and buttons appear, but the textfield and buttons are plain and have no evidence of GUIStyles. When I click one of the buttons, the score gets submitted but I do not get the fastest times showing. When I am in a standalone build, the GUITexture shows up, but nothing else does. If I remove the GUIStyle parameter of the GUI.Textfield and GUI.Button, they show up. Why am I getting these variations and how can I fix it? Code below: void Start () { Names.text = ""; Times.text = ""; YourBestTime.text = "Your Best Lap: " + bestTime + "\nEnter your name:"; //StartCoroutine(GetTimes("Test")); } void Update() { if (!ShowButtons && !GettingTimes) { StartCoroutine(GetTimes()); GettingTimes = true; } } IEnumerator GetTimes () { Debug.Log("Getting times"); YourBestTime.text = "Loading Best Lap Times"; WWW times_get = new WWW(GetTimesUrl); yield return times_get; WWW names_get = new WWW(GetNamesUrl); yield return names_get; if(times_get.error != null || names_get.error != null) { print("There was an error retrieiving the data: " + names_get.error + times_get.error); } else { Times.text = times_get.text; Names.text = names_get.text; YourBestTime.text = "Your Best Lap: " + bestTime; } } IEnumerator PostLapTime (string Name, string LapTime) { string hash= MD5.Md5Sum(Name + LapTime + secretKey); string bestTime_url = SubmitTimeUrl + "&Name=" + WWW.EscapeURL(Name) + "&LapTime=" + LapTime + "&hash=" + hash; Debug.Log (bestTime_url); // Post the URL to the site and create a download object to get the result. WWW hs_post = new WWW(bestTime_url); //label = "Submitting..."; yield return hs_post; // Wait until the download is done if (hs_post.error != null) { print("There was an error posting the lap time: " + hs_post.error); //label = "Error: " + hs_post.error; //show = false; } else { Debug.Log("Posted: " + hs_post.text); ShowButtons = false; PostingTime = false; } } void OnGUI() { if (ShowButtons) { //makes text box nameString = GUI.TextField( new Rect((Screen.width/2)-111, (Screen.height/2)-130, 222, 25), nameString, 20, TextboxStyle); if (GUI.Button( new Rect( (Screen.width/2-74.0f), (Screen.height/2)- 90, 64, 32), "Submit", ButtonStyle)) { //SUBMIT TIME if (nameString == "") { nameString = "Player"; } if (!PostingTime) { StartCoroutine(PostLapTime(nameString, bestTime)); PostingTime = true; } } else if (GUI.Button( new Rect( (Screen.width/2+10.0f), (Screen.height/2)- 90, 64, 32), "Skip", ButtonStyle)) { ShowButtons = false; } } } }

    Read the article

  • Resources on concepts/theory behind GUI development?

    - by ShrimpCrackers
    I was wondering if there were any resources that explain concepts/theory behind GUI development. I don't mean a resource that explains how to use a GUI library, but rather how to create your own widgets. For example a resource that explains different methods on how to implement scrollable listboxes. I ask because I have an idea for a game tool where I would like to create my own widgets and let users drag and drop them onto some kind of form. How do GUI libraries usually draw widgets? I'm not sure if reskinning widgets from a GUI library fits my needs, since widget behavior needs to be dynamic based on user interaction.

    Read the article

  • Web technologies on GUI apps

    - by Apalala
    I developed many GUI applications for the Windows platform during my early professional career, and saw several GUI frameworks come, have whole magazines devoted to them, and then fade away. MFC is iconic. Tasked with writing yet another GUI application, I starter researching cross-platform frameworks like Qt and WxWindows. I found the same steep learning curves I knew from before, and tooling doesn't help much in building a functional and elegant user interface because its clumsy and complicated. But people are building beautiful and functional UIs on the Web all the time (look at this site!). The standards, the libraries, and the tools are certainly there. My thought and my question: Why not write a GUI in which most of the UI is handled by an embedded browser? I already know that the Qt widgets support a large part of CSS and JavaScript, and programmers with good knowledge about web development are relatively easy to find, ..., so... Have you done something like that before? What's your experience/advise?

    Read the article

  • Installing PIL (Python Imaging Library) in Win7 64 bits, Python 2.6.4

    - by Rafael Almeida
    I'm trying to install said library for use with Python. I tried downloading the executable installer for Windows, which runs, but says it doesn't find a Python installation. Then tried registering (http://effbot.org/zone/python-register.htm) Python, but the script says it can't register (although the keys appear in my register). Then I tried downloading the source package: I run the setup.py build and it works, but when I run setup.py install it says the following: running install running build running build_py running build_ext building '_imaging' extension error: Unable to find vcvarsall.bat What can I do?

    Read the article

  • How to become a solid python web developer [closed]

    - by Estarius
    Possible Duplicate: How do I learn Python from zero to web development? I have started Python recently with the goal to become a solid developer to make a web application eventually. However, as time goes by I am wondering if I am being optimal about how I will achieve my goal. I would compare it to a game for example, to be better you must spend time playing and trying new things... However, if you just log in and sit in the lobby chatting you are most likely not progressing. So far, this is my plan (feel free to comment or judge it): Review basic programmation concepts Start coding slowly in Python Once comfortable in Python, learn about web development in Python Learn about those things we heard about: SQLAlchemy, MVC, TDD, Git, Agile (Group project) To achieve these things, I started the Learn python the hard way exercises, which I am doing at the rate of 5 per days. I also started to read Think Python at the same time and planning to move on with Dive into python. As far as my research goes, these documentations along with Python documentation is usually what is the most recommended to learn Python. I consider this to get my point 1 and 2 done. While learning Python is really great, my goal remains to do quality web development. I know there are books about Django etc. however I would like to become comfortable with any Python web development. This means without Framework and with Framework... Any framework, then be able to choose the one which best fits our needs. For this I would like to know if some people have suggestions. Should I just get a book on Django and it should apply to everything ? What would be the best method to go from Python to Web Python and not end up creating crappy code which would turn into nightmares for other programmers ? Then finally, those "things we hear about". While I understand what they all do basically, I am fairly sure that like everything, there are good and wrong ways of making use of them. Should I go through at least a whole book on each before starting to use them or keep it at their respective online documentation ? Are there some kind of documentation which links their use to Python ? Also, from looking at Django and Pyramid they seems to use something else than MVC, while the Django model looks similar, the Pyramid one seems to cut a whole part of it... Is learning MVC still worth it ? Sorry for the wall of text, Thanks in advance !

    Read the article

  • Why do people hesitate using Python 3?

    - by Ham
    Python 3 has been released in December 2008. A lot of time has passed since then but still today many developers hesitate using Python 3. Even popular frameworks like Django are not compatible with Python 3 yet but still rely on Python 2. Sure, Python 3 has some incompatibilities to Python 2 and some people need to rely on backwards-compatibility. But hasn't Python 3 been around long enough now for most projects to switch or start with Python 3? Having two competiting versions has so many drawbacks; two branches need to be maintained, confusion for learners and so on, so why is there such a big hesitation throughout the Python community in switching to Python 3?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >