I am wondering if there are any tips or tricks to converting perl into python. It would be nice if there was a script like python's 2to3. Or perhaps some compatibility libraries.
A new web application may require adding Artificial Intelligence (AI) in the future, e.g. using ProLog. I know it can be done from a Java environment, but I am wondering about the opportunities with modern web languages like Ruby or Python. The latter is considered to be "more scientific" (at least used in that environment), but using Google there seems to be a preliminary ProLog implementation for both.
Any suggestions on modern (open source) web languages (like Python or Ruby) in combination with AI?
I like the sinatra framework, but might have to work in python. A quick web search has uncovered a few python equivalents including itty, flask and juno.
I'd like to know people's experience of these, or other sinatra equivalents. Which would you recommend?
Emacs uses an older version of python(2.3) i have for the default python mode, is there a way for me to tell emacs to use the newer version that i have in my home directory?
btw I'm using a red hat distro and dont have root privileges.
I've been reading a lot about python-way lately so my question is
How to do dependency injection python-way?
I am talking about usual scenarios when, for example, service A needs access to UserService for authorization checks.
I'm trying to compile Python 2.6 for 64bit, I tried various compile commands but not sure whether those are correct
./configure --with-universal-archs=32-bit --prefix="$HOME/python"
make
make install
What is the correct syntax ... ?
I'm studying Python after a lot of PHP experience and it would be handy to have type-hinting in Python. Looks like eclipse + pydev doesn't support this. Any suggestions?
For example, I want my IDE to show function docstrings and types, when I use it, like:
def f(x: int) -> int:
r"""Adds 3 to x"""
return x + 3
f( #and now IDE shows everything about types
Hi.
I have a text file of URLs, about 14000. Below is a couple of examples:
http://www.domainname.com/pagename?CONTENT_ITEM_ID=100¶m2=123
http://www.domainname.com/images?IMAGE_ID=10
http://www.domainname.com/pagename?CONTENT_ITEM_ID=101¶m2=123
http://www.domainname.com/images?IMAGE_ID=11
http://www.domainname.com/pagename?CONTENT_ITEM_ID=102¶m2=123
I have loaded the text file into a Python list and I am trying to get all the URLs with CONTENT_ITEM_ID separated off into a list of their own. What would be the best way to do this in Python?
Cheers
scenario: a modular app that loads .py modules on the fly as it works. programmer (me) wishes to edit the code of a module and and then re-load it into the program without halting execution.
can this be done?
i have tried running import a second time on an updated module.py, but the changes are not picked up
If Python had a macro facility similar to Lisp/Scheme (something like MetaPython), how would you use it?
If you are a Lisp/Scheme programmer, what sorts of things do you use macros for (other than things that have a clear syntactic parallel in Python such as a while loop)?
How do I create a GUID in Python that is platform independent? I here there is a method using ActivePython on Windows but it's Windows only because it uses COM. Is there a method using plain Python?
Is it possible in Python to run multiple counters in a single for loop as in C/C++? I would want something like -- for i,j in x,range(0,len(x)): I know Python interpretes this differently and why, but I would need to run two loop counters concurrently in a single for...?
Thanks,
Sayan
Hi
I using buzz-python-client from http://code.google.com/p/buzz-python-client/
In the example:
client.build_oauth_consumer('your-app.appspot.com', 'consumer_secret')
Where can I get a consumer_secret?
Can someone please give the Java equivalent of the below python (which slices a given array into given parts) which was originally written by ChristopheD here:
def split_list(alist, wanted_parts=1):
length = len(alist)
return [ alist[i*length // wanted_parts: (i+1)*length // wanted_parts]
for i in range(wanted_parts) ]
I don't know any python but can really use the above code in my Java app. Thanks
I am a newcomer to Python and am converting a Perl script. What is the Python equivalent to...
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
Any help is greatly appreciated.
So I've got plain python downloaded, so I can run .py files from the command line. Now I want to step it up, have a debugger, be able to call .net or other Windows things, etc...
What's my next step? What's a good Python environment for Windows?
Is there an application similar to Java's Checkstyle for Python?
By which I mean, I tool that analyzes Python code, and can be run as part of continuous integration (e.g. CruiseControl or Hudson). After analyzing it should produce an online accessible report which outlines any problems found in the code.
Thank you,
Hi, I'm looking into using Lua in a web project. I can't seem to find any way of directly parsing in pure python and running Lua code in Python.
Does anyone know how to do this?
Joe
I am looking for python stubbing library. Something that could be used to create fake classes/methods in my unit tests.. Is there a simple way to achieve it in python..
Thanks
PS: I am not looking for mocking library where you would record and replay expectation.
File "/usr/local/lib/python2.5/site-packages/libxml2.py", line 1, in <module>
import libxml2mod
ImportError: /usr/local/lib/python2.5/site-packages/libxml2mod.so:
undefined symbol:xmlTextReaderSetup
>>> import libxml2mod
>>> import libxml2
>>>
on Python Prompt it works fine !!
can anyone has idea why my program is not working from .py file as import is working perfect from python prompt.
Hi,
I wrote a pythonmodule. Running python filename.py, only checks for syntax errors. Is there a tool, which checks for runtime errors also, like concatenating int with string etc..
Thank you
Bala
This may sound strange, but I need a better way to build python scripts than opening a file with nano/vi, change something, quit the editor, and type in python script.py, over and over again.
I need to build the script on a webserver without any gui. Any ideas how can I improve my workflow?
I have just come across quantmod, and I would like to use it from Python. However I am not sure how to use quantmod from a Python script.
Has anyone done this before - any ideas or suggestions on how to get started?