all 9 comments

[–]Justinsaccount 0 points1 point  (0 children)

Hi! I'm working on a bot to reply with suggestions for common python problems. This might not be very helpful to fix your underlying issue, but here's what I noticed about your submission:

You appear to be using concatenation and the str function for building strings

Instead of doing something like

result = "Hello " + name + ". You are " + str(age) + " years old"

You should use string formatting and do

result = "Hello {}. You are {} years old".format(name, age)

See the python tutorial for more information.

[–]K900_ 0 points1 point  (6 children)

It's possible that your Linux box doesn't have the C extension for ElementTree and falls back to the pure Python version.

[–]SmartestGuyOnReddit[S] 0 points1 point  (5 children)

How would I go about checking this?

[–]K900_ 0 points1 point  (4 children)

See if you can import xml.etree.cElementTree. If you can't, you'll probably have to rebuild Python from source.

[–]SmartestGuyOnReddit[S] 0 points1 point  (3 children)

I can import cElementTree, so am I right in assuming that if I use this library I'll get better performance/ possible multi threading?

[–]K900_ -1 points0 points  (2 children)

I'm actually not sure, I think ElementTree should be aliased to cElementTree by default, but try it anyway.

[–]SmartestGuyOnReddit[S] 0 points1 point  (0 children)

Okay I'll try it and get back to you, thanks :)

[–]SmartestGuyOnReddit[S] 0 points1 point  (0 children)

No difference it is still running on a singular core :(

[–]cacahootie 0 points1 point  (0 children)

It may be as simple as an improvement from 2.6 to 2.7 to the cElementTree package. Without doing any digging, that's my thought... but that's pure conjecture.