15,406 Topics

Member Avatar for
Member Avatar for parijat24

[CODE]hi I am generating program to find keys in adictionary having same value in abig dictionary please see the example [B]cluster1 [/B]ENSTRUP00000000001 ENSTRUP00000000001 ENSTRUP00000001433 ENSTRUP00000030987 ENSTRUP00000031348 ENSTRUP00000033778 ENSTRUP00000034939 ENSTRUP00000036445 ENSTRUP00000041507 [B]cluster2[/B] ENSTRUP00000000004 ENSTRUP00000000004 ENSTRUP00000000270 ENSTRUP00000004241 ENSTRUP00000010453 ENSTRUP00000012064 ENSTRUP00000015898 ENSTRUP00000019830 ENSTRUP00000024116 ENSTRUP00000026101 ENSTRUP00000027201 ENSTRUP00000028303 ENSTRUP00000028313 ENSTRUP00000029002 ENSTRUP00000031498 ENSTRUP00000032796 ENSTRUP00000032823 ENSTRUP00000033498 ENSTRUP00000036274 …

Member Avatar for woooee
0
128
Member Avatar for dos_killer

when i write import win32print in my python command line (IDLE) it works fine and it is imported... but when i write import win32print in my py file then it gives an error says no module named win32print why am i not able to load the module when writing the …

Member Avatar for dos_killer
0
103
Member Avatar for Srynx

Hi! Just a quick question math.modf(x) is a python function that returns the fractional and integer parts of x. Both results carry the sign of x and are floats. Therefore, if I write, for instance, 5.4 to the python 2.6.6 command line I think I should get (0.4, 5.0) but …

Member Avatar for Srynx
0
145
Member Avatar for noonz

hi everyone so I am trying to do something after waiting a random number of seconds in a while loop.I have python22 installed and I am working on windows xp. The problem is that it time.sleep works fine the first time but returns the following error after that. I dont …

Member Avatar for woooee
0
946
Member Avatar for nightrev

I am having trouble writing a program that lists the perfect numbers less than 10,000 in JES. This is what I have so far. Can someone help me? [CODE]def perfect(): print "Perfect Numbers" count = 0 number = 4 while count < 10000: if sumsDivs(number): count = count + 1 …

Member Avatar for woooee
0
149
Member Avatar for nish88

hi everyone..... Can someone tell me 'how can we disable the close icon' which is found on upper left corner of a tkinter menu which is encircled in the picture below: Thanks in advance

Member Avatar for gleam.uahmed
0
4K
Member Avatar for HelloPeople1

Hi guys I finally finished my highscore list but i have one problem I have to sort it. I know how to sort regular list, but this is a bit different because of having the text in it. When I sort it I just get an weirdly sorted list. Does …

Member Avatar for slate
0
112
Member Avatar for lamba89

Hello, I have a problem using the MySQLdb library. I'm trying to insert values into my table but MySQL isn't showing them. What's more strange is the primary key is changing when I manually insert values using command prompt. Here's an example: [CODE] '786', '2011-02-16 14:52:38', NULL '787', '2011-02-16 14:52:52', …

Member Avatar for slate
0
173
Member Avatar for dragon_sagrado

heres the problem i made a code for sine(X) to calculate the taylor series but i need to change sine(x) for sine(x+1) but i dont know how to do it, heres the code i made [code] from math import sin as senopy def factorial(numero): factorial = 1 while (numero > …

Member Avatar for BearofNH
0
233
Member Avatar for ryanoman0

Ok. i have a python program launch in the windows command prompt window after you log in to increase security. (its simple, it asks three questions and if you answer all of them right the program ends) is there anyway to make it so that you cant just hit the …

Member Avatar for WildBamaBoy
0
294
Member Avatar for LoveMyPadres

Greetings. I'm doing SNMP programming using PySNMP and Python. In my application, I'll be talking with several different devices that are all performing a similar function, but the internal SNMP implementations are very different from each other. In most of them, I'm retrieving tables of information and then parsing them …

Member Avatar for TrustyTony
0
194
Member Avatar for annndrey

Hi all! I have a question about PyQT4. How can I get an index of current cell, in which the cursor is whitout clicking on it? According to official documentation of QT there are only signals that send current index when you click on it. But if you just enter …

Member Avatar for annndrey
0
275
Member Avatar for Python_nooby

Hi, I was hoping to create an application where the user can open a file from their hard drive (using the askopenfile dialogue from tkFileDialog) and it would display information such as file name / size. I managed to get everything working correctly except for displaying the information. I tried …

Member Avatar for slate
0
887
Member Avatar for sjones1025

Hi there, I am somewhat new to Python and I am writing a test that passes in URLs. I want to have a loop that will pass in different parameters. I cannot get past the error "TypeError: float argument required, not str" What am I doing wrong? [CODE]url3 = "http://standardsService/Standards.svc/Standards()?$filter=Authority%20eq%20'%s'&$inlinecount=allpages" …

Member Avatar for sjones1025
0
106
Member Avatar for Gh0st93

So I'm pretty far into development of my new game and I am trying to figure out how to do a bullet that will look like it fires from a plane sprite I thought of a way it didn't work so I went back to my old code. I would …

Member Avatar for eskimo456
0
178
Member Avatar for linuxoidoz

Hi, I'm puzzled I can't display unicode characters higher than u"\u2094". I can display all below and including u"\u2094" but nothing starting from u"\u2095" and up. How could that be? e.g. [CODE] self.label = QLabel(unichr(int('2094', 16)) + unichr(int('2098', 16))) [/CODE]

Member Avatar for linuxoidoz
0
2K
Member Avatar for tcl76

hi all, pls advise on: Can Python 2.6.6 scripts be converted to .dll and read by C sharp? Can Python 2.6.6 scripts be converted to .exe and read by C sharp? thanks tcl

Member Avatar for snippsat
0
214
Member Avatar for meensatwork

Hello, Iam using the pyodbc module to read / write to the .mdb file.i have written the following code for extracting some data from db and it works fine. [CODE]cursor.execute("select company_name, param_key,com_value \ from key_financial_ratio \ where param_key = ? \ and com_value > ? \ and com_value < ?" …

Member Avatar for woooee
0
634
Member Avatar for Ghostenshell

Can someone help me with my queue? I think the stack works fine. I just need the indexing of the queue or do I need to index the queue? [CODE]from string12 import * from queue import * def main(): stack1 = Stack() queue = Queue() word = raw_input("Enter a word …

Member Avatar for Ghostenshell
0
2K
Member Avatar for needsHelp!

Please help me with, creating an checker board!! this is all i got right now [CODE]from cs1graphics import * n = 8 paper = Canvas(400, 400) for y in range(n) : for x in range(n) : square = Square(100) square.moveTo(x*50, y*50) paper.add(square) [/CODE]

Member Avatar for Gribouillis
0
103
Member Avatar for HelloPeople1

Hi guys I've made a hangman game and now i want to make a highscore list for it. I was thinking that i would probably have to export the data to like excel or something, but I have no idea how to do this. Also if there is a better …

Member Avatar for woooee
0
262
Member Avatar for needsHelp!

as the title, i need to replace the dupilcated codes with loops! help me please! [CODE]from time import sleep timeDelay = .1 turtle.move(100,0) turtle.rotate(-7) Doraemon.move(60,0) Doraemon.rotate(-7) Panda.move(80,0) Panda.rotate(-7) Sun.rotate(2) sleep(timeDelay) turtle.move(100,0) turtle.rotate(1) Doraemon.move(60,0) Doraemon.rotate(1) Panda.move(80,0) Panda.rotate(1) Sun.rotate(2) sleep(timeDelay) turtle.move(100,0) turtle.rotate(1) Doraemon.move(60,0) Doraemon.rotate(1) Panda.move(80,0) Panda.rotate(1) Sun.rotate(-2) sleep(timeDelay) turtle.move(100,0) turtle.rotate(1) Doraemon.move(60,0) Doraemon.rotate(1) …

Member Avatar for needsHelp!
0
133
Member Avatar for zizuno

Can someone explain to me why this sort is going all wonky on me? And a how to fix would be cool too. Thanks [code] >>> a = ['2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '2', '3', '4', '5', '6', '7', '8', …

Member Avatar for zizuno
0
161
Member Avatar for da10x

We're working on a project and we are completely stuck. Basically, we are coding a virtual Quoridor player module. However, our player module thinks that it's starting one square in front of it's home! Why could this be? [CODE]from interface import * import engine import random import time import copy …

Member Avatar for richieking
0
1K
Member Avatar for colts18

Hey guys I am creating a game, I am using Python and Pygame and I am trying to tell the tank to disappear when the bullet hits it. I have started to create the code but I don't know how to clear only one object is it possible. I might …

Member Avatar for TrustyTony
0
179
Member Avatar for vinayj85

hi, i am trying to control the windows media player using pywinauto. I am able to do some controlling using the menu tabs, but i want to control the WMP with the taskbar that is present on the left side, and when those buttons are clicked their respective operations i …

Member Avatar for richieking
0
202
Member Avatar for woofers

hello, I am new to clutter (and pyclutter). I have been trying to use pyclutter. I haven't found any good tutorial for it so far. I mean nothin that really explains properly. I saw a couple of example programs but when I tried to use pyclutter I dint get any …

Member Avatar for TrustyTony
0
259
Member Avatar for Ghostenshell

Trying to put the 4 queue.enqueue into a while loop. Any suggestions? Files are attached. [CODE]from string13 import * from queue import * stack1 = Stack() queue = Queue() pallist =[] pallist2 =[] def main(): stack1.push(4) stack1.push('2') stack1.push(1) stack1.push(5) while not stack1.isEmpty(): pallist.append(stack1.pop()) print pallist """while queue.size < len(pallist):""" queue.enqueue(pallist[3]) …

Member Avatar for Gribouillis
0
102
Member Avatar for tcl76

hi, assume data looks like this: cell Bit 0 1 1 X 2 1 3 0 4 X 5 X 6 X 7 X 8 1 9 X 10 0 11 0 12 X 13 X 14 1 15 1 And i want to group 4 bits into each group …

Member Avatar for tcl76
0
249
Member Avatar for mzittlow

I am creating a scrolled frame object within Tkinter. My current approach is to have a frame embedded within a scrolling canvas. I have seen numerous examples of this technique but they have one common 'flaw'--the frame's contents are loaded and then the controlling canvas's scrollregion is set. In my …

0
201
Member Avatar for hkus10

1) Is there any way to split ['a', 'b c'] into ['a', 'b', 'c']? 2) db = [["a", "b", "c"], ["apple", "bean", "cat"]] lines = sys.stdin.readlines() for i in range(len(lines)): lines[i] = lines[i][:-1] for i in range(len(lines)): for j in range(len(db[0])): if lines[i] == db[0][j]: print db[1][j] else: print lines[i] …

Member Avatar for woooee
0
102
Member Avatar for yeticannotski

Dear All, I am struggling to write my first "useful" python script, which is a backup tool. After hours and hours of trial and error, I finally got it to create two different lists. The first list is that of the files to be copied: [CODE]['C:\\Folder\\Foo.txt', 'C:\\Folder\\Folder1\\Foo1.txt', 'C:\\Folder\\Folder1\\Folder2\\Foo2.txt', 'C:\\FolderB\\FooB.txt', 'C:\\FolderB\\FolderB1\\FooB2.txt'][/CODE] …

Member Avatar for yeticannotski
0
3K
Member Avatar for addmaths07

Hey! I am developing a type of an rss reader. Which fetches latest 1-2 feeds from a webserver and publishes them to a subscriber. The problem I am facing is, this [URL="http://www.feedparser.org/"]feedparser[/URL] is using etag and modified date to recognise latest feeds. It works fine with the servers which support …

0
102
Member Avatar for gaurav.pruthi88

Hello , For the given snippet , why the result comes out to be 2..while it should be 3 , if the expression is interpreted from Left-Right or .75 for vice-versa. >>>3/2*2 2 >>>

Member Avatar for gaurav.pruthi88
0
82
Member Avatar for aramis7350

Hi all, I have a problematic Dell Dimension 4600i and I'm not sure what the source of my problem is. I decided to do a clean install of XP on it and ran into a problem. The installation took forever, maybe five times as long as it should normally have …

0
52
Member Avatar for tottletj

Basically I have a long list of numbers, that are never greater than 999999, and never have more than 2 decimal places, ie, most numbers look like 123456.78 But I have several numbers in this list that are less than 100000, or have only 1 decimal place, or both. One …

Member Avatar for Gribouillis
0
161
Member Avatar for vegaseat

Here we experiment with a gauge or progress bar made from a label displaying a variable number of spaces in color. In this example, we use from 0 to 100 spaces. This label based gauge allows you to choose many different colors, and you can even change the color as …

Member Avatar for naytanl
1
592
Member Avatar for TrustyTony

I had posted here already here to forum a [beautiful code for solving Sudoku puzzles](http://www.daniweb.com/software-development/python/code/294304/eleagant-and-fast-sudoku-with-generator-expressions), so I was in kind of dilemma what to do, as I read the task to do a sudoku solve as one task in Project Euler. To use the code from before and just take …

Member Avatar for TrustyTony
0
894
Member Avatar for goshiluvarchie

Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> …

Member Avatar for goshiluvarchie
0
5K
Member Avatar for GDICommander

Hello, DaniWeb community! I want to know how I can delete environment variables in Python so that I can no longer see them outside of the execution of the Python script (on Windows, in "Advanced System Settings/Environment Variables...") This is what I tried: os.unsetenv deleting entries in os.environ, but it …

Member Avatar for GDICommander
0
2K
Member Avatar for avatrin

How can I solve the following ODE numerically using Python and Euler's method: v' = 5 - 0.5v Also, can anybody recommend a good book or website where I can learn solving differential equations using Python?

Member Avatar for bumsfeld
0
167
Member Avatar for TrustyTony

Saw somebody was viewing this thread and thought the qrange needed one update. From post [url]http://www.daniweb.com/code/snippet216627.html[/url].

Member Avatar for TrustyTony
0
636
Member Avatar for Speleo

Hey all, I'm relatively new to python, just started learning it about a week ago. I've been working on making some small scripts to make learning easier for me. This is a cypher script I've been working on that is based off of the order of letters used on a …

Member Avatar for bumsfeld
0
271
Member Avatar for fugmag

Hi, I have set up pydev in eclipse from the download site, but when I try to add a new pydev project I get the following error i the new-project wizard: [CODE] .project found in C:\workspace(use import project) [/CODE] But I have no project called that in my workspace. I …

Member Avatar for fugmag
0
72
Member Avatar for Beat_Slayer

Simple script for image transparency. Someone asked one some time ago, and i had other but for a different system, and decided to write a Python/PIL version. The value of the color used as transparent is the value of the pixel at position (0, 0). You can adjust tolerance value. …

Member Avatar for gleam.uahmed
0
1K
Member Avatar for rssk

hi all.... i m running a program like... import os os.system('snmpwalk -v2c -c armk123 192.168.1.182 .1.3.6.1.4.1.18489.1.2.1.1>text') i want to write a program whether snmpwalk is running or not.... i m new to python and i m not getting any idea ,so plz help me

Member Avatar for rssk
0
55
Member Avatar for renacentia

[B]I am doing a mini project on traffic redundancy elimination methods as my mini project...i want to know how to monitor and find repetitive http requests traverse through a pc acting as aproxy server (eg: like a no: of laptops connected to a single lap acting as a proxy server) …

0
92
Member Avatar for Alex.

Hi, I have a problem where i need the format of data in a saved file to be seperated by a new line. my code at present: [CODE]import re import nltk #subset filename = 'subsetQuran.txt' # create list of lower case words word_list = re.split('\s+', file(filename).read().lower()) print 'Words in text:', …

Member Avatar for richieking
0
102
Member Avatar for tcl76

hi, i have a function that returns a string. For eg: 11111 or 11011. 1 is Pass and 0 is Fail. i want my code to scan the string from right to left side and also look for 0 and indicate its location. Below is my code. But i'm having …

Member Avatar for TrustyTony
0
140
Member Avatar for TrustyTony

Here is my newest version of the pretty printer I posted earlier. Not doing all that fancy stuff of printing looped recursive structures, but if you put one deeper structure inside flat one, works better for me than pprint module. I do not use often object oriented structures though. Dedicated …

0
662

The End.