14,952 Topics

Member Avatar for
Member Avatar for superbhimanshu

Hi all, I am trying to read data from an excel file using "xlrd" functions. File contains many columns one of which is Date and time (in MM/DD/YYYY and HH:MM:SS AM/PM format). I am successful in reading all other type of data. But unfortunately for this column, program could read …

Member Avatar for superbhimanshu
0
200
Member Avatar for HTMLperson5

Is it possible to change text colour in the console window with Python? If so, could anyone tell me how?

Member Avatar for HiHe
0
186
Member Avatar for chophouse

My first Daniweb question!! Am at the front end of learning Python (3.2.3) I'm doing a SQL query into a MySQL database for two fields, track_ID and track_duration. I'm getting a return of both, but instead of the duration value being expressed as 00:02:50, as it is stored in the …

Member Avatar for TrustyTony
0
152
Member Avatar for khukln-k

Maybe you will help me in this "simple" case: request2 = urllib.request.Request(url) cj2 = http.cookiejar.CookieJar() urlOpener2 = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj2)) url2 = urlOpener2.open(request2) allinfo2 = url2.info() Output of this script is on this image: http://img195.imageshack.us/img195/9514/20120523110058.png My question is: How I can add new element to headers ?? something like that ('Set-Cookie',"server=2")

0
127
Member Avatar for khukln-k

Python 3.2.2 I want to check HTTP status code (eg. 200 or 404) on some www application. There are five server, and each server have a copy of this www application (The user is automatically redirected to the application on the server with low traffic/sometimes on random server). Suppose that …

Member Avatar for khukln-k
0
308
Member Avatar for sidestrand

I have a small amount of data in a file which I want to use to draw plots. I can't see any problem with the following code, but running it results in the error message below. `a,b,c = np.loadtxt('myfile.csv', delimiter=',', usecols=(0,12,18), skiprows=1, dtype=('S5, i4, S8'), unpack=True)` ValueError: too many values …

Member Avatar for sidestrand
0
2K
Member Avatar for memomk

hey i heard that there is something called qt signals you can use it to change the GUI out side the main thread coz when i try to change it i get an error that i cant change the gui out of the main thread but i need it to …

Member Avatar for memomk
0
8K
Member Avatar for iraj.jelo

I'm trying to print the contents of a QTableView to the printer . i implement bottom script and it run successfully without any error. but all data are Unusual in printPreview. this is [pic](http://img4up.com/up2/75917679167425743216.png) from my problem -[FOUNTAIN](http://www.qtcentre.org/threads/3796-QTableView-printing?highlight=Qprinter) def printTable(self,printer,painter,area): model = self.model myTableView = self.view printer = painter rows …

0
219
Member Avatar for opprogrammer

Hi guys, I'm making an RPG(role-playing game) and I need some help. Here is the code so far: class Create: def __init__(self, power, attack, defense): self.power = power self.attack = attack self.defense = defense warrior = Create(300, 50, 150) wizard = Create(500, 100, 230) characters = [ "warrior", "wizard" ] …

Member Avatar for Schol-R-LEA
0
196
Member Avatar for 4evrmrepylrning

I'm working with some really ugly files at the moment When I get them they can look like any of these: All data on one line delimited by ┌ `data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌` Nice data. All the bits I'm interrested already one one line per bit of information: `data1|data2|data3|` `data1|data2|data3|` Mixed: `data1|data2|data3|┌data1|data2|data3|┌data1|data2|data3|┌` `data1|data2|data3|` …

Member Avatar for Gribouillis
0
205
Member Avatar for weblover

Hi, i have a list that contains 5 columns that contains strings and float values(3 strings columns and 2 float columns) .. i want to export this list to a space separated text file (each column in the list is a column in the text file) i tried to do …

Member Avatar for Sky Diploma
0
346
Member Avatar for shean1488

Hi everybody, I just start learning python, and beacuse of that I don't really know all usefull packages and methods, that this language has. But I would like to know how would you write this program, or how would you change it (or may be some part of it) to …

Member Avatar for shean1488
0
129
Member Avatar for adohertyd

I'm trying to build a meta search engine in Python, probably using Grok as a framework. Django seems a little more complicated than I need. My main problem is that I can't find any decent tutorials for Grok. It's own tutorial doesn't really explain anything. The way I intend it …

0
63
Member Avatar for Stefano Mtangoo

Hello all, I have been long using Tango Icons and are good, but some stuffs are lacking. Is there good freeware Icon designer or free Icon package? Thanks alot

Member Avatar for jsdevel
0
162
Member Avatar for HTMLperson5

Hello all, I am trying to think of ideas for programming projects, Python is the language I know most about so I decided to post it here. I have made some random stuff, like a Python program which generates a specified amount of asterisks I have made a text based …

Member Avatar for HTMLperson5
0
211
Member Avatar for HTMLperson5

By opaque binary i mean so that people cannot see the source code if they open the file in their text editor, so instead of seeing: print "You cant see me!" it would be something like: "0101010001010101001001010" And yes, i am trying to do this with python.

Member Avatar for TrustyTony
0
210
Member Avatar for kuchi

We have requirement to write simple xml in string format from listed dictionaries iterating through list and iterating through each dictionarie and write xml format (i.e. dict key is xml key and dict value is dict value ex:- <First_name>James</First_name> ), if the value contains dictionary again we need to loop …

Member Avatar for TrustyTony
0
239
Member Avatar for HTMLperson5

I need some ideas for the python text based game i am making, it looks like this so far: from time import sleep import sys #Functions set at start of code def helpme1(): for a in 'Recognised commands are: explore, help, suicide, flee, look, get,open door, run and attack. With …

Member Avatar for Gribouillis
0
4K
Member Avatar for anonymous0502

How to share variable between multiprocessing and Pyside application. I am a newbie.Can anyone help me?Any suggestion will be appreciated.Thanks very much. This is my demo: #!/usr/bin/env python #coding:utf-8 #demo:pyside gui application communicate with multiprocessing.Process() import sys,time import multiprocessing as mp import logging,logging.handlers from PySide.QtCore import * from PySide.QtGui import …

Member Avatar for vegaseat
0
540
Member Avatar for pythonbegin

Hi All I am working on a html parser 'selenium webdriver' and on one of the pages I found an image with text on it.The page contains other information as well. I tried to see the page source if I can extract the text on image using webdriver but I …

0
98
Member Avatar for bkjfdghiuds

hello I am following this tutorial on how to scrap website information http://www.newthinktank.com/2010/11/pyt ... -scraping/ this is my code: EDIT: do not post off site, moved here #! /usr/bin/python from urllib import urlopen from BeautifulSoup import BeautifulSoup import re def cleanHtml(i): i = str(i) # Convert the Beautiful Soup Tag …

Member Avatar for snippsat
0
2K
Member Avatar for srk619

need some help on the coding can some plz help the question is: A year is a leap year if it is divisible by 4, unless the year is a Century, in which case it is only a leap year if it is divisible by 400. Write a function which …

Member Avatar for HiHe
0
571
Member Avatar for jcmeyer

I would like to copy a row in a database and change one value. I think that this is close to what I am supposed to do. [CODE] self.cursor.execute("INSERT INTO DatabaseName (C1, C2, C3, C4, C5) SELECT (?, C2, C3, C4, C5) FROM DatabaseName WHERE C1=?", [newC1Value, copiedC1Value]) [/CODE] Although, …

Member Avatar for webstart
0
216
Member Avatar for 4evrmrepylrning

My brain is freezing up again. I have a string that looks something like this `1 apple--1 pear--1 peach--2 onion--2 carrot--3 <bee mince--3 <por chops--4 <oth salad:--potato--4 <oth bread:--garlic` Then I have a few dictionaries: dic1 = {'1': 'fruit', '2': 'vegetable', '3': 'meat', '4': 'other'} dic2 = {'bee': 'beef, 'por': …

Member Avatar for 4evrmrepylrning
0
216
Member Avatar for sabid

import maya import sys import os from functools import partial import maya.cmds as cmds def customVer(FileName, version): #create a file path with the file you have and version you want version = 9000+int(FileName[(location-3):location]) newFileName = str((myFileName[0:(location-3)])) version = str(version-1) version = version[1:] newFileName = newFileName+str(version) return newFileName def newFile(myFileName): #find …

Member Avatar for TrustyTony
0
291
Member Avatar for klevasseur

I have some text files (actually csv) that have the extension .ROS stored on a server and I can't seem to open them in Python. If I change the extension to .txt or .csv, I can open them fine either as text or csv, but I'd rather keep the .ROS …

Member Avatar for vegaseat
0
131
Member Avatar for drichird

In Python: #python class myClass: istat = 111 #exists as soon as import class def __init__(self): print("in ctor") self.iauto = 222 #does not exist until instance created ..... mc1 = myClass() mc2 = myClass() In C++: //C++ class myClass { public: static int istat; int iauto; }; ..... //main myClass …

Member Avatar for Gribouillis
0
802
Member Avatar for aot

As a psychologist, it's useful to be able to time people's reactions in milliseconds. What kind of accuracy could I expect to get in this regard from Python? From what I've read so far, it doesn't look like I can hope to get precise enough timing to get reliable results, …

Member Avatar for BBTK
0
9K
Member Avatar for evvo69

hi, i am a complete newbie on software development onlt a couple of weeks, currently working through a manual and one of the chapter challenges is to create a number guess game in a GUI enviroment. been trying to look for tips on the web to no avail. i am …

Member Avatar for evvo69
0
2K
Member Avatar for idislikemacs

I need a timer that shows the total elapsed time it took for the user to complete the game. I'm running Python 3.2, pyscripter 2.5.3. I'm using "timer.timer" but I'm having trouble. I want the timer to reset when the user inputs "reset", but still keep a running total in …

Member Avatar for memomk
0
132

The End.