| | |
newb: Print ids, you get 1L, what is L?
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2006
Posts: 608
Reputation:
Solved Threads: 150
Apparently so. You can check it:
Jeff
Python Syntax (Toggle Plain Text)
>>> a = ((11L,), (12L,), (13L,), (14L,), (15L,), (16L,), (17L,), (18L,), (19L,), (20L,)) >>> print a[0] (11L,) >>> print a[0][0] 11 >>> print type(a[0][0]) <type 'long'> >>>
Jeff
•
•
Join Date: Sep 2007
Posts: 33
Reputation:
Solved Threads: 8
If you are returning longs you can selectively turn them into integers using int() e.g:
- Paddy.
Python Syntax (Toggle Plain Text)
>>> a = ((11L,), (12L,), (13L,), (14L,), (15L,), (166666666666L,)) >>> b = tuple((int(i[0]),) for i in a) >>> b ((11,), (12,), (13,), (14,), (15,), (166666666666L,)) >>>
![]() |
Similar Threads
- Forms in Random access files (Visual Basic 4 / 5 / 6)
- Trying a leet to human dictionary: Help! (Python)
- Need 2 print (Visual Basic 4 / 5 / 6)
- internet explorer while trying to print (Web Browsers)
- Adding data to print job (Visual Basic 4 / 5 / 6)
- Outlook XP won't print (Windows NT / 2000 / XP)
- Page counter print accounting (*nix Software)
Other Threads in the Python Forum
- Previous Thread: Generating HTML in Python
- Next Thread: Array Distances
Views: 1761 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Python
address anydbm app backend bash beginner bits calling class code conversion coordinates copy curves dictionary directory dynamic edit examples excel feet file float format ftp function generator gui halp homework http i/o images import info input ip itunes java keycontrol line linux list lists loop maintain millimeter mouse newb number numbers output panel parsing path port prime print program programming projects py-mailer py2exe pygame pyqt python queue random rational recursion recursive scrolledtext server smtp split ssh statictext string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode update urllib urllib2 variable whileloop windows write wxpython





