Questions tagged [python-3.3]

For issues that are specific to Python 3.3. Use the more generic [python] and [python-3.x] tags where possible.

Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use.

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.

Python 3.3 was released on September 29, 2012, and has a number of new features:

Syntax:

  • The yield from expression for generator delegation is introduced.
  • The u'unicode' syntax (which disappeared in Python 3.0) returns.

New standard library modules:

  • faulthandler - helps debugging low-level crashes.
  • ipaddress - high-level objects representing IP addresses and masks.
  • lzma - compress data using the XZ / LZMA algorithm.
  • unittest.mock - replace parts of your system under test with mock objects.
  • venv - Python virtual environments, as in the popular virtualenv package.

... as well as a reworked I/O exception hierarchy, rewritten import machinery based on importlib, more compact unicode strings, and more compact attribute dictionaries.

The C Accelerator for the decimal module has also been significantly improved, as has the unicode handling in the email module.

Finally, for security reasons, hash randomization is now switched on by default.

1148 questions
-1
votes
2 answers

Winsound crashes Tkinter GUI

I have a program that uses a TKinter GUI. I'm trying to display a GUI box at the same time as using winsound to play a sound. It works but after the box freezes and it crashes. There are no error reports. I'm programming with Python 3.3 on a Windows…
Luke Dinkler
  • 731
  • 5
  • 16
  • 36
-1
votes
3 answers

Using range() in For Loop (Python 3.3.3)

I have googled the whole internets and can't find the reason why I get this error when using range() function: >>> for x in range(5): print "Hello World!" SyntaxError: invalid syntax I expect 5 Hello Worlds there. It's ok on Python 2.7, but…
RIXLV
  • 1
  • 1
-1
votes
2 answers

Python 3.3.3: Running a file from a Python script?

I wanted to make a self-replicating program that will make a new Python file, write code to it and run it. Here's how I want the code to be: import os num = 0 fileName = 'wrm' + str(num) fileType = '.txt' finalName = fileName + fileType pyName =…
Kabir
  • 23
  • 3
-1
votes
2 answers

my 2 point distance code returns syntax error in python 3

im really new in python and i wanted to make a code that asks you for the coordinates and returns you the distance between 2 points in the plane. This is my code: def 2pointdistance(d): print(d) xa = int(input("x1?: ")) xaa = int(input("x2?:…
agos46
  • 19
  • 4
-1
votes
1 answer

Only one version of python works

I have both python 3.3 and 2.7 installed on my computer. I am running windows 8. For some reason only one version of python runs at a time — whichever is first in the path control panel > advanced settings. If 3.3 is first in the path, 2.7 IDLE…
user3135832
  • 191
  • 1
  • 1
  • 8
-1
votes
2 answers

What's wrong with this Modulo in Python 33

from math import * def prime(): a = 0 b = 0 x = 2*a+1 y = b for a in range (1,5000) and b in range (0,5000) and y
Andra
  • 47
  • 1
  • 8
-1
votes
2 answers

How to delete unwanted quotation marks in dictionary

I have this file: shorts: cat, dog, fox longs: supercalifragilisticexpialidocious mosts:dog, fox count: 13 avglen: 5.6923076923076925 cat 3 dog 4 fox 4 frogger 1 supercalifragilisticexpialidocious 1 I want to convert this into a dictionary…
user2976821
  • 353
  • 1
  • 3
  • 8
-1
votes
1 answer

Build list of tuples from simple list

This is what I am supposed to do : Write a function to get a list of values L from the user and build from it a list of tuples in the form [(a1,b1),..(an,bn)] where ai are each of the values of the original list and bi represent its position in the…
Alfie brown
  • 87
  • 2
  • 2
  • 9
-1
votes
2 answers

Python 'if' statements

I am doing an assignment where I need to conduct a quiz. This is a part of my code so far. answer = input("Your answer: ") guessesTaken = 0 points = 0 if answer == 'Call Of Duty' or answer == 'Call of duty' or answer == 'Call of duty' or answer ==…
Shahaad Boss
  • 1
  • 1
  • 2
  • 6
-1
votes
1 answer

Need to make a function like .lstrip

I need to make a function like .lstrip. I have already completed a function that counts the number of occurrences of a letter. Can this function be used to help me complete this function which i will refer to as *my_lstrip*? The only problem I'am…
-1
votes
1 answer

python 2.7 and 3.3.2 ubuntu 13.04

I have a Python program MyFile.py made in 3.3.2 version in Windows environment. When I try to run it in my Ubuntu 13.04, I got: bash: ./MyFile.py: /usr/bin/python^M: bad interpreter: No such file or directory I changed it with: tr -d '\r' <…
-1
votes
2 answers

How do I use "while" in this situation

# This program says hello and asks for my name, then repeats it. print('Hello world!') print('What is your name?') myName = input() while print('It is nice to meet you, ' + myName) My question is what do I put where while is? I'm trying to…
iExodus
  • 11
  • 1
  • 1
  • 4
-1
votes
1 answer

I can't change a list to int with map function Python

My program ask the user to type 10 random numbers I'm using this code. numbers = input("Type 10 numbers, separeted by spaces: ") numberlist = list(numbers) numberlist = map(int,numberlist) print(numberlist) but when the program is compiling I can…
user2737948
  • 329
  • 2
  • 10
  • 25
-1
votes
1 answer

Phone book list formatting

I have a lot of trouble trying to figure this out. I have seen lots of people show complex (complex for me) ways of fixing these columns but i have no idea how i could do it in this, as i am using a dictionary. Any way, here's the code: elif…
FaceySmile
  • 53
  • 9
-1
votes
1 answer

Connector/python select after insert

I have a database table with UNIQUE key. If I want to insert some record there are two possible ways. First, the unique item doesn't exist yet, that's OK, just return new id. Second, the item already exists and I need to get the id of this unique…
dakov
  • 1,039
  • 2
  • 12
  • 33