15,181 Topics

Member Avatar for
Member Avatar for arunpawar

I am trying to build a simple app that calculates the farenhit to celsius converter. Here is my code.. from gi.repository import Gtk, GObject class DemoWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Demo Example") self.set_size_request(300, 400) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6) self.add(vbox) self.entry = Gtk.Entry() self.entry.set_text("Enter Farenhit") self.button1 = Gtk.Button(label="Calculate") self.button1.connect("clicked", self.on_button1_clicked) vbox.pack_start(self.entry, True, …

Member Avatar for arunpawar
0
250
Member Avatar for fatalaccidents

Hey guys, I'm trying to use mpi4py on my mac but I'm running into some problems. I'm just trying to get it up and running by running a simple helloworld program that runs on different processors. When I run the command 'mpiexec -n 2 python helloworld.py' I'm getting a very …

Member Avatar for fatalaccidents
0
545
Member Avatar for iraj.jelo

i have a Qt code writed in C++ . i want translate it to python code, but i have a problem in 4 code line: all code is: void TableView::print(QPainter* painter, const QRect& area) { const int rows = model()->rowCount(); const int cols = model()->columnCount(); // calculate the total width/height …

Member Avatar for HiHe
0
2K
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 bcarancibia

Hi guys, My university recently switched mail services and in order to maintain our new listservs we have to import the emails using a different format. I have all the emails in a text file like this: test@testing.com test2@testing.com test3@testing.com In order to import it to the new mailing system …

Member Avatar for bcarancibia
0
177
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
128
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
324
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
197
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
207
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
130
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
64
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
163
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
214
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
211
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
240
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
100
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
630
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
292
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
133

The End.