Search Discussions

221 discussions - 1,634 posts

  • Hello, How can i wrote the two following lines so for NOT to throw out KeyErrors when a key is missing? city = gi.time_zone_by_addr( os.environ['HTTP_CF_CONNECTING_IP'] ) or gi.time_zone_by_addr( ...
    Sep 26, 2013 at 7:26 am
    Sep 29, 2013 at 9:49 pm
  • Some time ago, Tom Christiansen wrote about the "Seven Deadly Sins of Perl": http://www.perl.com/doc/FMTEYEWTK/versus/perl.html What design mistakes, traps or gotchas do you think Python has? Gotchas ...
    Steven D'ApranoSteven D'Aprano
    Sep 10, 2013 at 6:09 am
    Sep 18, 2013 at 5:55 pm
  • try: # prepare mail data FROM = random_char(10) + '@' + random_char(10) + '.com' TO = "nikos.gr33k at gmail.com" SUBJECT = random_char( 50 ) MESSAGE = random_char( 500 ) os.system( "echo %s | mailx ...
    Ferrous CranusFerrous Cranus
    Sep 15, 2013 at 3:54 pm
    Sep 23, 2013 at 1:17 am
  • There are a few known GUI toolkits out there, and the main ones from what I can tell are: Tkinter -- Simple to use, but limited PyQT -- You have a GUI designer, so I'm not going to count that PyGTK ...
    Sep 11, 2013 at 8:55 pm
    Jun 2, 2014 at 12:02 pm
  • Hello, i have written the following snipper of code to help me send mail: ================================================================================================================= # if html ...
    Ferrous CranusFerrous Cranus
    Sep 3, 2013 at 7:48 am
    Sep 6, 2013 at 6:44 am
  • Good morning Steven, Ye i'm aware that i need to define variables before i try to make use of them. I have study all of your examples and then re-view my code and i can *assure* you that the line ...
    Ferrous CranusFerrous Cranus
    Sep 1, 2013 at 6:50 am
    Sep 5, 2013 at 5:28 am
  • Hello, i decided am ong other os.environ variables to also grab the 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError complaining that 'HTTP_REFERER' didnt exist. So, to see ...
    Sep 25, 2013 at 12:45 pm
    Sep 27, 2013 at 6:01 am
  • Hi, I am thinking about getting a software but it requires python, so that brought up a few questions. Is it safe do download python, and does it come with spam or advertisements? If it doesn't then ...
    Aaron MartinAaron Martin
    Sep 8, 2013 at 1:17 am
    Sep 11, 2013 at 6:05 pm
  • Hey i am a programmer but new to python. Can anyone guide me in knowing which is a better IDE used to develop web related apps that connect to DB using python?
    Sep 11, 2013 at 2:14 pm
    Mar 10, 2014 at 12:01 am
  • 1.a. Write a function temp(T, from_unit, to_unit) where from_unit and to_unit are temperature units, either 'F' (or 'f') for fahrenheit, or 'C' (or 'c') for celsius, or 'K' (or 'k') for kelvin; and T ...
    Sep 23, 2013 at 12:57 pm
    Feb 10, 2014 at 7:01 pm
  • I started Python 4 months ago. Largely self-study with use of Python documentation, stackoverflow and google. I was thinking what is the minimum that I must know before I can say that I know Python? ...
    Aseem BansalAseem Bansal
    Sep 20, 2013 at 9:58 am
    Sep 26, 2013 at 10:16 am
  • Dear all, I am writing the documentation for a Python package using Sphinx. I have a problem when using doctest blocks in the documentation: I couldn't manage to get doctest to run a command but ...
    Luca CeroneLuca Cerone
    Sep 21, 2013 at 10:47 am
    Sep 23, 2013 at 6:54 pm
  • I have an excel file. When I select cells, copy from excel, and then use win32clipboard to get the contents of the clipboard, I have a 131071 character string. When I save the file as a text file, ...
    Stephen BouletStephen Boulet
    Sep 12, 2013 at 11:01 pm
    Sep 19, 2013 at 7:58 pm
  • hi, I want to iterate over the lines of a file and when i find certain lines, i need another loop starting from the next of that "CERTAIN" line till a few (say 20) lines later. so, basically i need ...
    nikhil Pandeynikhil Pandey
    Sep 18, 2013 at 11:12 am
    Sep 19, 2013 at 2:48 pm
  • Hey, I am very new to python, I am 13 years old. I want to be able to make a program the caculates the mean, meadian and mode. When i run the program, an input field pops up and says 'Does your list ...
    William BryantWilliam Bryant
    Sep 11, 2013 at 4:49 am
    Sep 13, 2013 at 11:34 pm
  • Short comment about the "detection" tools from a previous discussion. The tools supposed to detect the coding scheme are all working with a simple logical mathematical rule: p == q <== non q == non p ...
    Sep 6, 2013 at 9:11 am
    Sep 11, 2013 at 9:11 pm
  • Need suggestions. Say, I have a namedtuple like this: {'a': brucelee(x3, y21), 'b': brucelee('x'3, 'y'21) I need to convert it to: {'a': {'x':123, 'y': 321},'b': {'x':123, 'y': 321}} Follow-up ...
    Sep 25, 2013 at 10:45 pm
    Sep 26, 2013 at 7:10 pm
  • Hi, In our school I have an introductory Python course. I have collected a large list of exercises for the students and I would like them to be able to test their solutions with an online judge ( ...
    Jabba LaciJabba Laci
    Sep 20, 2013 at 5:28 pm
    Sep 24, 2013 at 3:04 am
  • the word 'def' has squiggily lines but the program works fine. It says: Syntax Error: expected an indented block. - why? def restart(): print(""" ~~~~~~~~~~~~~~~~ Cacluation DONE! ~~~~~~~~~~~~~~~~ ...
    William BryantWilliam Bryant
    Sep 19, 2013 at 6:46 pm
    Sep 23, 2013 at 12:39 am
  • Hey I am new to python so go easy, but I wanted to know how to make a program that calculates the maen. List = [15, 6, 6, 7, 8, 9, 40] def mean(): global themean, thesum for i in List: thecount = ...
    William BryantWilliam Bryant
    Sep 16, 2013 at 11:33 pm
    Sep 18, 2013 at 1:53 am
  • Hi, I intalled an executable version of statsmodels library for Windows 32-bit. When I import it in my Python Shell no problem occurs buy when I write: import statsmodels.api as sm the following ...
    Davide DalmassoDavide Dalmasso
    Sep 16, 2013 at 3:37 pm
    Sep 18, 2013 at 12:03 am
  • Greetings to all! i ran into a little logic problem and trying to figure it out. my case is as follows: i have a list of items each item represents a Group i need to create a set of nested groups, ...
    Stas poritskiyStas poritskiy
    Sep 10, 2013 at 9:08 pm
    Sep 11, 2013 at 4:17 pm
  • I'm having trouble with the BOM that is now prepended to codecs files. The files have to be read by java servlets which expect a clean file without any BOM. Is there a way to stop the BOM being ...
    J. BaggJ. Bagg
    Sep 24, 2013 at 9:42 am
    Sep 25, 2013 at 10:54 am
  • Hello everybody I'm trying to run this: <code SyntaxError: EOL while scanning string literal </code I think that the character '\' is the problem, but unfortunately I'm developing a small app for ...
    Sep 2, 2013 at 12:03 am
    Sep 11, 2013 at 10:16 am
  • Hi, At startup, IPython (qtconsole) calls "socket.gethostbyname_ex(socket.gethostname())[2]" to find a list of IP addresses that point to the machine. On a Linux server that I manage this call is ...
    Anntzer LeeAnntzer Lee
    Sep 1, 2013 at 12:03 am
    Sep 2, 2013 at 9:12 pm
  • from random import * from math import floor kaarte_alles = 52 kaart_t?mmatud = [False for i in range(52)] mast = ["?rtu", "ruutu", "poti", "risti"] aste = ["?ss", "kaks", "kolm", "neli","viis", ...
    Sep 27, 2013 at 10:24 am
    Sep 29, 2013 at 12:04 am
  • o want to avoid having to type somehting like this: if person="George": times in range(0, 5): Why it gives me an error when i'm trying to write it like this: if person="George" for times in range(0, ...
    Ferrous CranusFerrous Cranus
    Sep 17, 2013 at 12:02 pm
    Sep 18, 2013 at 7:00 am
  • Is there a way to detect if the user presses a key in Python that works on most OS's? I've only seen 1 method, and that only works in Python 2.6 and less. If you get the key, can you store it in a ...
    Sep 9, 2013 at 5:39 pm
    Sep 14, 2013 at 10:03 pm
  • I'm trying to understand data handling using multiprocessing and threading, haven't gotten very far without running into problems. This is my code: #!/usr/bin/python from multiprocessing import ...
    Paul PittlersonPaul Pittlerson
    Sep 5, 2013 at 7:27 pm
    Sep 6, 2013 at 9:15 pm
  • Im new to python3.x (well, programming as a whole. Never done before) and was wondering how do i get a proper interface instead of just writing. Im using android device(sl4a and py34a). Ive heard ...
    Paul RicePaul Rice
    Sep 2, 2013 at 3:03 pm
    Sep 3, 2013 at 2:43 am
  • http://imgur.com/E6vrNs4 Can't seem to be getting an output.
    Sep 28, 2013 at 12:43 am
    Sep 29, 2013 at 7:07 am
  • Hello Everyone, I have a multi-line string and I need to remove the very first line from it. How can I do that? I looked at StringIO but I can't seem to figure out how to properly use it to remove ...
    Anthony PapillionAnthony Papillion
    Sep 2, 2013 at 4:06 pm
    Sep 11, 2013 at 1:03 pm
  • choices = dict() choices["apple"] = 10 choices["pear"] = 20 choices["banana"] = 15 choices["orange"] = 25 choices["kiwi"] = 30 I want to pick sets of fruit, three in a set, where the chance of ...
    Jason FriedmanJason Friedman
    Sep 8, 2013 at 2:12 am
    Sep 10, 2013 at 10:27 am
  • Hi, I'm doing Python exercises and I need to write a function to flat nested lists as this one: [[1,2,3],4,5,[6,[7,8]]] To the result: [1,2,3,4,5,6,7,8] So I searched for example code and I found ...
    Arturo BArturo B
    Sep 25, 2013 at 11:24 pm
    Sep 28, 2013 at 8:24 pm
  • Hi all, I've just started trying to learn how to use ttk, and I've discovered something that I don't understand. I'm using Python 3.3.0 in Linux Mint 15. Suppose I create the following module: # ...
    Sep 16, 2013 at 4:28 pm
    Sep 17, 2013 at 4:20 pm
  • Hi All, I'm fairly new to Python so please forgive me If I sound confused or include anything a bit irrelevant. I've had some great responses from this group already though so thanks. I have a source ...
    Sep 4, 2013 at 4:32 pm
    Sep 5, 2013 at 12:53 pm
  • I just stumbled across this video and found it interesting: http://vimeo.com/72870631 My apologies if it has been posted here already.
    Russ P.Russ P.
    Sep 2, 2013 at 4:24 am
    Sep 3, 2013 at 1:36 am
  • Hello, I am trying to write a few tests for a random input number game but not too sure how to proceed on. I am following the Python Game from http://inventwithpython.com/chapter4.html Started the ...
    Sep 26, 2013 at 3:14 am
    Sep 29, 2013 at 9:45 pm
  • Hi, I have a list of sentences and a list of words. Every full word that appears within sentence shall be extended by <WORD i.e. "I drink in the house." Would become "I <drink in the <house ." (and ...
    Sep 28, 2013 at 4:11 pm
    Sep 28, 2013 at 6:25 pm
  • I'll have to ask this atgain because i got no proper reply: Here is the code i wrote to try tos end anonymous mail: # ...
    Sep 21, 2013 at 9:58 am
    Sep 24, 2013 at 2:55 pm
  • Hello, # I posted this on the tutor list, but my message wasn't displayed I shared some assembly code (microcontrollers) and I had a comment wit my e-mail address for contact purposes. Supposing my ...
    Jugurtha HadjarJugurtha Hadjar
    Sep 20, 2013 at 3:04 pm
    Sep 22, 2013 at 10:10 am
  • I'm NOT a programmer?. but I have a little Python script that converts files, that are in a folder, from one format to another. Script = fxp2aupreset.py I can successfully run it from the command ...
    Sep 8, 2013 at 1:41 am
    Sep 8, 2013 at 3:54 am
  • I was trying to install wxPython earlier today. Not RTFMing, I tried 'easy_install wx', which ended up installing this strange module: https://pypi.python.org/pypi/wx Looking at the download stats, ...
    Brian RakBrian Rak
    Sep 3, 2013 at 8:15 pm
    Sep 4, 2013 at 3:30 am
  • I have been using the script youtube-dl http://rg3.github.io/youtube-dl/ And I was wondering if there is a way to download all of a user's favorites or uploads. The script has a functionality to ...
    Sep 26, 2013 at 3:13 pm
    Sep 27, 2013 at 8:19 pm
  • Hi, I'm having trouble encoding a MIME message with a binary file. Newline characters are being interpreted even though the content is supposed to be binary. This is using Python 3.3.2 Small test ...
    Sep 25, 2013 at 4:38 pm
    Sep 26, 2013 at 6:44 pm
  • Hi all, I'm looking for a python IDE (for Linux) that can look at code like this: class ConductorManager(manager.Manager): def compute_recover(self, context, instance): self.compute_api.stop(context, ...
    Chris FriesenChris Friesen
    Sep 23, 2013 at 3:06 pm
    Sep 26, 2013 at 7:02 am
  • This is an idea brought over from another post. When I write Python code I generally have 2 or 3 windows open simultaneously. 1) An editor for the actual code. 2) The interactive interpreter. 3) An ...
    Peter CacioppiPeter Cacioppi
    Sep 21, 2013 at 9:43 pm
    Sep 23, 2013 at 9:35 pm
  • Hi, folks, Some of you may remember that I am teaching some high school students how to program. Because they all love graphics, I have been investigating the turtle module, which I gather is built ...
    John LadaskyJohn Ladasky
    Sep 22, 2013 at 4:39 am
    Sep 23, 2013 at 7:26 am
  • Not specifically about Python, but still relevant: http://blog.kickin-the-darkness.com/2007/09/confessions-of-terrible-programmer.html -- Steven
    Steven D'ApranoSteven D'Aprano
    Sep 6, 2013 at 4:56 pm
    Sep 16, 2013 at 2:56 pm
  • How do I send the command 'Alt+D' to subprocess.PIPE? My code is import subprocess rsconfig = subprocess.Popen(["C:\Program Files\Photometrics\PVCam64\utilities\RSConfig\RSConfig.exe", ...
    Sep 11, 2013 at 2:26 pm
    Sep 12, 2013 at 5:20 pm
Group Navigation
period‹ prev | Sep 2013 | next ›
Group Overview
grouppython-list @

290 users for September 2013

Chris Angelico: 111 posts Dave Angel: 84 posts Steven D'Aprano: 79 posts Νίκος: 72 posts Terry Reedy: 47 posts Antoon Pardon: 38 posts Joel Goldstick: 36 posts Roy Smith: 33 posts MRAB: 27 posts SuperHost - Nikos: 27 posts Neil Cerutti: 26 posts Peter Otten: 26 posts Mohsen Pahlevanzadeh: 24 posts Piet van Oostrum: 24 posts John Gordon: 23 posts Oscar Benjamin: 23 posts Tim Chase: 23 posts Ben Finney: 22 posts Steven D'Aprano: 22 posts Denis McMahon: 21 posts
show more