python

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

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...

How can I retrieve the signal strength of nearby wireless LAN networks on Windows using Python?

How can I retrieve the signal strength of nearby wireless LAN networks on Windows using Python? I would like to either show or graph the values. ...

Get list of Python module variables in Bash

For a Bash completion script I need to get all the variables from an installed Python module that match a pattern. I want to use only Python-aware functionality, to avoid having to parse comments and such. ...

Can I turn off implicit Python unicode conversions to find my mixed-strings bugs?

When profiling our code I was surprised to find millions of calls to C:\Python26\lib\encodings\utf_8.py:15(decode) I started debugging and found that across our code base there are many small bugs, usually comparing a string to a unicode or adding a sting and a unicode. Python graciously decodes the strings and performs the followin...

Eventlet and locking

Since Eventlet uses green threading and asynchronous I/O, do I still need to set locks before accessing objects? My understanding is that greenlets are all part of one thread and locking isn't necessary. Can anyone confirm or deny this? ...

How can I transfer a file via XMPP using Python?

I'm using xmpppy library for my jabber remote administration bot, but I can't find how to send/receive a file and save it inside the directory specified. The documentation is poor and there isn't any examples, but I really want to make it. Can anyone show some examples or some links about it? Or maybe I should use an alternative xmpp bin...

Google group word count for members?

I have a google group, and I'd like to figure out how many words each member has posted. Is there a utility to do this? If not, how can I get started writing a Python script to do this? Should I just grab XML from the group's feed and look through that? (I don't know anything about Python's handling of XML.) On the Google groups site, ...

Simple python mvc framework

Is there any lightweight mvc webframework which is not necessary to install to the server? I need something simple, that i could just copy to the shared hosting. And it must handle urls other that localhost/test.py, something like this localhost/Blog/test ...

Scheduling a task on python

I want to run a program that runs a function every 4 hours. What is the least consuming way to do so? ...

On-Demand Python Thread Start/Join Freezing Up from wxPython GUI

I'm attempting to build a very simple wxPython GUI that monitors and displays external data. There is a button that turns the monitoring on/off. When monitoring is turned on, the GUI updates a couple of wx StaticLabels with real-time data. When monitoring is turned off, the GUI idles. The way I tried to build it was with a fairly sim...

python: naming a module that has a two-word name

I'm trying to put together a really simple module with one .py source file in it, and have already run into a roadblock. I was going to call it scons-config but import scons-config doesn't work in Python. I found this SO question and looked at PEP8 style guide but am kind of bewildered, it doesn't talk about two-word-name conventions. W...

adding the feedparser module to python

I recently downloaded and installed feedparser with python, I tried to run it but Netbeans shouts on import: ImportError: No module named feedparser restarted the Netbeans, still no go. ...

What scripts should not be ported from bash to python?

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. ...

python: simple example for a python egg with a one-file source file?

I'm not quite sure how to build a really simple one-file source module. Is there a sample module out there one the web somewhere which can be built as a python .egg? From the setuptools page it looks pretty simple, you just have your setup.py file and then at least one other .py file somewhere, and I can build an .egg file OK, and even ...

Extracting words between delimiters [] in python

From the below string, I want to extract the words between delimters [ ] like 'Service Current','Service','9991','1.22': str='mysrv events Generating Event Name [Service Current], Category [Service] Test [9991] Value [1.22]' How can I extract the same in python? Thanks in advance Kris ...

Django Deserialization

I am getting the following error: Traceback (most recent call last): File "../tests.py", line 92, in test_single_search for return_obj in serializers.deserialize("json",response, ensure_ascii=False): File "/Library/Python/2.6/site-packages/django/core/serializers/json.py", line 38, in Deserializer for obj in PythonDe...

python: where to put application data that can be edited by computer users

I'm working on a really simple python package for our internal use, and want to package it as a .egg file, and when it's installed/used I want it to access a text file that is placed in an appropriate place on the computer. So where is the best place to put application data in python? (that is meant to be edited by users) How do I get ...

Python required variable style

What is the best style for a Python method that requires the keyword argument 'required_arg': def test_method(required_arg, *args, **kwargs): def test_method(*args, **kwargs): required_arg = kwargs.pop('required_arg') if kwargs: raise ValueError('Unexpected keyword arguments: %s' % kwargs) Or something else? I want ...

How to fix this dll loading python error?

Hello, I use one c++ dll in my python code. When I run my python app on my computer, it works fine but when I copy all to another computer this happen: Traceback (most recent call last): File "C:\users\Public\SoundLog\Code\Código Python\SoundLog\SoundLog.py", line 9, in <module> from Auxiliar import * File "C:\users\Public\SoundL...

Alternative for python's pass in php

Do you know any php statement working like python's pass ...