15,190 Topics
![]() | |
Hi there! I have run into a new problem, this time with the re.findall() module. The objective of this code is to iterate over rows in a Excel sheet and print them in a other Excel sheet with a separation of column between the species name and the gene name. … | |
Hello All I am having an odd issue with mysqldb connection from python to a database. The issue is, when I run the query directly or via a sql client like navicat or toad, I get the required value, but this does not happen via python/mysqldb combo. This is the … | |
I am trying to ftp on a windows system using a file with the settings in it. This is what is in the file: Address.to.device username password "quote" "site reboot" quit This will reboot a camera and it works. I even have it running on powershell script and it works. … | |
Hi, i am trying to run this code. previously it was giving error that "No module wx". then I download wx module and now it is giving this error : Traceback (most recent call last): File "C:\Python24\player.py", line 2, in -toplevel- import wx File "C:\Python24\wx\__init__.py", line 45, in -toplevel- from … | |
Hello there below is the easy way to get the email addresses extracted from any file. import os import re import sys def grab_email(file): """Try and grab all emails addresses found within a given file.""" email_pattern = re.compile(r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b',re.IGNORECASE) found = set() if os.path.isfile(file): for line in open(file, 'r'): found.update(email_pattern.findall(line)) for … | |
New Daniweb way to copy the code from posts with indentation is to double click (not too quickly) to select the code region and use normal copy paste as you like (second mouse button or ctrl-c). Easier than before but little not obvious! | |
Hey guys, can't see what is wrong with my code, I keep getting the error Status: 500 Internal Server Error Content-Type: text/html <html><body><h1>500 Internal Server Error</h1></body></html> [CODE]import httplib import sys import time #Initial connection to the server def connectingToServer(port, message, path): connection = httplib.HTTPConnection('rpc248.cs.man.ac.uk', port) headers = {'Content-type': 'application/xml', 'Accept': … | |
Given below is the error which I am getting while running the code (which is in my previous post http://www.daniweb.com/software-development/python/threads/419674/import-wx-error ) in python 2.6. Can anyone tell about this error? .. i am unable to understand it. Traceback (most recent call last): File "C:\Python26\music_player_v1\player_skeleton.py", line 153, in <module> frame = … | |
Friends, kindly help me how to update the progress bar in WX Widgets python while copying folder in windows... i tried searching a lot.. please do help me out.. Thanks in advance! Ganesh R | |
Hey. I'm writing a script that processes some data. The script creates a HTML page which contains a form that calls (action=) the same script and changes according to data asked. So the user asks for something, the script goes to a DB, gets it and prints it into the … | |
I'm a tutor that is helping one of my students with a simple guessing game program. It's supposed to be similar to the board game Mastermind. This program should prompt the user to enter 5 distinct digits, and it should return the how many digits are correct and how many … | |
I am also working in python 2.6 and i want to send SMS to a mobile while my cell phone i.e. Nokia E-72 is connected to PC via Data Cable. The mobile is connected through a serial port and the code prompts the correct port as well and there is … | |
Hello! I try to get py output to html table tag. I have a problem to create table in a table... Here is a pattern how it should look like (in yellow color) file name: format_DOC.doc here is the code I use to get a result. Pls can you help … | |
hi everyone. i'm tryng to use Reportlab to output an invoice on a simple Django app. it seems quite difficult to do simple things like this. here's my code: def print_pdf(fattura, soggetto, buffer=None): import time from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY from reportlab.lib.pagesizes import letter from reportlab.platypus import SimpleDocTemplate, … | |
How do you append a CGI file from a server into a txt file? | |
Trying to get soemone to input a Password (hello) as an input and then getting a loop to a second part of the program where he/she inputs his/her name and then gets a response accordingly. Not sure why this is not working but maybe someone else does. let me know … | |
Hi, I am creating RTF editor in python. I am not able to get which classes or library I should use for opening and saving RTF files. I found one pyrtf but that is very old and just for exporting... Please help me out.. Regards Neelesh Gurjar | |
When I open my Python file through cygwin it recongnizes a module that I installed recently(PyCrypto) but when I open Python IDLE and then click on Run Module, it says that PyCrypto wasnt installed. Whats wrong? Thanks for the help. | |
I have a file like this a csv file DB01967 ZIPA DB01967 PFAZ DB01992 YVBK DB01992 ZAP70 DB02191 ZIPA DB02319 YQHD DB02552 ZFPP I want to print a file of csv in the format like DB01967 ZIPA PFAZ DB01992 YVBK ZAP70 DB02191 ZIPA DB02319 YQHD DB02552 ZFPP i am totally … | |
I have a list as alist = [[], [(u'0.77',)], [(u'0.34',)], [(u'0.12',)], [(u'0',)], [(u'0.0',)], [(u'0',)]] I'm trying to get it as like this [0.77, 0.34, 0.12, 0, 0.0, 0] using the statement rlist= map(lambda a: int(a), alist) but got an error as, TypeError: int() argument must be a string or a … | |
I need to figure out what is wrong with this program and correct it so it works. I have been screwing around with it for hours and still cannot figure out what is wrong. I know that I need to change the first line, but I have no idea how … | |
Hi, I'm new to programming in Python, & I need help. I am trying to read from a text file, which contains: 1 4 5 3 1 0 2 4 18 5 2 0 0 9 I am suppose to implement a Simplex algorithm that can hopefully solve these numbers. … | |
In Python, which is more of a pythonian style of writing between these two: 1. print 'Hello' or 2. print('Hello') If u have a link on basic outlines of pythonian style and which syntax is a more pythonic way to use, it would be very useful to me. Thank You! | |
Hello, I need to install the module pycrypto to run a program but ive been stuck for about 2 hours trying to figure out where to put it exactly. Ive tried in the folder where my program is, also in the usr/lib/python2.6/ using python setup.py install (i actually did build … | |
Hello everyone, I've been working with some python scripts for few days now, what editor i've been using? the answer is Notepad, but then i move to Notepad++ which is the one i use to edit batch files php files, and many other programming files formats, but just now i'ma … | |
Hey As my title sais having issues getting characters (like names and such ) in my code. I can only get numbers Any help would be appreaciated print ("Program 2: Using Inputs") #prints the title print ("Author: Benoit Labelle") #prints the author's name print ("ID: 3065521") #prints the authors id … | |
As you can tell I am very new to python...I stumbled upon pygame and it looked fun. So I started to build a game and I got stuck right away...Player controls. I would like the player to be able to contorl the person. Thank you. import pygame, random import random, … | |
Hello everyone, I search for this answer, and yeah, it looks like many asked this question before, but my answer was not on those posts. now i would liek to double ask the same question again... how can i invoke a python script from command pronpt? this is the way … | |
I'm trying to design a function that accepts a list of numbers as an argument. I can get the program working when i put a list into the programme but I can't figure out how to allow a user to enter a series. What i've got so far is below. … | |
Whats up guys! To start off I am really new to python. I got this program that keeps giving me this error message. I was wondering if anyone could help me. Heres the code: from math import * from numberTest import * Lname=['Zdofalos','Johnson','Terrell','Wilson','Key','Smith','Alfonso'] Fname=['Fred','Malcom','Monkey','Wilson', 'LeDoor','Jim Bob','Ralph'] City=['Charlotte','Monroe','Broken Pine','Hogwart','Spot In Road','Denver','Gastonia'] … |
The End.