Hallo,
I wrote a script that works with a proxy (py2.6x):
proxy_support = urllib2.ProxyHandler({'http' : 'http://127.0.0.1:80'})
But in py3.11x there is no urllib2 just a urllib... and that doesnt support the ProxyHandler
How can I use a proxy with urllib? Isnt Python 3 newer then Python 2? Why did they remove urllib2 in a newer version?
I have a user inputting two strings and then I want to check if there are any similar characters and if there is, get the position where the first similarity occurs, without using the find or index function.
Below is what I have so far but I doesn't fully work. With what I have so far, I'm able to find the similarities but Im not sure how to find…
My application uses many Python libraries (Django, Twisted, xmlrpc). I cannot expect that the end user has the Python installed with all needed libraries.
I've created a fancy installer for my application using Inno Setup, but I don't think that it is a good solution to execute 5 other setup programs from my installer. It would be annoying to the…
I'm trying to get my app to install in /opt/[app_name] using setuptools. My app uses a namespace package.
To install I run
sudo python setup.py install --prefix=/opt/[app_name]/ --install-lib=/opt/[app_name]/ --install-scripts=/opt/[app_name]/
When I install it this was setuptools does not copy init.py in to my namespace package so when I come…
I would like to install Python 2.6 and mod_python on CentOS 5 (x64).
The system is delivered with old python 2.4 and I want the new one with minimal maintenance effort (compiling and having a different installation seams to be suboptimal solution).
Is there a solution for this, other than starting to recompile lots of packages? If not should I…
I have been using the standard python that comes with OS X Lion (2.7.2) but I wanted to build a UCS-4 version to handle 4-byte unicode characters better.
I had already installed pip and packages like pytz, virtualenv and virtualenvwrapper, etc., and these are installed in /Library/Python/2.7/site-packages. My $PATH is…
For a while I've been getting this error while doing anything apt-get related:
Preparing to replace python-cairo 1.4.12-1.2 (using .../python-cairo_1.8.8-1+b1_i386.deb) ...
Traceback (most recent call last):
[...]
File "/usr/share/pycentral-data/pyversions.py", line 172, in default_version
raise ValueError,…
After some not so clever editing of the default Python version in Ubuntu, from 2.7 to 3.2, I ended up breaking my entire system. After my computer imploded and everything stopped working, I tried to revert back my changes (by linking /usr/bin/python2.7 to /usr/bin/python and changing the default version in…
If you were starting learning a new language today, for scripting and doing "various stuff" with it (from making useful programs to it being glue to several command line programs), would you go with Python or Perl (or some third option, although the battle usually comes to these two)?
I've never much used…
I am working on an export tool from Blender to Libgdx, exports like custom attributes and other information (Almost completed), this is a very cool tool that will speed up a lot your works, after I completed I will send to public to contribute forum, Export format is uses python's Standard Json module and…
I want to create a web/browser-based GUI for a command-line python application. The goal is to make use of HTML/JS technologies to create this GUI. As the application itself, it needs to run on Linux and Windows, and the interface will be accessible only from localhost (not exposed to internet). The GUI…
I recently asked a question on SO about Python web frameworks:
http://stackoverflow.com/questions/4909306/python-web-frameworks-vs-java-web-frameworks-how-is-web-development-in-python-do
I want to learn one just for fun but it also has to be able to help me deliver a proper working application.
I am…
Python uses duck-typing, rather than static type checking. But many of the same concerns ultimately apply: does an object have the desired methods and attributes? Do those attributes have valid, in-range values?
Whether you're writing constraints in code, or writing test cases, or validating user…
I am very proficient in Python (including Django), which I use for most tasks. I am also quite confident with C; I am maintaining small file system in userspace written in C. Yet when I am browsing job offers I see everywhere Java/C# and sometimes C++. I have coded profesionally in C++ for half a year…
I'm one of the developers of Ruby (CRuby). We are working on Ruby 2.0 release (planned to release 2012/Feb).
Python has "PEP302: New Import Hooks" (2003):
This PEP proposes to add a new set of import hooks that offer better customization of the Python import mechanism. Contrary to the current…
Being a newbie to coding, I read from this site that Perl is still as viable as it has been, while Python, quoted from someone else's post, is good but just "snake oil" (not sure what this refers to exactly though). So from the responses in that post, I got the gist that Perl is good and worthy to…
I need help.
I have a code which is passing a script into a DLL and initialize the instrument. But, one of the code unable to use in IronPython beside python 2.7 and 3.3
I have attached the code as below
enter code here
import ctypes
import time, sys…
Apple has removed Python support (at least on the Developer level) in 10.9.
Python IS still on the machine in /System/Library/Frameworks/Python.framework... but trying to link to Python using the 10.9 SDK fails.…
I know python is not suitable for things like microcontrolers, make drivers etc, but besides that, you can do everything using python, companys get stuck with speed optimizations for real hard time system but…
I wrote a prime number generator using Sieve of Eratosthenes and Python 3.1. The code runs correctly and gracefully at 0.32 seconds on ideone.com to generate prime numbers up to 1,000,000.
# from bitstring…
So, I'm learning my self python by this tutorial and I'm stuck with exercise number 13 which says:
Write a function to uniformly shrink or enlarge an image. Your function should take an image along with a…
Hello, I'm a newbie with Boost::Python but I tried to search on the web to do so
I want to expose a 3rd party library to Python. One of the class of the library (.hpp) is composed of
a public…
I have the following code:
#!/usr/bin/env python
from scipy.optimize import fsolve
import math
h = 6.634e-27
k = 1.38e-16
freq1 = 88633.9360e6
freq2 = 88631.8473e6
freq3 = 88630.4157e6
def…
I am trying to install a Python library in the Presto package, source http://www.cv.nrao.edu/~sransom/presto/
Using 'gmake fftfit' I get the following error:
cd fftfit_src ; f2py-2.7 -c…