Search Results

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

Page 11/730 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • python __import__() imports from 2 different directories when same module exists in 2 locations

    - by programer_gramer
    Hi, I have a python application , which has directory structure like this. -pythonapp -mainpython.py -module1 -submodule1 -file1.py -file2.py -submodule2 -file3.py -file3.py -submodule3 -file1.py -file2.py -file5.py -file6.py -file7.py when I try to import the python utilities(from mainpython.py) under submodule3 , I get the initial 2 files from submodule1.(please note that submodule1 and 3 have 2 different files with the same name). However the same import works fine when there is no conflict i.e it correctly imports file 5,6,7 from submodule3. Here is the code : name=os.path.splitext(os.path.split("module1\submodule3\file1.py")[1])[0] -- file1.py name here is passed dynamically. module = import(name) //Here is name is like "file1" it works(but with the above said issue, though, when passes the name of the file dynamically), but if I pass complete package as "module1.submodule1.file1" it fails with an ImportError saying that "no module with name file1" Now the question is how do we tell the interpreter to use only the ones under "module1.submodule3.file2"? I am using python This is really urgent one and I have run out of all the tries. Hope some experienced python developers can solve this for me?

    Read the article

  • Python Game using pyGame with Window Menu elements

    - by Zoja
    Here's the deal. I'm trying to write an arkanoid clone game and the thing is that I need a window menu like you get in pyGTK. For example File-(Open/Save/Exit) .. something like that and opening an "about" context where the author should be written. I'm already using pyGame for writting the game logic. I've tried pgu to write the GUI but that doesn't help me, altough it has those menu elements I'm taking about, you can't include the screen of the game in it's container. Does anybody know how to include such window menus with the usage of pyGame ?

    Read the article

  • Python/Tkinter make a custom window

    - by user1435947
    I want to make a window without the top taskbar (that is movable), so there is only thin outline around the GUI box. I also want to add my own 'X' to the box. import Tkinter class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.parent = master ............ def main(): root = Tk() root.attributes('-fullscreen', True) root.geometry('500x250+500+200') app = Application(root) app.parent.configure(background = 'gray32') root.resizable(width=FALSE, height=FALSE) app.mainloop() main() I tried forcing the box to resize after going into fullscreen to remove the taskbar, though box is no longer movable. Any suggestions? [I have seen this thread: Python/Tkinter: Removing/disabling a resizable window's maximize button under Windows The -toolwindow attribute didn't work for me, maybe because I use linux...]

    Read the article

  • Install GNU Emacs GUI in Fedora

    - by FLW
    I've installed the "emacs" package from yum, but typing emacs at the terminal doesn't launch the GUI version. I was under the impression it installed by default, and emacs -nw would be used for the terminal version. Is there a GUI package available for Fedora 14 (GNOME)? I couldn't find "emacs-gtk" or "emacs-gnome" or any X packages with yum search emacs-. Edit: To clarify, this is about GNU Emacs and not XEmacs.

    Read the article

  • *nix: Run as different user GUI

    - by singpolyma
    I want to run an application using only GUI as a different user. Not root. I want the user to be presented with a dropdown of system users, select one, enter the password, and the app gets run as that user. Like gksudo but user to run as specified in GUI and not as switch. Does such an app exist?

    Read the article

  • How to configure RHEL so users can access an app GUI remotely

    - by Rhyuk
    I have an application installed in my RHEL6 box that has a GUI (AppGui.sh). My problem is that a few non-tech users would like to access this GUI remotely. I've tried several guides over the internet but I still cant make it work. I tried: -Installing X Window System -Enabling FORWARDX11=yes in my sshd_config -Exporting $DISPLAY variable -Connecting through ssh -X user@host (simply stays there) How can I setup my box from scratch to make this work?

    Read the article

  • automated GUI tests fails when running from Jenkins

    - by adm
    Jenkins(master) is installed on the Linux system and runs automated tests on the node slave (Win-XP) via ssh connection. But all the GUi tests are failed, when GUI tests are running locally(WINXP system) testst are passed. I tried tscon.exe 0 /dest:console for forwards the calls to the console but I am getting the error: Could not connect sessionID 0 to sessionname console, Error code 7045 Error [7045]:The requested session access is denied. thanks

    Read the article

  • `which python` points to the python I want, but `python` runs the wrong version

    - by tramdas
    I want to use python24 provided by ports, so I've installed it, and python_select -s shows that the version I want is indeed selected. Running which python gives /opt/local/bin/python, and running /opt/local/bin/python gives me the version I want. However when I run python from the shell, I get the /usr/bin/python version instead. I don't have a python alias. Here's the situation in a nutshell: I believe the path is set up sensibly, and which python seems to confirm this. alias only returns 1 entry, which is something unrelated to this. Nevertheless, running python from the bash shell gives me the wrong python! I'm kind of stumped! What am I overlooking?

    Read the article

  • Python - cours intensif pour les scientifiques : Python avancé, par Rick Muller

    Bonjour,Je vous présente ce tutoriel traduit par Raphaël Seban intitulé : Python - cours intensif pour les scientifiquesPartie 3 : Python avancé Pour de nombreux scientifiques, Python est LE langage de programmation par excellence, car il offre de grandes possibilités en analyse et modélisation de données scientifiques avec relativement peu de charge de travail en termes d'apprentissage, d'installation ou de temps de développement. C'est un langage que vous pouvez intégrer...

    Read the article

  • Python version priority in OSX/UNIX PATH environment variable

    - by mindthief
    Hi all, I want my system to use /usr/bin/python, but it's currently using /opt/local/bin/python, which points to /usr/bin/python2.6. I tried modifying the PATH variable in my .bashrc as PATH=~/bin:$PATH ...and then set a symbolic link in ~/bin to point to /usr/bin/python. i.e. ~/bin/python --> /usr/bin/python I figured this might prioritize this symlink over the /opt/local version if it came before the other one in the PATH variable, but when I opened a new shell I still found python pointing to /opt/local/bin. Any advice on a good way to get the system to use /usr/bin/python? Also, I usually use ipython as opposed to python directly. I'm assuming that if the system starts to use the correct version of python then ipython would also use that version? If not, how could I also get ipython to use the correct version? Thanks!

    Read the article

  • How do I learn Python from zero to web development? [closed]

    - by Terence Ponce
    I am looking into learning Python for web development. Assuming I already have some basic web development experience with Java (JSP/Servlets), I'm already familiar with web design (HTML, CSS, JS), basic programming concepts and that I am completely new to Python, how do I go about learning Python in a structured manner that will eventually lead me to web development with Python and Django? I'm not in a hurry to make web applications in Python so I really want to learn it thoroughly so as not to leave any gaps in my knowledge of the technologies involving web development in Python. Are there any books, resource or techniques to help me in my endeavor? In what order should I do/read them? UPDATE: When I say learning in a structured manner, I mean starting out from the basics then learning the advanced stuff without leaving some of the important details/features that Python has to offer. I want to know how to apply the things that I already know in programming to Python.

    Read the article

  • Python - problem in importing new module - libgmail

    - by Microkernel
    Hi all, I downloaded Python module libgmail from sourceforge and extracted all the files in the archive. The archive had setup.py, so I went to that directory in command prompt and did setup.py install I am getting the following error message I:\libgmail-0.1.11>setup.py install Traceback (most recent call last): File "I:\libgmail-0.1.11\setup.py", line 7, in ? import libgmail File "I:\libgmail-0.1.11\libgmail.py", line 36, in ? import mechanize as ClientCookie ImportError: No module named mechanize This may be trivial, but I am new to python. So plz guide what to do. please note, I am using python 2.4 and using Windows-XP. Thank you MicroKernel

    Read the article

  • Exposing a pointer in Boost.Python

    - by Goose Bumper
    I have this very simple C++ class: class Tree { public: Node *head; }; BOOST_PYTHON_MODULE(myModule) { class_<Tree>("Tree") .def_readwrite("head",&Tree::head) ; } I want to access the head variable from Python, but the message I see is: No to_python (by-value) converter found for C++ type: Node* From what I understand, this happens because Python is freaking out because it has no concept of pointers. How can I access the head variable from Python? I understand I should use encapsulation, but I'm currently stuck with needing a non-encapsulation solution.

    Read the article

  • How to install Python ssl module on Windows?

    - by Jader Dias
    The Google App Engine Launcher tells me: WARNING appengine_rpc.py:399 ssl module not found. Without the ssl module, the identity of the remote host cannot be verified, and connections may NOT be secure. To fix this, please install the ssl module from http://pypi.python.org/pypi/ssl . I downloaded the package and it contained a setup.py file. I ran: python setup.py install and then: Python was built with Visual Studio 2003; blablabla use MinGW32 Then I installed MinGW32 and now the compilation doesn't work. The end of the compilation errors contains: ssl/_ssl2.c:1561: error: `CRYPTO_LOCK' undeclared (first use in this function) error: command 'gcc' failed with exit status 1 What should I do?

    Read the article

  • Python Tkinter - Edit external object within event handler?

    - by M3RPHY
    Hey all, As the title says, I'm grabbing the cursor location within a motion triggered event handler in Tkinter. I'd like to update an existing label widget with the location, however I cannot for the life of me figure out how to edit the label's text field (or any external object for that matter) within the event handler. From what I understand, event is the only argument passed to the handler, which means I can't pass the label object. How do I access objects outside of the handler? Apologize for the noobish question as I'm a C programmer new to Python. Thanks!

    Read the article

  • Python MQTT: TypeError: coercing to Unicode: need string or buffer, bool found

    - by user2923860
    When my python code tries to connect to the MQTT broker it gives me this Type Error: Update- I added the Complete Error Traceback (most recent call last): File "test.py", line 20, in <module> mqttc.connect(broker, 1883, 60, True) File "/usr/local/lib/python2.7/dist-packages/mosquitto.py", line 563, in connect return self.reconnect() File "/usr/local/lib/python2.7/dist-packages/mosquitto.py", line 632, in reconnect self._sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0)) File "/usr/lib/python2.7/socket.py", line 561, in create_connection sock.bind(source_address) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) TypeError: coercing to Unicode: need string or buffer, bool found The code of the python file is: #! /usr/bin/python import mosquitto broker = "localhost" #define what happens after connection def on_connect(rc): print "Connected" #On recipt of a message do action def on_message(msg): n = msg.payload t = msg.topic if t == "/test/topic": if n == "test": print "test message received" # create broker mqttc = mosquitto.Mosquitto("python_sub") #define callbacks mqttc.on_message = on_message mqttc.on_connect = on_connect #connect mqttc.connect(broker, 1883, 60, True) #Subscribe to topic mqttc.subscribe("/test/topic", 2) #keep connected while mqttc.loop() == 0: pass I have no idea why its giving me this it work 2 days ago.

    Read the article

  • python c extension, problems with dlopen on mac os

    - by Jason Sundram
    I've taken a library that is distributed as a binary lib (.a) and header, written some c++ code against it, and want to wrap the results up in a python module. I've done this here. The problem is that when importing this module on Mac OSX (I've tried 10.5 and 10.6), I get the following error: dlopen(/Library/Python/2.5/site-packages/dirac.so, 2): Symbol not found: _DisposePtr Referenced from: /Library/Python/2.5/site-packages/dirac.so Expected in: dynamic lookup This looks like symbols defined in the Carbon framework aren't being properly resolved, but I'm not sure what to do about that. I am supplying -framework Carbon to distutil.core.Extension's extra_link_args parameter, so I'm not sure what else I should do. Any help would be much appreciated.

    Read the article

  • Python: convert buffer type of SQLITE column into string

    - by Volatil3
    I am new to Python 2.6. I have been trying to fetch date datetime value which is in yyyy-mm-dd hh:m:ss format back in my Python program. On checking the column type in Python I get the error: 'buffer' object has no attribute 'decode'. I want to use the strptime() function to split the date data and use it but I can't find how to convert a buffer to string. The following is a sample of my code (also available here): conn = sqlite3.connect("mrp.db.db", detect_types=sqlite3.PARSE_DECLTYPES) cursor = conn.cursor() qryT = """ SELECT dateDefinitionTest FROM t WHERE IDproject = 4 AND IDstatus = 5 ORDER BY priority, setDate DESC """ rec = (4,4) cursor.execute(qryT,rec) resultsetTasks = cursor.fetchall() cursor.close() # closing the resultset for item in resultsetTasks: taskDetails = {} _f = item[10].decode("utf-8") The exception I get is: 'buffer' object has no attribute 'decode'

    Read the article

  • file reading in python

    - by Jagdev
    So my whole problem is that I have two files one with following format(for Python 2.6): #comments config = { #comments 'name': 'hello', 'see?': 'world':'ABC',CLASS=3 } This file has number of sections like this. Second file has format: [23] [config] 'name'='abc' 'see?'= [23] Now the requirement is that I need to compare both files and generate file as: #comments config = { #comments 'name': 'abc', 'see?': 'world':'ABC',CLASS=3 } So the result file will contain the values from the first file, unless the value for same attribute is there in second file, which will overwrite the value. Now my problem is how to manipulate these files using Python. Thanks in advance and for your previous answers in short time ,I need to use python 2.6

    Read the article

  • running "./script" gets syntax error after import statements, but "python script" works fine

    - by nzomkxia
    I'm doing something with the sys.argv in python here is the code: age1.py import datetime import os import sys if len(sys.argv) == 2: now_time = datetime.datetime.now() future_time = now_time + datetime.timedelta(int(sys.argv[1])) print "date in", sys.argv[1],"days",future_time elif len(sys.argv) == 4: print "three paras" spe_time = datetime.datetime(int(sys.argv[1]),int(sys.argv[2]),int(sys.argv[3])) now_time = datetime.datetime.now() diff_time = now_time - spe_time print "days since then..." , diff_time if I run the code in bash like: python age1.py xxxx, the program goes fine but if I run that like ./age1.py xxxx, the mouse will become a symbol like "+", then the program ends up with: "./age1.py: line 5: syntax error near unexpected token `sys.argv' ./age1.py: line 5: `if len(sys.argv) == 2:' system: Ubuntu 10.10 Python 2.7.3 any reason for that?

    Read the article

  • GUI system architecture?

    - by topright
    I'm designing GUI (graphical user interface) system for a game engine (C++). Idea is to create a heirarchy of GUI controllers like Focusable, Hoverable, Dragable etc. Every GUI component can attach multiple controllers, they modify component's behaviour. I think it gives flexible system and protects from code duplication. Different instances of the same GUI class can have different complex behaviours (may be, even change it dynamically), so this approach looks practical. The other choice is to add focused, hovered, dragged etc. flags in the base GUI component class. It looks like overhead and not that flexible. Another solution is to use Decorator pattern and wrap objects with FocusDecorator, HoverDecorator etc. Maintaining such system looks a bit harder. Question: What are pitfalls in my solution? May be you have seen a better approaches in GUI systems? What are the best ways of implementing such flexible complex system?

    Read the article

  • How can I use the Homebrew Python with Homebrew MacVim on Mountain Lion?

    - by Stephen Jennings
    I originally asked and answered this question: How can I use the Homebrew Python version with Homebrew MacVim? These instructions worked on Snow Leopard using Xcode 4.0.1 and associated developer tools. However, they no longer seem to work on Mountain Lion with Xcode 4.4.1. My goal is to leave the system's version of Python completely untouched, and to only install PyPI packages into Homebrew's site-packages directory. I want to use the vim_bridge package in MacVim, so I need to compile MacVim against the Homebrew version of Python. I've edited the MacVim formula to add these to the arguments: --enable-pythoninterp=dynamic --with-python-config-dir=/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/Current/lib/python2.7/config Then I install with the command: brew install macvim --override-system-vim --custom-icons --with-cscope --with-lua However, it still seems to be somehow using Python 2.7.2 from the system. This seems strange to me because it also seems to be using the correct executable. :python print(sys.version) 2.7.2 (default, Jun 20 2012, 16:23:33) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] :python print(sys.executable) /usr/local/bin/python $ /usr/local/bin/python --version Python 2.7.3 $ /usr/local/bin/python -c "import sys; print(sys.version)" 2.7.3 (default, Aug 12 2012, 21:17:22) [GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] $ readlink /usr/local/lib/python2.7/config /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/Current/lib/python2.7/config I've removed everything in /usr/local and reinstalled Homebrew by running these commands: $ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) $ brew install git mercurial python ruby $ brew install macvim (nope, still broken) $ brew remove macvim $ ln -s /usr/local/Cellar/python/..../python2.7/config /usr/local/lib/python2.7/config $ brew install macvim

    Read the article

  • Phone-book Database Help - Python

    - by IDOntWantThat
    I'm new to programming and have an assignment I've been working at for awhile. I understand defining functions and a lot of the basics but I'm kind of running into a brick wall at this point. I'm trying to figure this one out and don't really understand how the 'class' feature works yet. I'd appreciate any help with this one; also any help with some python resources that have can dummy down how/why classes are used. You've been going to work on a database project at work for sometime now. Your boss encourages you to program the database in Python. You disagree, arguing that Python is not a database language but your boss persists by providing the source code below for a sample telephone database. He asks you to do two things: Evaluate the existing source code and extend it to make it useful for managers in the firm. (You do not need a GUI interface, just work on the database aspects: data entry and retrieval - of course you must get the program to run or properly work He wants you to critically evaluate Python as a database tool. Import the sample code below into the Python IDLE and enhance it, run it and debug it. Add features to make this a more realistic database tool by providing for easy data entry and retrieval. import shelve import string UNKNOWN = 0 HOME = 1 WORK = 2 FAX = 3 CELL = 4 class phoneentry: def __init__(self, name = 'Unknown', number = 'Unknown', type = UNKNOWN): self.name = name self.number = number self.type = type # create string representation def __repr__(self): return('%s:%d' % ( self.name, self.type )) # fuzzy compare or two items def __cmp__(self, that): this = string.lower(str(self)) that = string.lower(that) if string.find(this, that) >= 0: return(0) return(cmp(this, that)) def showtype(self): if self.type == UNKNOWN: return('Unknown') if self.type == HOME: return('Home') if self.type == WORK: return('Work') if self.type == FAX: return('Fax') if self.type == CELL: return('Cellular') class phonedb: def __init__(self, dbname = 'phonedata'): self.dbname = dbname; self.shelve = shelve.open(self.dbname); def __del__(self): self.shelve.close() self.shelve = None def add(self, name, number, type = HOME): e = phoneentry(name, number, type) self.shelve[str(e)] = e def lookup(self, string): list = [] for key in self.shelve.keys(): e = self.shelve[key] if cmp(e, string) == 0: list.append(e) return(list) # if not being loaded as a module, run a small test if __name__ == '__main__': foo = phonedb() foo.add('Sean Reifschneider', '970-555-1111', HOME) foo.add('Sean Reifschneider', '970-555-2222', CELL) foo.add('Evelyn Mitchell', '970-555-1111', HOME) print 'First lookup:' for entry in foo.lookup('reifsch'): print '%-40s %s (%s)' % ( entry.name, entry.number, entry.showtype() ) print print 'Second lookup:' for entry in foo.lookup('e'): print '%-40s %s (%s)' % ( entry.name, entry.number, entry.showtype() ) I'm not sure if I'm on the right track but here is what I have so far: def openPB(): foo = phonedb() print 'Please select an option:' print '1 - Lookup' print '2 - Add' print '3 - Delete' print '4 - Quit' entry=int(raw_input('>> ')) if entry==1: namelookup=raw_input('Please enter a name: ') for entry in foo.lookup(namelookup): print '%-40s %s (%s)' % (entry.name, entry.number, entry.showtype() ) elif entry==2: name=raw_input('Name: ') number=raw_input('Number: ') showtype=input('Type (UNKNOWN, HOME, WORK, FAX, CELL): \n>> ') for entry in foo.add(name, number, showtype): #Trying to figure out this part print '%-40s %s (%s)'% (entry.name, entry.number, entry.showtype() ) elif entry==3: delname=raw_input('Please enter a name to delete: ') # #Trying to figure out this part print "Contact '%s' has been deleted" (delname) elif entry==4: print "Phone book is now closed" quit else: print "Your entry was not recognized." openPB() openPB()

    Read the article

  • Installing rpm module of Python for yum

    - by vito
    I've installed Python and yum from source (configure, make, make install), not using RPMs because that's leading to several other issues. So when I executed: # yum update ... I get the following error: Traceback (most recent call last): File "/usr/bin/yum", line 22, in <module> import yummain File "/usr/share/yum/yummain.py", line 22, in <module> import clientStuff File "/usr/share/yum/clientStuff.py", line 18, in <module> import rpm ImportError: No module named rpm Now because I've installed yum and python from source, do I need to install Python's rpm module from source, too? Because installing the rpm for this module lead to the following error: # rpm -vih rpm-python-3.0.4-6x.i386.rpm warning: rpm-python-3.0.4-6x.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e error: Failed dependencies: python >= 1.5.2 is needed by rpm-python-3.0.4-6x.i386 libbz2.so.0 is needed by rpm-python-3.0.4-6x.i386 librpm.so.0 is needed by rpm-python-3.0.4-6x.i386 Suggested resolutions: /var/spool/up2datepython-2.3.4-14.7.el4.x86_64.rpm I tried searching for the source of this module, but I couldn't find it. Any help in installing this module is appreciated. Thanks for your time. Other info: # python -V Python 2.6.5

    Read the article

  • Python or Ruby for freelance?

    - by Sophia
    Hello, I'm Sophia. I have an interest in self-learning either Python, or Ruby. The primary reason for my interest is to make my life more stable by having freelance work = $. It seems that programming offers a way for me to escape my condition of poverty (I'm on the edge of homelessness right now) while at the same time making it possible for me to go to uni. I intend on being a math/philosophy major. I have messed with Python a little bit in the past, but it didn't click super well. The people who say I should choose Python say as much because it is considered a good first language/teaching language, and that it is general-purpose. The people who say I should choose Ruby point out that I'm a very right-brained thinker, and having multiple ways to do something will make it much easier for me to write good code. So, basically, I'm starting this thread as a dialog with people who know more than I do, as an attempt to make the decision. :-) I've thought about asking this in stackoverflow, but they're much more strict about closing threads than here, and I'm sort of worried my thread will be closed. :/ TL;DR Python or Ruby for freelance work opportunities ($) as a first language? Additional question (if anyone cares to answer): I have a personal feeling that if I devote myself to learning, I'd be worth hiring for a project in about 8 weeks of work. I base this on a conservative estimate of my intellectual capacities, as well as possessing motivation to improve my life. Is my estimate necessarily inaccurate? random tidbit: I'm in Portland, OR I'll answer questions that are asked of me, if I can help the accuracy and insight contained within the dialog.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >