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

Maximum recursion depth reached faster when using functools.lru_cache

I've been playing around with memoization and recursion in python 3.3 Ignoring the fact that python is the wrong language to be doing this in, I've found that I get inconsistent results between using functools.lru_cache to memoize, and not using…
Kiirani
  • 1,067
  • 7
  • 19
8
votes
1 answer

Controlling Python 3.3 stdio line termination on windows 7

The following code... import sys if sys.platform == "win32": import os, msvcrt msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) sys.stdout.write("This is a sample line of text\n") ...results in the stdio output ending with 0x0d followed…
7
votes
4 answers

Tkinter create image function error (pyimage1 does not exist)

I'm a student from the outside world with no previous programming experience. I have been learning Python as an extension of my math class. I have been trying to create a program that generates fractals using Tkinter. The code works well on its own,…
Silmarillion101
  • 179
  • 1
  • 1
  • 6
7
votes
2 answers

Python 3.3 - Connect with Oracle database

Is there a module for python 3.3 to connect with Oracle Databases? Which is the easiest to use? Something like the mysql module, only works with Oracle. Preferably version 10g, but 11g will do just fine.
aIKid
  • 26,968
  • 4
  • 39
  • 65
7
votes
1 answer

How to executing a python script with innoSetup

I try to run a python script during a setup generate by InnoSetup , but nothing works. Neither the Run section or Exec in code section Result code differ depending the way I call it. Of course I install Python during the setup if it's not already…
cnaimi
  • 484
  • 6
  • 10
7
votes
2 answers

Manipulating MIDI Files in Python

I'm looking for a way to change individual notes in a pre-existing MIDI file in Python. I've found a lot of packages that allow for the writing of MIDI files, but not altering existing ones. Is there a package that could help with this or a a way of…
Arger
  • 171
  • 1
  • 9
7
votes
4 answers

Simultaneous .replace functionality

I have already converted user input of DNA code (A,T,G,C) into RNA code(A,U,G,C). This was fairly easy RNA_Code=DNA_Code.replace('T','U') Now the next thing I need to do is convert the RNA_Code into it's compliment strand. This means I need to…
Deaven Morris
  • 107
  • 1
  • 3
  • 13
7
votes
3 answers

python os.listdir doesn't show all files

In my windows7 64bit system, there is a file named msconfig.exe in folder c:/windows/system32. Yes, it must exists. But when i use os.listdir to search the folder c:/windows/system32, I didn't get the file. Here is the test code, in t1.py: import…
truease.com
  • 1,261
  • 2
  • 17
  • 30
7
votes
1 answer

python linux timestamp to date time and reverse

i would like to know how to convert datetime Wed Apr 24 19:25:06 2013 GMT into Linux timestamp 1366831506000 (13 digits)] and reverse using python. for example: Wed Apr 24 19:25:06 2013 GMT to 1366831506000 and from 1366831506000 to Wed Apr 24…
sanjayan ravi
  • 143
  • 1
  • 1
  • 8
7
votes
1 answer

What is PasteDeploy and do I need to learn it if Eggs in Python are considered gone?

I'm quite new to Python. I've downloaded the Pyramid Framework and have been trying to understand it. It uses many separate tools for its work. For example some PasteDeploy. I tried to read PasteDeploy's manual but can't understand anything. There…
Green
  • 28,742
  • 61
  • 158
  • 247
7
votes
1 answer

Python accepts keyword arguments in CPython functions?

I use python3.3 and just found out that it accepts keyword arguments in some of its CPython functions: >>> "I like python!".split(maxsplit=1) ['I', 'like python!'] But some other functions don't accept keyword arguments: >>> sum([1,2,3,4], start =…
slallum
  • 2,161
  • 4
  • 24
  • 24
7
votes
1 answer

Instantiate Decimal class

I've found a strange behavior in the decimal module. The "signature" of the class Decimal is: Decimal(value='0', context=None) So, I supposed that I can do something like:Decimal('3', None). But this code raises a TypeError exception in python3.3…
G Tux
  • 73
  • 1
  • 3
6
votes
4 answers

Python 3.3 blueprints

I am interested in knowing which language changes are going to happen in Python 3.3 (without having to subscribe to the developer mailing list and monitor the flow of messages). I found this page on python.org, but I wonder if there is any…
mac
  • 42,153
  • 26
  • 121
  • 131
6
votes
5 answers

\ufeff Invalid character in identifier

I have the following code : import urllib.request try: url = "https://www.google.com/search?q=test" headers = {} usag = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0' headers['User-Agent'] =…
Katallone
  • 315
  • 2
  • 7
  • 15
6
votes
2 answers

Bash alias --> Python 2.7 to Python 3.3

I am trying to make Python 3.4.2 the default in Linux (currently it is 2.7.6). I am not very knowledgeable on this stuff, but I have read in several places online that you can simply put an alias in the ~/.bashrc or ~/.bash_aliases file like…
laurenll
  • 478
  • 2
  • 5
  • 12