Questions tagged [python-3.1]

For issues relating to development in Python, version 3.1. Use the more generic [python] and [python-3.x] tags where possible

The Python 3.1 release (first in 2009, since 2012 in security-fix-only mode, end-of-life since 2014) introduced various optimisations and module extensions (collections.OrderedDict)

Use this tag if your question is specifically about . If your question applies to Python in general, use the tag . If your question applies to Python 3.x but not to Python 2, use the tag . If you aren't sure, tag your question and mention which version you're using in the body of your question.

35 questions
1
vote
1 answer

Cannot import name _tkagg on windows

I need to use matplotlib in Python 3.1 under 32bit Windows. That would not be a problem if the version of py was different as there are many binaries of matplotlib for windows(py 3.4 + installed matplolib binary worked great). As I was not able to…
Selentiym
  • 11
  • 2
1
vote
1 answer

cx_freeze won't create a correct .exe for python 3.1.1

I use python 3.1.1, and I have been trying to compile a program i wrote earlier today, I think the code is short enough to post below. from tkinter import * class Application(Frame): """ GUI application that creates a story based on user input.…
1
vote
1 answer

Change colour of text depending on 'if' statement

this is my firdt post and i need some hepl. I have started learning pyhon and have got to the point where i am ready to make my own program. I am writing a program that is a 'stat' checker for the MMO 'Realm of the Mad God' and want to be able to…
TGSpike
  • 45
  • 2
  • 5
1
vote
1 answer

hi, im new to python and i was wondering how would i go about adding values to lists based from the index of another list

new_list =[0,0,0,0] for x_list in random_list: # list of list for x in x_list: if x == "I" or "i": list_index = x_list.index(x) new_list[list_index] += 1 Lets say the random_list was [['x','x','I','I'],['x','x','I','x']] it should output…
1
vote
0 answers

python -m unittest2 discover not working

I'm using the excellent Tox tool to test my code. Here is my tox.ini: [tox] envlist = py26,py27,py31,py32,py33 [testenv] deps = ParamUnittest commands = python -m unittest discover tests downloadcache = build [testenv:py26] deps =…
rubik
  • 8,814
  • 9
  • 58
  • 88
0
votes
0 answers

Python - Decoding RS422 data from device

Controller Documentation page 124 Serial Sniffing screenshot The hardware setup should be OK, everything works as it should when I use their sensorTOOL 1.8., also I made it working with similar code for an optoNCDT 1420 laser sensor (which sends the…
ricode
  • 9
  • 3
0
votes
0 answers

Conditional formatting levels

I am teaching myself python and I know formatting is critical for but I can' figure out how to make the formatting work for a conditional statement. When using an if statement I can't get the else to line up at the same level as the if. The else…
Greg
  • 1
0
votes
0 answers

Use importlib instead imp for non .py file

I want to import a file as python module with importlib. This file has no .py but .cfg extension. It contains python code. [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import imp >>>…
bux
  • 7,087
  • 11
  • 45
  • 86
0
votes
0 answers

Is it possible to have a clock that counts up in days?

Recently I've been working on a file for python-3.1 and I was wondering if there is a way to have a clock that counts up in days, for example, if the set day was the 10th of July 2016 the screen would display the number 12 if the file was opened on…
0
votes
1 answer

My while statement is going wacky and I'm not sure what is wrong

My code is not working, and I'm not sure what is going on. The problem is when I input "Y" the first time, it still says "Please enter a valid input" and I need to re-enter a second time for it to work. if getoutofbed == "y": outofbed = 1 …
0
votes
0 answers

Custmizing Django formwizard interface

How to Customize Django form wizard interface,how to impliment our methods inside session wizard interface class
vinodsesetti
  • 368
  • 2
  • 6
0
votes
0 answers

"TypeError: 'str' object is not callable" when creating virtualenv with Python 3.1

This commands on Ubuntu 14.10: sudo add-apt-repository ppa:fkrull/deadsnakes -y sudo apt-get update sudo apt-get install python3.1 python3.1-dev sudo pip install virtualenv==12.1.1 virtualenv -ppython3.1 env Gives me this: Running virtualenv with…
Gill Bates
  • 14,330
  • 23
  • 70
  • 138
0
votes
1 answer

Why Pygame wont QUIT properly?

No matter what I do, the window will never quit on QUIT event. It would either ignore me pressing the X button or go into "Not responding" mode. I usually restart the shell and then force close it from the Windows. None of these methods work and not…
MaxPower
  • 415
  • 1
  • 6
  • 16
0
votes
1 answer

Python 2.6 -> Python 3.1 (for using ttk)

I want to use ttk as part of tkinter but I had Python 2.6 on my Mac. Therefore I went and installed Python 3.1, which has ttk come with it, and it did not overwrite the previous version. Therefore I still do not have the ability to use ttk. Am I…
Ziggy
  • 99
  • 1
  • 1
  • 6
0
votes
1 answer

Printing from two dictionaries

states = {state, abbr} cities = {abbr, capital} I'd like to print out state, abbr, capital or some other order of the 3 values. I tried inverting the key, value pair in states with: inv_states = {state: abbr for abbr, state in states.items()} for…