15,190 Topics

Member Avatar for
Member Avatar for sinnebril

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. …

Member Avatar for sinnebril
0
202
Member Avatar for xav.vijay

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 …

Member Avatar for TrustyTony
0
624
Member Avatar for treyb

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. …

Member Avatar for treyb
0
324
Member Avatar for frivolous

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 …

Member Avatar for ZZucker
0
685
Member Avatar for bishisht

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 …

Member Avatar for TrustyTony
1
303
Member Avatar for TrustyTony

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!

Member Avatar for TrustyTony
1
298
Member Avatar for djbuclkle

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': …

Member Avatar for bishisht
0
317
Member Avatar for frivolous

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 = …

Member Avatar for bishisht
0
243
Member Avatar for ganeshrnet

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

Member Avatar for bishisht
0
890
Member Avatar for dvirdc

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 …

Member Avatar for dvirdc
0
124
Member Avatar for BThomps

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 …

Member Avatar for BThomps
0
234
Member Avatar for salina786

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 …

Member Avatar for salina786
0
294
Member Avatar for vlady

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 …

0
68
Member Avatar for lordluke_80

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, …

0
248
Member Avatar for Tyler212
Member Avatar for jlm699
0
76
Member Avatar for aquaben

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 …

Member Avatar for TrustyTony
0
150
Member Avatar for ngurjar

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

Member Avatar for raptr_dflo
0
72
Member Avatar for lisa92222

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.

Member Avatar for TrustyTony
0
105
Member Avatar for abhik1368

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 …

Member Avatar for TrustyTony
0
131
Member Avatar for webstart

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 …

Member Avatar for vegaseat
0
6K
Member Avatar for windiggy

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 …

Member Avatar for woooee
0
338
Member Avatar for MunkyCheez

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. …

Member Avatar for woooee
0
4K
Member Avatar for utkarshsahu

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!

Member Avatar for utkarshsahu
0
172
Member Avatar for lisa92222

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 …

Member Avatar for TrustyTony
0
189
Member Avatar for C0ding

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 …

Member Avatar for C0ding
0
416
Member Avatar for aquaben

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 …

Member Avatar for woooee
0
104
Member Avatar for Twin802

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, …

Member Avatar for Twin802
0
168
Member Avatar for C0ding

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 …

Member Avatar for C0ding
0
321
Member Avatar for SpartanIE

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. …

Member Avatar for TrustyTony
0
2K
Member Avatar for Kaptain Khronic

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'] …

Member Avatar for TrustyTony
0
301

The End.