python

Running unexported .dll functions with python

Hello! This may seem like a weird question, but I would like to know how I can run a function in a .dll from a memory 'signature'. I don't understand much about how it actually works, but I needed it badly. Its a way of running unexported functions from within a .dll, if you know the memory signature and adress of it. For example, I have...

What are the best prebuilt libraries for doing Web Crawling in Python

I need to crawl and store locally for future analysis the contents of a finite list of websites. I basically want to slurp in all pages and follow all internal links to get the entire publicly available site. Are there existing free libraries to get me there? I've seen Chilkat, but it's for pay. I'm just looking for baseline function...

Python script to list users and groups

I'm attempting to code a script that outputs each user and their group on their own line like so: user1 group1 user2 group1 user3 group2 ... user10 group6 etc. I'm writing up a script in python for this but was wondering how SO might do this. Thanks! p.s. Take a whack at it in any language but I'd prefer python. EDIT: I'm...

How can the user communicate with my python script using the shell?

How can I implement the following in python? #include <iostream> int main() { std::string a; std::cout << "What is your name? "; std::cin >> a; std::cout << std::endl << "You said: " << a << std::endl; } Output: What is your name? Nick You said: Nick ...

Fixed-point arithmetic

Does anyone know of a library to do fixed point arithmetic in Python? Or, does anyone has sample code? ...

Drawing with Webdings in PIL

I've got a Python program using PIL to render text, and it works great with all kinds of fonts. But it only draws "missing glyph" rectangles with wingdings or webdings. Here's a sample that tries to draw every unicode character: # Run this with .ttf file path as an argument, and also an encoding if you like. # It will make 16 PNGs wit...

How to get the "python setup.py" submits informations on freshmeat?

With this you can easily submit the information about your software on pypi: python setup.py register But there is not a similar command for submitting information to freshmeat. How could I write a distutils.Command that let me do the following. python setup.py freshmeat-submit ...

What's the most pythonic way of access C libraries - for example, OpenSSL?

I need to access the crypto functions of OpenSSL to encode Blowfish data in a CBC streams. I've googled and found some Blowfish libraries (hand written) and some OpenSSL wrappers (none of the seem complete.) In the end, I need to access the certain OpenSSL functions, such as the full blowfish.h library of commands. What's the pythonic/r...

I am looking for good projects in python.

I' am looking for good projects in python. can anyone give me ideas? where can i look for open source projects in python? ...

Global variables in Python

A global variable created in one function cannot be used in another function directly. Instead I need to store the global variable in a local variable of the function which needs its access. Am I correct? Why is it so? ...

long double returns and ctypes

i have a c function which returns a long double. i'd like to call this function from python using ctypes, and it mostly works. setting so.func.restype = c_longdouble does the trick -- except that python's float type is a c_double so if the returned value is larger than a double, but well within the bounds of a long double, python still...

How to save inline formset models in Django?

Formsets have a .save() method, and the documentation says to save in views like this: if request.method == "POST": formset = BookInlineFormSet(request.POST, request.FILES, instance=author) if formset.is_valid(): formset.save() # Do something. else: formset = BookInlineFormSet(instance=author) I am followin...

Python unittest with expensive setup

My test file is basically: class Test(unittest.TestCase): def testOk(): pass if __name__ == "__main__": expensiveSetup() try: unittest.main() finally: cleanUp() However, I do wish to run my test through Netbeans testing tools, and to do that I need unittests that don't rely on an environment se...

return more than one value from a function in Python

How to return more than one variable from a function in Python??? ...

Which software for intranet CMS - Django or Joomla?

In my company we are thinking of moving from wiki style intranet to a more bespoke CMS solution. Natural choice would be Joomla, but we have a specific architecture. There is a few hundred people who will use the system. System should be self explainable (easier than wiki). We use a lot of tools web, applications and integrated within 3...

Python and different Operating Systems

I am about to start a personal project using python and I will be using it on both Linux(Fedora) and Windows(Vista), Although I might as well make it work on a mac while im at it. I have found an API for the GUI that will work on all 3. The reason I am asking is because I have always heard of small differences that are easily avoided if ...

Generating a PDF report from Google App Engine

I'm new to both Google App Engine and Python. I would like to be able to generate a PDF from GAE using data from the web app. Anybody have a suggestion on the best way to do this. Are there any examples out there I could use as a foundation. Thanks Very Much ...

Best Way To Determine if a Sequence is in another sequence in Python

This is a generalization of the "string contains substring" problem to (more) arbitrary types. Given an sequence (such as a list or tuple), what's the best way of determining whether another sequence is inside it? As a bonus, it should return the index of the element where the subsequence starts: Example usage (Sequence in Sequence):...

Drag button between panels in wxPython.

Does anyone know of an example where it is shown how to drag a button from one panel to another in wxPython? I have created a bitmap button in a panel, and I would like to be able to drag it to a different panel and drop I there. I haven't found any examples using buttons, just text and files. I am using the latest version of Python ...

Django on IronPython

I am interested in getting an install of Django running on IronPython, has anyone had any success getting this running with some level of success? If so can you please tell of your experiences, performance, suggest some tips, resources and gotchas? ...