15,175 Topics
| |
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. >>> … | |
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 … | |
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? | |
Saw somebody was viewing this thread and thought the qrange needed one update. From post [url]http://www.daniweb.com/code/snippet216627.html[/url]. | |
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 … | |
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 … | |
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. … | |
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 | |
[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) … | |
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:', … | |
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 … | |
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 … | |
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? | |
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 … | |
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......... | |
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 … | |
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 = … | |
:( 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 … | |
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 … | |
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 … | |
Hi, Just started using python. I can run simple python programs from the terminal in OS X. It says python version 2.6.1. I wanted to try turtle. I copied some code I found from others on here and tried to run it, and ran into problems right away with things … | |
i know nothing about programming but started learning python yesterday, and have learned some basic things. my dad is a programmer and challenged me to write a program that would be like '20 Questions'. i started it using the few things i know, and i think the way i started … | |
I have been told by a number of people to use xpath instead of regex for some of my regex searches. What advantages does xpath provide over regex? I can't find a webpage that says that. Been through over 10 pages of search so far. | |
Hi I posted this on another thread but messed up the title (called it y2exe) and I want to make sure this gets found if someone can help. I'm using py2exe and pysnmp, and they seem to be incompatible, at least on the oneliner form I'm using. Pysnmp claims to … | |
Hi , I have 2 images and one on button and another one as a label i want that when label image comes on button so it show the transparent part of image , i have made this code but in this the transparent part is hide . Here is … | |
Hi, I got this code snippet with the following usage: [CODE] def main(): # sample usage manager = LoadManager() manager.msg = ('www.example.com', '/') manager.start(threads=5, interval=2, rampup=2) if __name__ == '__main__': main()[/CODE] Works fine,but i would like to supply the following arguments through command line: msg threads interval rampup Plz could … | |
hello can someone please advise as to how can i insert tab after every word while inputting it in a file? i have to read all the lines in a file. the file has tables. there are random spaces between the words. Output is to put this table to another … | |
Issue involves: python 2.7 pil pyopengl pyside In the midst of developing a small drawing test, I've run into a situation involving line computations. Currently the drawing test works, but only enables singular point drawing at the cursor position. [IMG]http://i246.photobucket.com/albums/gg94/Braschko/Forum%20Posts/Screenshot-1.png[/IMG] I've seen python interpretations of [URL="http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm"]Bresenham's line algorithm[/URL], which works … | |
Im building a database to hold files i am using anydbm and what i would like is something that does this: [CODE= Python] import Tkinter import anydbm import tkFileDialog file = tkFileDialog.askopenfile(parent=None,mode='rb',title='Choose a file') print file print str(file) db = anydbm.open("database", "c") # db["1"] = str(file) for file in files … | |
I have the code below and the exact same code works when its put outside the function but does not when its called as a function, and it seems the function is being called correctly because the print line works[CODE]import wx class DestroyButton(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, … |
The End.