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
35
questions
1
vote
1
answer
73
views
I keep getting an error on python path when I open terminal
I recently updated python on my mac and since then, whenever I open terminal there's the following error shown:
File "/opt/homebrew/share/man/man1/python3.1", line 1
.TH PYTHON "1&...
0
votes
0
answers
79
views
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 ...
-2
votes
2
answers
815
views
Python - Add time zone to timestamp
I use chrome timestamp and convert it do readable date but time isn't right
timestamp_formated = str(datetime.datetime(1601, 1, 1) + datetime.timedelta(microseconds=last_visit_time))
Seems to be ...
0
votes
0
answers
322
views
Pip for Python 3.1
I have been trying to install pip on my Python 3.1, in order to be able to convert .py files to .exe files. I have been searching around the internet, finding stuff like sudo, some bootstrap links and ...
0
votes
0
answers
12
views
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 ...
1
vote
0
answers
176
views
How do I connect to a Sybase Server using Python 3.1 in Windows 7?
I have thoroughly researched into this topic and I cannot get anything to work.
I have tried to run modules I downloaded from this webpage:
http://python-sybase.sourceforge.net/download.html
The ...
1
vote
3
answers
531
views
not working Morse Code Decryptor in Python
I'm making a program where the Morse Code is decrypted into English.
However, when the program is running and I put the Morse Code in (ex. *- which should result in the program printing out A) the ...
5
votes
7
answers
950
views
On Raspbian run multiple python Versions simultaniously
I have some old programs from back in the times when python 3.1 came out.
In the program I often used the Callable() to pass a function and it's parameters like this to my TKinter application:
tvf....
0
votes
0
answers
356
views
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 ...
0
votes
0
answers
24
views
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 ...
0
votes
1
answer
72
views
My while statement is going wacky and I'm not sure what is wrong [duplicate]
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 ...
1
vote
0
answers
1k
views
Trying to send command between to machines Server to Client
I have two machines one is set up as a Client the other as Server. The Client is setup to receive commands from the Server and then respond. I know ... backwards. I tried using Putty but kept ...
1
vote
2
answers
87
views
Operators from list is still showing quotation marks when printed (Python 3.1)
When I'm coding, I choose a random value from a list and print it alongside two numbers to make a sum. However, the value from the list still shows the quotation marks and I don't understand why. The ...
2
votes
2
answers
122
views
Chess Engine TypeError: unhashable type: 'list'
board = [["bRook", "bKnight", "bBishop", "bQueen", "bKing", "bBishop", "bKnight", "bRook"],
["bPawn", "bPawn", "bPawn", "bPawn", "bPawn", "bPawn", "bPawn", "bPawn"],
["", ...
0
votes
0
answers
26
views
Custmizing Django formwizard interface
How to Customize Django form wizard interface,how to impliment our methods inside session wizard interface class
-2
votes
1
answer
214
views
Python - Why is my else statement being ignored in this piece of code? [duplicate]
seats = 3
rating = 12
print('Hello and welcome to Daisy\'s cinema.')
while seats > 0:
name = input('What is your name?')
print('Hello',name,'\n')
print('We are currently showing ...
0
votes
0
answers
436
views
"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 -...
-1
votes
1
answer
79
views
Custom Module in Window
I was wondering How I can get my code in a window instead of CMD When I run it outside of IDLE. I am using this code with a menu, which uses tkinter. Thanks in Advance. Also If You know how to shorten ...
1
vote
1
answer
2k
views
AttributeError functools.total_ordering
Following is my code snippet. when i run the program it gives me the following error.
@functools.total_ordering
AttributeError: 'module' object has no attribute 'total_ordering'
I'm using python 3....
8
votes
1
answer
15k
views
AttributeError: 'Pool' object has no attribute '__exit__'
I'm doing some multiprocessing python scripts using multiprocessing.Pool. These scripts look like the following:
from multiprocessing import Pool
def f(x):
return x*x
if __name__ == '__main__':
...
1
vote
4
answers
39k
views
Python menu-driven programming
For menu-driven programming, how is the best way to write the Quit function, so that the Quit terminates the program only in one response.
Here is my code, please edit if possible:
print("\nMenu\n(V)...
-1
votes
4
answers
47
views
Another loop iteration of list
How to write this code correctly?
highScore=open('scores.txt',mode='r')
score=[]
i=0
print("\nName\t\tScore")
line=highScore.readline().strip('\n')
while line!="":
line=str(line).split(', ')
...
1
vote
1
answer
1k
views
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 ...
-1
votes
2
answers
68
views
Python: getting an error for function, Unindented error
I'm new to Python, and I'm trying to make my string change 'abc' to 'def' and in short I keep getting,"unindented does not match any other indentation level." Therefore, this means what is wrong with ...
0
votes
1
answer
303
views
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 ...
0
votes
1
answer
485
views
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 ...
1
vote
1
answer
577
views
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 ...
1
vote
1
answer
462
views
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 ...
1
vote
1
answer
36
views
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)
...
0
votes
1
answer
354
views
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 = {...
1
vote
0
answers
248
views
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
...
3
votes
3
answers
6k
views
Interprocess communication between C# and Python
I can understand that there has been a lot of questions on this topic but none of them could really solve my problem. So here I have presented my code, and I want my mistakes to be pointed out here.
...
11
votes
4
answers
7k
views
Python argparse positional arguments and sub-commands
I'm working with argparse and am trying to mix sub-commands and positional arguments, and the following issue came up.
This code runs fine:
import argparse
parser = argparse.ArgumentParser()
...
1
vote
1
answer
956
views
Python 3.2 extremely slow when compare to Python 3.1.x
I read through Python 3.2 changes and understand that it has made many improvement over 3.1. However, my exact same code with zero modification running on 3.2 is more than 10 times slower than when I ...
3
votes
1
answer
9k
views
How can I install argparse in Python 3.1?
I am trying to get argparse to install in Python 3.1, but I get a UnicodeDecodeError out of setup.py when I easy_install it:
(ve31) offline@void (projects) $ easy_install argparse
install_dir /Users/...