top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What's the problem with Python 3.x

+2 votes
524 views

What's the problem with Python 3.x? It was first released in 2008, but web hosting companies still seem to offer Python 2.x rather.

For example, Google App Engine only offers Python 2.7. What's wrong?...

posted Jan 14, 2014 by Seema Siddique

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
What makes you think anything's wrong? Major changes to any established piece of software takes a fairly long while to infiltrate.

Lots of COBOL and Fortran 77 still running out there. I imagine there are still more than a few DOS and Windows 3.1 boxes as well. Why should adoption of Python 3.x be any different?

1 Answer

+1 vote

There's nothing wrong with Python 3, but as Kiran says, it takes time for people to migrate.

Most cheap web hosts don't offer Python _at all_, but those that do have the choice of which version(s) to provide. It may be possible to call up either a 2.x or a 3.x by looking for "python" or "python3" - give it a try.

answer Jan 14, 2014 by Naveena Garg
Similar Questions
0 votes

I'm starting a new project from scratch so I think its finally a time to switch to the latest and greatest Python 3.4.

But I'm puzzled with MySQL support for Python 3. So far the only stable library I've found it pymysql.

All others are either abandoned work-in-progress projects or do not support Python 3:

  • mysqldb - Python 2.x only
  • mysql-ctypes - Python 2.x only
  • amysql - Python 2.x only
  • ultramysql - Python 2.x only
  • MySQL Connector/Python - new guy in block. Does anyone use it?
  • WebScaleSQL + MySQLdb1 - still in development, state unknown?

So what library do you use for MySQL access in Python 3? I'm specifically interested in async support (like in psycopg2 for PostgreSQL) since I'm planning to use Tornado.

0 votes

I need a command that will make threads created by "multiprocessing.Process()" wait for each other to complete. For instance, I want to do something like this:

job1 = multiprocessing.Process(CMD1())
job2 = multiprocessing.Process(CMD2())

jobs1.start(); jobs2.start()

PY_FUNC()

The command "PY_FUNC()" depends on the end result of the actions of CMD1() and CMD2(). I need some kind of wait command for the two threads that will not let the script continue until job1 and job2 are complete. Is this possible in Python3?

+1 vote

I seem to stumble upon a situation where "!=" operator misbehaves in python2.x. Not sure if it's my misunderstanding or a bug in python implementation. Here's a demo code to reproduce the behavior -

From __future__ import unicode_literals, print_function

class DemoClass(object):
   def __init__(self, val):
   self.val = val

   def __eq__(self, other):
   return self.val == other.val

  x = DemoClass('a')
  y = DemoClass('a')

  print("x == y: {0}".format(x == y))
  print("x != y: {0}".format(x != y))
  print("not x == y: {0}".format(not x == y))

In python3, the output is as expected:

x == y: True
x != y: False
not x == y: False

In python2.7.3, the output is:

x == y: True
x != y: True
not x == y: False

which is not correct!!

0 votes

This is my first time using pyinstaller. My goal is to build an .app in Mac. The app is basically a GUI written in PySide, and I have about 7 different Python scripts + 1 .png file. The main file calls 4 of the files, and the 4 files will call the rest of the 2 files repeatedly. The .png file is nothing but the window logo. Could someone help me with some diagnosis? I do not know what went wrong. I searched a lot of documentations online, i.e., change spec, add import, ... etc. but my app still doesn't run.FYI, Pyinstaller could generate an app for me, but there are two issues:
1. Icon is not changed for the app.
2. App crashes when opened.

My Python version is 2.7.5 and I am using PyInstaller-2.0. Here is my code for packaging:

python pyinstaller.py --onefile --windowed --name=MyApplication -i ~/Documents/AASource/icon.ico ~/Documents/AASource/Scripts/main_file.pyHere is the spec file:

$ -*- mode: python -*- a = Analysis(['/Users/boxuancui/Documents/AASource/Scripts/main_file.py'], pathex=['/Users/boxuancui/Documents/pyinstaller-2.0'], hiddenimports=[], hookspath=None) pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name=os.path.join('dist', 'MyApplication'), debug=False, strip=None, upx=True, console=False , icon='/Users/boxuancui/Documents/AASource/icon.ico') app = BUNDLE(exe, name=os.path.join('dist', 'MyApplication.app'))Here is part of the crash message:

Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000054d8

Thanks in advance! Any help will be appreciated!

...