Skip to content
IT Nursery
  • Home
  • Programming
    • Mac / IOS
    • Android
    • Web Applications
    • PHP
    • Java
    • C
    • C++
  • DataBase
    • MySQL
  • CMS
    • WordPress
  • System and Network
    • Serverfault

python-2.x

What exactly do “u” and “r” string prefixes do, and what are raw string literals?

by IT Nursery

There’s not really any “raw string“; there are raw string literals, which are exactly the string literals marked by an ‘r’ before the … Read more

Tags python, python-2.x, rawstring, unicode

How does Python 2 compare string and int? Why do lists compare as greater than numbers, and tuples greater than lists?

by IT Nursery

The following snippet is annotated with the output (as seen on ideone.com): print “100” < “2” # True print “5” > “9” # … Read more

Tags comparison, python, python-2.x, types

Determine if 2 lists have the same elements, regardless of order? [duplicate]

by IT Nursery

This question already has answers here: How to efficiently compare two unordered lists (not sets)? (10 answers) Closed 5 years ago. Sorry for … Read more

Tags equality, list, python, python-2.x

How to check if variable is string with python 2 and 3 compatibility

by IT Nursery

I’m aware that I can use: isinstance(x, str) in python-3.x but I need to check if something is a string in python-2.x as … Read more

Tags python, python-2.x, python-3.x, string

What is the difference between encode/decode?

by IT Nursery

I’ve never been sure that I understand the difference between str/unicode decode and encode. I know that str().decode() is for when you have … Read more

Tags character-encoding, python, python-2.x, string, unicode

Why should we NOT use sys.setdefaultencoding(“utf-8”) in a py script?

by IT Nursery

I have seen few py scripts which use this at the top of the script. In what cases one should use it? import … Read more

Tags encoding, python, python-2.x, sys, utf-8

What is `1..__truediv__` ? Does Python have a .. (“dot dot”) notation syntax?

by IT Nursery

I recently came across a syntax I never seen before when I learned python nor in most tutorials, the .. notation, it looks … Read more

Tags operators, python, python-2.x, python-3.x, syntax

Django TemplateDoesNotExist?

by IT Nursery

My local machine is running Python 2.5 and Nginx on Ubuntu 8.10, with Django builded from latest development trunk. For every URL I … Read more

Tags django, django-templates, python, python-2.x, python-3.x

How to run multiple Python versions on Windows

by IT Nursery

I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and … Read more

Tags compatibility, python, python-2.x, python-3.x, windows

How to print a percentage value in python?

by IT Nursery

this is my code: print str(float(1/3))+’%’ and it shows: 0.0% but I want to get 33% What can I do? Best Answer 7

Tags python, python-2.x
Older posts
Page1 Page2 … Page4 Next →

Recent Posts

  • Advice for improving internal dashboard [closed]
  • grep : ‘+’ special character
  • File location for Syslogs in Centos machine
  • How to collect users’ task completion times?
  • “service {FOO} start” vs. “/etc/init.d/{FOO} start”? [closed]
IT Nursery
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Important Link

  • About
  • Privacy Policy
  • Contact

IT Nursery

The Goal of ITNursery Engaging the world to foster innovation through aggregate information. Our Question Answer post, blog information, products and tools help developers and technologists in life and at work.

copyright © 2023 All Right Reserved | IT NurSery
x
x