|
Python 3.0 is in beta with a final release coming shortly. Obviously it will take some significant time for general adoption and for it to eventually replace 2.x.
I am writing a tutorial about certain aspects of programming Python. I'm wondering if I ...
Started by Corey Goldberg on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Python 2.x " will be python....
Learn Python 3.0, as contagious suggests.
The article
Python 2.x has been out long enough to build up that it's really not going to matter much.
There are probably very few out there now.
|
|
Just saw a question about, hello world on python!
The answers say's, this is not support in py 3.x. What does this mean, is python not backward compatible? If it is not, I think this is a very big issue, from acceptability and learning point of view.
...
Started by Vivek Sharma on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
That requires Python, learn Python 2.x as frameworks like Django and many corporations still use 2.x.Python 3 (you'd go for 3.1 of course) is a more elegant language, having removed redundancies and minor warts that Python....
|
|
Suppose I have any data stored in bytes. For example:
0110001100010101100101110101101
How can I store it as printable text? The obvious way would be to convert every 0 to the character '0' and every 1 to the character '1'. In fact this is what I'm currently...
Started by Manuel on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Once you have that string, you can encode it into safe ASCII... .
For Python 2.x, your best bet is to store them in a string.
You want to safey store the data in text files and such?
In 2.x strings should be fine (python doesnt.
|
Ask your Facebook Friends
|
Here is my vision for the G2 user interface. As we design and implement the user interface we should keep these goals in sight.
Gallery 2.x will have a UI that makes people say WOW . The interface will be intuitively easy in all languages. The interface...
Answer Snippets (Read the full thread at menalto):
I am not sure how well several of my.
Program in Python, and I have looked all over your Gallery site.
|
|
No doubt most people have read all about the various incompatible changes that are going into Python 3, so on a question of just performance, how does python 3 compare to python 2.x?
Started by Scott Bennett-McLeish on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
From "What’s New....
Why I find Python "faster benchmarks.
The idea behind Python 3 is to clean up the language syntax itself - remove ambigious stuff like is irrelevant - all interpreted languages basically function at the same speed.
|
|
The C API in Python 3.0 has changed (deprecated) many of the functions for File Objects.
Before, in 2.X, you could use
PyObject* PyFile_FromString(char *filename, char *mode)
to create a Python file object, e.g:
PyObject *myFile = PyFile_FromString("test...
Started by Vicent Marti on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Encoding, char *newline, int closefd);
Not sure if that means it's not possible to have Python open", "foo.txt", "wb"); Py_DECREF(ioMod); PyObject_CallMethod(openedFile, "write", "y", "Written from Python.
|
|
We have an older C++ tool that generates some python code automatically. I tried to slog through the C++ source tool, today and pretty much wanted to shoot my self. The thing is what i want to do, is clean up the source created by the tool and link the...
Answer Snippets (Read the full thread at stackoverflow):
Http://stackoverflow.com/questions/1769332/script....
To automatically facilitate the conversion of Python 2.x apps to Python 3.0, so its main use case is taking python code to parse individual tokens using tokenize module.
|
|
Ok, I have a group of objects which I am creating a class for that I want to store each object as its own text file. I would really like to store it as a Python class definition which subclasses the main class I am creating. So, I did some poking around...
Started by Jonathanb on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
(I linked to the Python 3 version because it's more capable than the 2.x....
However, you can also generate Python executable code at runtime using the ast library.
This is pretty much the best way to generate Python source code.
|
|
In python 2.x I could do this:
import sys, array a = array.array('B', range(100)) a.tofile(sys.stdout)
Now however, I get a TypeError: can't write bytes to text stream . Is there some secret encoding that I should use?
Started by partisann on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
A better way:
import sys sys.stdout.buffer.write(b"some binary data").
Import os os.write(1, a.tostring())
or, os.write(sys.stdout.fileno(), …) if that's more readable than 1 for you .
|
|
I ask this for deployable reasons. As in, if I write a solution in python, I feel bound to write to 2.x due to the lack of adoption of python 3. This is a major daily concern of mine, and I want to figure out what's going on.
For many of the python-based...
Started by Stefan Kendall on
, 10 posts
by 10 people.
Answer Snippets (Read the full thread at stackoverflow):
The #python IRC channel on freenode has ....
Different syntax Slower integers.
To learn Python, should I learn 2.x or just jump into 3.0? Who’s Using Python 3.0? Python VersionCompiled 3rd party modules haven't updated.
|