15,185 Topics

Member Avatar for
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
248
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
198
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
99
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
81
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
50
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
158
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
587
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
884
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
163
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
627
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
268
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
70
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
54
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
91
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
99
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
139
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
659
Member Avatar for DecreaseEntropy

I'm trying to make a QR encoder that takes a text file of URLs and names and generates QR bar codes with the URLs and names. Can anyone point me in the right direction?

Member Avatar for katmai539
0
172
Member Avatar for Tsai Ming-Li

Hi everyone! ^_^ I'm learning Python with "[URL="http://openbookproject.net/thinkcs/python/english2e/"]How to Think Like a Computer Scientist - Learning with Python 2nd Edition (Using Python 2.x)[/URL]". I'm trying to use GASP & Pygame to do the practice excercises, but once the program runs, the window just keeps freezing, and I get an error …

0
80
Member Avatar for rssk

hi all, f1 =['0.2' , '0.4','0.0'] f2 =['0.1','0.2','0.1'] f = f1 - f2 i need a output like f = [0.1,0.2,-0.1] but wen i run this program it is showing error like [B]TypeError: unsupported operand type(s) for -: 'list' and 'list' [/B] thanks in advance.........

Member Avatar for rssk
0
172
Member Avatar for acrocephalus

Hello! I am trying to read multiple files from a folder (for example, spect1.txt, spect2.txt, ...) and store each file in different python objects objects (i.e. spect1, spect2, ...). Up to now, I have this code, which reads the file and stores it in a different file [CODE]import sys,os path …

Member Avatar for richieking
0
152
Member Avatar for harmons4

I am very new to Python and scripting and am trying to write script to delete any point feature classes in my .gdb. I have found an example, but can't get it to run. Your help is greatly appreciated. [CODE] import arcpy arcpy.env.workspace = r"E:\GIS_255\Week5\Harmon_Wk5_GIS255\KingCounty.gdb" import string try: fcList = …

0
131
Member Avatar for mca3

:( hi, i am beginner in python and i am getting one error sql =cursor.execute("INSERT INTO main12 VALUES('self.temp','self.entry2')") sqlite3.IntegrityError: column num is not unique while entering two value from text box to my database main12 where i hav only 2 fields num and time .i first create tool.sqlite and then …

Member Avatar for richieking
0
74
Member Avatar for novice20

Hi, I have a for loop something like: [CODE]for n in range(no_of_rows): #--configuring ODU Op mode odu_op_mod=list1[n] odu_op_mode= odu_enum["%s"%odu_op_mod] if (odu_op_mod == 'blahblah'): #------------ elif(odu_op_mod == 'aaa'): #-------- elif(odu_op_mode =='xxx'): #----- elif(odu_op_mod == 'yyy'): #------------------- elif(odu_op_mod == 'zzz'): #------------- logging.info("*******************************************************************") subprocess.call(['python link_config_idu12.py %s'%addr],shell=True) [/CODE] I have different lists, list1 #for …

Member Avatar for novice20
0
3K
Member Avatar for akshayreddy

Write a Python script/program that reads an arbitrary file and build a concordance of the words in the file. The concordance should contain the line number on which the word first occurs as well as the number of times the word occurs in the file. The program needs to print …

Member Avatar for TrustyTony
0
246

The End.