Search Results

Search found 13693 results on 548 pages for 'python metaprogramming'.

Page 179/548 | < Previous Page | 175 176 177 178 179 180 181 182 183 184 185 186  | Next Page >

  • How to change the app name in OSX menubar in a pure-Python application bundle?

    - by gyim
    I am trying to create a pure-Python application bundle for a wxPython app. I created the .app directory with the files described in Apple docs, with an Info.plist file etc. The only difference between a "normal" app and this bundle is that the entry point (CFBundleExecutable) is a script which starts with the following line: #!/usr/bin/env python2.5 Everything works fine except that the application name in the OSX menubar is still "Python" although I have set the CFBundleName in Info.plist (I copied the result of py2app, actually). The full Info.plist can be viewed here: http://tinyurl.com/32qgpjt How can I change this? I have read everywhere that the menubar name is only determined by CFBundleName. How is it possible that the Python interpreter can change this in runtime? Note: I was using py2app before, but the result was too large (50 MB instead of the current 100KB) and it was not even portable between Leopard and Snow Leopard... so it seems to be much easier to create a pure-Python app bundle "by hand" than transforming the output of py2app.

    Read the article

  • python: how/where to put a simple libary installed in a well-known-place on my computer

    - by Jason S
    I need to put a python script somewhere on my computer so that in another file I can use it. How do I do this and where do I put it? And where in the python documentation do I learn how to do this? I'm a beginner + don't use python much. library file: MyLib.py put in a well-known place def myfunc(): .... other file SourceFile.py located elsewhere, doesn't need to know where MyLib.py is: something = MyLib.myfunc()

    Read the article

  • Is it still too early to hop aboard the Python 3 train?

    - by Znarkus
    I'm still a beginner to Python, so I thought I could as well learn the newest iteration of Python. Especially since it is now 3.1 or 3.2 something. But it seems like many mayor modules are still only supported by 2.6. Like the python-mysql module; from what I read on http://mysql-python.blogspot.com/ it seems like 3.x support won't be seen in any near future. Do you use version 3, how do you get around these problems? Should I retreat to 2.6? If not, what should I use to connect to MySQL?

    Read the article

  • Python: How to run unittest.main() for all source files in a subdirectory?

    - by Pete
    I am developing a Python module with several source files, each with its own test class derived from unittest right in the source. Consider the directory structure: dirFoo\ test.py dirBar\ __init__.py Foo.py Bar.py To test either Foo.py or Bar.py, I would add this at the end of the Foo.py and Bar.py source files: if __name__ == "__main__": unittest.main() And run Python on either source, i.e. $ python Foo.py ........... ---------------------------------------------------------------------- Ran 11 tests in 2.314s OK Ideally, I would have "test.py" automagically search dirBar for any unittest derived classes and make one call to "unittest.main()". What's the best way to do this in practice? I tried using Python to call execfile for every *.py file in dirBar, which runs once for the first .py file found & exits the calling test.py, plus then I have to duplicate my code by adding unittest.main() in every source file--which violates DRY principles.

    Read the article

  • What should I know about Python to identify comments in different source files?

    - by Can't Tell
    I have a need to identify comments in different kinds of source files in a given directory. ( For example java,XML, JavaScript, bash). I have decided to do this using Python (as an attempt to learn Python). The questions I have are 1) What should I know about python to get this done? ( I have an idea that Regular Expressions will be useful but are there alternatives/other modules that will be useful? Libraries that I can use to get this done?) 2) Is Python a good choice for such a task? Will some other language make this easier to accomplish?

    Read the article

  • Where can I find Python tutorials aimed at people who are already programmers?

    - by Chris R
    I'm a reasonably skilled programmer, and I'm interested in branching out into some new languages -- python, specifically -- but frankly I do NOT want to go through a tutorial that assumes I know nothing about programming. I want a tutorial -- again, preferably for python -- that assumes I'm just unfamiliar with the language itself and describes the ways I can use the language to solve problems. Does such a beast exist? I mean, other than the Python wiki?

    Read the article

  • Do you know any mainstream desktop applications developed with Python and Qt?

    - by systempuntoout
    Hi i'm developing a small prototype of a desktop application using Qt and Python because i would like to distribute it in a multiplatform way. A friend of mine is annoying me on messenger because he claims that there are not known cool mainstream desktop apps developed with Qt and python technologies so, what i am doing, is just an exercise without future. Do you know any cool apps developed in python+Qt? thanks

    Read the article

  • How to define a new type (class) in Python using C API?

    - by ~mech
    Hi, I am trying to use the Python C API to define a new class inside a module that would expose certain functionality written in C to Python code. I specifically want to have it in the form of a class and not a set of module functions. However, I can't find anything regarding this particular task in the official documentation. The closest I could find is PyClass_New function (in the Python.h header) but it is not mentioned anywhere in the official docs, so I assume it is not supposed to be used. So, what is the proper way to define a new Python class from C code? Thanks.

    Read the article

  • Metaprogramming on web server

    - by bobobobo
    From time to time, I find myself writing server code that produces JavaScript code as the output result. I can point out why it is really bad: Inextricable tie between server code and client code. Can render client code un-reusable. But sometimes, it just seems to make sense. And isn't it kinda sorta interesting? I guess the question is, is writing server code that produces JavaScript code a really bad practice, or "does everyone do it"?

    Read the article

  • Is there a way to read 10000 lines from a file in python?

    - by windsound
    I am relatively new in python, was working on C a lot. Since I was seeing so many new functions in python that I do not know, I was wondering if there is a function that can request 10000 lines from a file in python. Something like this is what I expect if that kind of function exist: lines = get_10000_lines(file_pointer) Did python have a build-in function or is there any module that I can download for this? If not, how do I do this to be easiest way. I need to analyze a huge file so I want to read 10000 lines and analyze per time to save memory. Thanks for helping!

    Read the article

  • How to create make .so files from code written in c or c++ that are usable from python

    - by None
    Looking at python modules and at code in the "lib-dnyload" directory in the python framework, I noticed whenever code is creating some kind of gui or graphic it imports a non-python file with a .so extension. And there are tons .so files in "lib-dnyload". From googling things I found that these files are called shared objects and are written in c or c++. I have a mac and I use gcc. I want to know how to make shared object files that are accessible via python. Mainly just how to make shared objects with gcc using mac os x.

    Read the article

  • What scripts should not be ported from bash to python?

    - by Jack
    I decided to rewrite all our Bash scripts in Python (there are not so many of them) as my first Python project. The reason for it is that although being quite fluent in Bash I feel it's somewhat archaic language and since our system is in the first stages of its developments I think switching to Python now will be the right thing to do. Are there scripts that should always be written in Bash? For example, we have an init.d daemon script - is it OK to use Python for it? We run CentOS. Thanks.

    Read the article

  • Pyglet vs. PyQt

    - by L. De Leo
    I need to implement a really simple card game. As the game logic is written in Python I chose to stick with some Python framework even if my goal is to develop a Windows only version. I also don't like to work with .NET so I ruled out Iron Python + WPF. I tried to write a simple prototype with Pyglet but soon discovered that I will have to do a lot of stuff by hand: things like detecting mouseover events and finding which card was clicked on and moving it, etc... very low level and unnecessary for my use-case. So I thought it might be easier to do things in PyQt. Do you reckon it would be feasible to use PyQt for implementing a simple card game? Will I have higher level events I can work with?

    Read the article

  • Mountain Lion overheating issue have to do with launchd/Python?

    - by Christopher Jones
    So, Ever since I installed ML, my MacBook Air has been running SUPER hot. Opened up activity monitor, and everything seemed to be pretty normal, until I had it refresh every .5 seconds... and then I started seeing some interesting things. A 'Python' process appears and is terminated several times a second, and uses TONS of CPU 70-110. It's parent process is 'launchd' - and when I sample the process, there is a lot going on with Python. http://db.tt/ovuX3hZM These appear and disappear too quickly to get one... this one only happened to be using 70 ish percent of CPU... but they consistently hit 100-110%. http://db.tt/ovuX3hZMg The parent process... launchd. lots of context switches and UNIX system calls... What is the deal here? (photo goes here when I earn the street cred) The sample of launchd. ANY help here could be of help to not only me, but possibly many others experiencing decreased battery life and warmer laps these days because of this Mountain Lion weirdness. PLEASE HELP! PS - I'd put the screen grabs inline, but i don't have enough street cred yet.

    Read the article

  • How to manually start and re-start Apache with mod_wsgi powering a password protected Python WSGI app?

    - by Mahmoud Abdelkader
    I'm working on a project where I have to meet some regulatory requirements that require at least 3 out of 5 authorized users to start a backend web service that handles very sensitive information using pre-assigned passwords. Right now, the prototype has been approved and is running using Python's wsgiref.simple_server(), which I have programmed to manually prompt for the passwords. Now that the prototype has been approved, I have to migrate the web application to a production environment where I will need to run it behind Apache and mod_wsgi. I have two questions: Right now, I use a thin Python wrapper around expect to programmatically allow for remote password entry. How do I get Apache to prompt me for a password before starting? Will this have to be in the app.wsgi script that's executed by mod_wsgi? How would that work since Apache daemonizes, and thus, has no stdin! Will I have to worry about some type of code reload? Apache probably has some maximum number of requests before it kills and restarts another worker process, but, would this require a password prompt as well?

    Read the article

  • Can I have a .desktop Launcher for both Python2 and Python3 depending on version installed?

    - by Takkat
    After very few issues only I moved my application from Python2 to Python3 making sure it will still run with Python 2.7, and hence has python = 2.7 as dependency only. This was mainly done because Python3, and some dependencies are not installed in a default 12.04 LTS, and I do not want my users to have to install all Python3 only to run my script. When I create an appname.desktop launcher I now need to decide if it starts my application using Python2, or Python3 like EXEC=python /path/app.py EXEC=python3 /path/app.py But what I would like it to do is to Launch the application with the Python3 interpreter if Python3 is installed. Otherwise use Python2 if Python3 is not installed. How can this be done? Do I need to tell it in my package installation script, or can I have a launcher which can handle both (in case people install Python3 after they had installed my script)?

    Read the article

  • Which programming language suits a system that must work without user input

    - by Ruud
    I'm building a prototype of a device that will function much alike a digital photoframe. It will display images retrieved from the internet. The device must start up and run the photoframe. It will have no user interface. The device has a minimal ubuntu installation, but I could install Xorg or whatever needed. Question: I have trouble figuring out which programming language will be suitable. I've just started using Python to try out several things and I am able to download and display images. I guess that means Python can do what I'd like, but is it suitable as a language that will be run on boot without any user interference? Related questions: - How do I set up Linux to start that script automatically? - How to setup a second Python script as a server that runs in the background to retrieve images before they are displayed (Because I think I'll need threading of some sort?)

    Read the article

  • find and replace app for ms word

    - by kittensatplay
    i program in python. i want to know if a program in python will work for ms word since ms word is not open source. the program basically changes words like ms word already does BUT it changes words based of off a list you write, which from what i know ms word doesnt do. if it does, just let me know. if there is a related program that is needed for a program in python or any language to work with a closed source software, jsut let me know.b also you can link to a phython specific place to ask phython related question if you know of one since im going to have a lot more in the future

    Read the article

  • Help me choose an engine

    - by Gjorgji
    So far i've been trying to make a RTS in pygame but, i feel like 2d is not enough and pygame has me do a lot of stuff that i would not like doing. What i would like doing is working on the AI gameplay and such and not worying too much about how to display stuff,physics and the like too much. So far Unity has boo which is supposed to be similar to python i wonder if that could work. How similar is it to python should i use this? Other options as far as i can see are ogre3d python bindings and UDK. Which would best suit my needs?

    Read the article

  • Python Profiling not installed in Ubuntu? How do I get it in a virtualenv and without apt-get?

    - by interstar
    According to the Python documentation, the "profile" module is part of the standard library. But I can't find it. On my home machine, I was able to add it using apt-get install. (ie. it's split out into a separate ubuntu package.) On my work machine, (also ubuntu) I'm running in a virtualenv, so apt-get install isn't relevant. I can install python modules from pypi using easy-install, but I can't see anything on pypi which corresponds to the profiling module. (Presumably because it's meant to be part of the standard python install.) So how can I install it in this environment?

    Read the article

  • Template metaprogram converting type to unique number

    - by daramarak
    I just started playing with metaprogramming and I am working on different tasks just to explore the domain. One of these was to generate a unique integer and map it to type, like below: int myInt = TypeInt<AClass>::value; I want to know if this is at all possible, and in that case how. Because although I have learned much about exploring this subject I still have failed to come up with an answer. (P.S. A yes/no answer is much more gratifying than a c++ solution that doesn't use metaprogramming, as this is the domain that I am exploring)

    Read the article

< Previous Page | 175 176 177 178 179 180 181 182 183 184 185 186  | Next Page >