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
1 answer

how to save related data from file in python 3?

I have a file with lines of two integer separated by ','. I just want to store this integers from each line related together. example : file: 12,23 45,6545 12,89 I want to save 12 and 23 or 45 and 6545 both related together which I could call em…
ed1952
  • 1
  • 1
-1
votes
2 answers

What is wrong with my elif statement? Invalid Syntax

if option == "1": with open("sample.txt","r") as f: print(f.read()) numbers = [] with open("sample2.txt","r") as f: for i in range(9): numbers.append(f.readline().strip()) print(numbers) …
-1
votes
1 answer

Macports: differences between Python3.2, Python3.3, and Python3.4

At the moment, I am trying to use Python3.4. However, I am having difficulty installing py34 dependencies using Macports. Should I use Python3.3? Should I be setting up different PYTHONPATHs? What is the problem here? What really is the difference…
EB2127
  • 1,788
  • 3
  • 22
  • 43
-1
votes
3 answers

Checking if dictionary contains the date and plan

So I am trying to create a function that checks whether or not the contents of a function is true: def command_add(date, event, calendar): ''' Add event_details to the list at calendar[date] Create date if it was not there :param…
Ez2Earn
  • 27
  • 1
  • 8
-1
votes
1 answer

How to get the correct version of python module for mysql

I am trying to connect to mysql dataase using python but I couldn't find the correct connector and module called MySQLdb how can I find the correct sources? when I import the module it shows an error like this because I have not added the correct…
Dimuth Ruwantha
  • 671
  • 2
  • 12
  • 26
-1
votes
1 answer

Python Tkinter Gui Not Working

I have had an issue with this piece of code from awhile back, it's part of a GCSE mock and I have currently finished the working code (with text only) but I would like to expand it so that it has a nice GUI. I'm getting some issues with updating my…
Tom
  • 15
  • 1
  • 1
  • 8
-1
votes
2 answers

How do I sort data highest to lowest in Python from a text file?

I have tried multiple methods in doing this but none of them seem to work The answer comes up alphabetically instead f=open("class2.txt", "r") scores=myfile.readlines() print(sorted(scores)) f.close() ['Anne, 3\n', 'Dave, 10', 'Jack, 4\n',…
someone
  • 3
  • 1
  • 5
-1
votes
1 answer

My button will not execute the command it is assigned to in Tkinter

The button now will do something. It gives an error and won't execute. class FCHSapp(tk.Frame): def __init__(self, parent, controller): tk.Frame.__init__(self, parent) LARGE_FONT=("Verdana", 30) label = tk.Label(self, text="FCHS Teacher…
Leonard10
  • 1
  • 1
-1
votes
2 answers

Why do Extra Function Calls Speed Up a Program in Python?

If I extract a computation and place it in another function shouldn't the code be slower? Evidently not. Below, I can't believe fun2 is slower than fun1, because fun1 clearly does more computation. What is going on? (Maybe I can have functions call…
-1
votes
3 answers

Unorderable types: type() > int()

I get the error 'TypeError: unorderable types: type() > int()' and i am not sure how to fix it. print ("Hello user, and welcome to the game.") print ("As you are a new user you will need to register your details, you will be asked to enter…
-1
votes
2 answers

How do I access tkinter for a class instantiated in another class?

I am following the tutorial (more or less) at this site. I am able to copy and paste the code from the tutorial and modify it with the Python 3 module names (Tkinter becomes tkinter, Queue becomes queue, etc.) and the code runs fine. However, my…
Marshall Davis
  • 3,337
  • 5
  • 39
  • 47
-1
votes
1 answer

Can You Save Data To A Dictionary From A Text Document?

I can't find any way to add data to dictionaries from text documents. Wait, is it even possible? e.g. with open("D:\Programming - Python\S.A.M.I\Words/Pos.txt", encoding="utf-8") as f: posread=f.read() (and then have this split each word using…
SirBuncey
  • 67
  • 1
  • 2
  • 9
-1
votes
1 answer

How to sort integers in a variable?

Please note that this is on Python 3.3 Here is the code: students=int(input("How many student's score do you want to sort? ")) options=input("What do you want to sort: [Names with scores] , [Scores high to low] , [Scores averages] ?…
Anonymous
  • 49
  • 1
  • 1
  • 9
-1
votes
2 answers

How can I use a variable from a another function in the same class?

In my program have I a Button that when I pressed it's get the rara entry. But it doesn't work. Has anyone got an idea of what could be the problem? from tkinter import * import random import tkinter.messagebox class Application(Frame): """ GUI…
Luuk Verhagen
  • 350
  • 1
  • 5
  • 13
-1
votes
2 answers

Calling different functions python

I need to call various different functions that i have already created in order to achieve the question below. I am really unsure how to programme this in order to achieve it. The question is.. Find two word anagrams in word list( str, str list ),…
alfiej12
  • 371
  • 3
  • 4
  • 15