56
votes
4answers
14k views

Does python have an equivalent to Java Class.forName()?

I have the need to take a string argument and create a class in python. In Java, I would use Class.forName().newInstance(). Is there an equivalent in python? Thanks for the responses. To answer ...
49
votes
10answers
28k views

How can I download all emails with attachments from Gmail?

How do I connect to Gmail and determine which messages have attachments? I then want to download each attachment, printing out the Subject: and From: for each message as I process it.
108
votes
9answers
4k views

Seeking clarification on apparent contradictions regarding weakly typed languages

I think I understand strong typing, but every time I look for examples for what is weak typing I end up finding examples of programming languages that simply coerce/convert types automatically. For ...
106
votes
13answers
51k views

Choosing Java vs Python on Google App Engine

Currently Google App Engine supports both Python & Java. Java support is less mature. However, Java seems to have a longer list of libraries and especially support for Java bytecode regardless of ...
55
votes
9answers
4k views

How to reliably guess the encoding between MacRoman, CP1252, Latin1, UTF-8, and ASCII

At work it seems like no week ever passes without some encoding-related conniption, calamity, or catastrophe. The problem usually derives from programmers who think they can reliably process a “text” ...
39
votes
6answers
10k views

Which programming languages can I use on Android Dalvik?

In theory, Dalvik executes any virtual machine byte code, created for example with the compilers of AspectJ ColdFusion Clojure Groovy JavaFX Script JRuby Jython Rhino Scala Are there already ...
12
votes
5answers
15k views

XML instance generation from XML schema (xsd) [closed]

I was wondering if there's a way I can automate the generation of XML files from XSD schemas given that I have the data and the labels. I'd like to do this in python/java. It seems very possible, yet ...
3
votes
2answers
1k views

Java raw audio output

Just wondering if there is a library in Java like the module PyAudiere in Python, that simply allows you to create tones and play them, like this sample Python code: device = audiere.open_device() ...
81
votes
14answers
41k views

What CMS runs on Google App Engine?

Is it possible to deploy any CMS (Content Management System) using Google App Engine? Wikipedia lists 4 Python CMSes and one of them is Django based. Do you know any way to make any of them to work ...
39
votes
35answers
13k views

Why learn Perl, Python, Ruby if the company is using C++, C# or Java as the application language?

I wonder why would a C++, C#, Java developer want to learn a dynamic language? Assuming the company won't switch its main development language from C++/C#/Java to a dynamic one what use is there for ...
15
votes
7answers
6k views

Java Python Integration

I have a Java app that needs to integrate with a 3rd party library. The library is written in Python, and I don't have any say over that. I'm trying to figure out the best way to integrate with it. ...
7
votes
14answers
8k views

Algorithm - How to delete duplicate elements in a list efficiently?

There is a list L. It contains elements of arbitrary type each. How to delete all duplicate elements in such list efficiently? ORDER must be preserved Just an algorithm is required, so no import any ...
6
votes
4answers
7k views

Calling Python in Java?

I am wondering if it is possible to call python functions from java code using jython, or is it only for calling java code from python?
21
votes
5answers
15k views

Calling Java from Python

What is the best way to call java from python? (jython and RPC are not an option for me). I've heard of JCC: http://pypi.python.org/pypi/JCC/1.9 a C++ code generator for calling Java from C++/Python ...
28
votes
9answers
3k views

Why is it “Easier to ask forgiveness than permission” in python, but not in Java? [closed]

It seems that this is accepted as perfectly good code in the python community: def is_integer(input): try: return x % 1 == 0 except TypeError: return False On the other ...

1 2 3 4 5 17
15 30 50 per page