python-3.x
Cannot run script with one particular Unicode character in Python 3.2
Having a bizarre issue running this UTF-8 encoded script in Python 3.2.Python refuses to run if it contains the Japanese hiragana character の (see stack trace below)[详细]
2023-03-30 01:36 分类:问答python3: How to get logical complement (negation) of a binary number, eg. '010' => '101'?
Maybe I\'m missing something but I c开发者_StackOverflowan\'t find a straightforward way to accomplish this simple task. When I go to negate a binary number through the \"~\" operator it returns a neg[详细]
2023-03-30 01:17 分类:问答excel printing in to different column
import xlrd import os path = \"data\" dirList=os.listdir(path) f = open(\'\', \'w\') f.write(\'\') f.write(\"\\n\")[详细]
2023-03-29 18:31 分类:问答printing values for x,y,and z in columns, python
import xlrd import os path = \'data\' with open(\'\', \'w\') as f: column_values=[\'\', \'\', \'\'] for filename in os.listdir(path):[详细]
2023-03-29 16:54 分类:问答PyDev: Fatal error Python32\lib\io.py, line 60, in <module>
I work in PyDev and quite suddenly, I cannot run my python programs from within Eclipse\'s PyDev (version 2.1.0) anymore.[详细]
2023-03-29 15:53 分类:问答datetime: print as seconds
I have a datetime object. I want to print it as just number of seconds (i.e., 1 min 30.5 sec should print as 90.5 s). Can\'t seem to find a way to do it wi开发者_如何学运维th strftime.I think that for[详细]
2023-03-29 06:49 分类:问答Widget Toolkits for Python 3 [closed]
Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.[详细]
2023-03-29 04:19 分类:问答Should I Return None or (None, None)?
We have a object method that returns a city/state tuple, i.e. (\'Boston\', \'MA\'). Under some valid circumstances, there is no valid city/state to return. Stylistically, does it make more sense to re[详细]
2023-03-29 00:53 分类:问答Python 3 regular expression to find multiline comment
I\'m trying to find comment blocks in PHP source code using regular expressions in Python 3. The PHP comments are in this format:[详细]
2023-03-29 00:28 分类:问答Python 3.2 TypeError: unsupported operands(s) for %: 'NoneType' and 'str'
Just getting started with python and tried the following bit of code my_name = \'Joe Bloggs\' my_age = 25[详细]
2023-03-29 00:27 分类:问答