15,179 Topics
| |
Does anyone know how to use the subprocess.call to assign the ouput of a command to a string. At the moment it only assigns the return code ?? [CODE]>>> hostname = call(["hostname", "-d"]) lon3.corp.rackspace.com >>> print hostname 0[/CODE] Thanks, | |
By coding algorithm and using some liberal prints with small set of data, you can learn to understand the basic algorithms better than just reading about them. Here simple selection sort. | |
Hey, I just started programming but im stuck. so lets say I have a wordlist with words containing 2-12 letters and I want to remove all words containing less than 3 letters or more than 7 letters. How would i do that? Another problem I have is, I want to … | |
I wrote this 3D Breakout game as a sample project to learn both Python and the visual module, vPython. It is based on a similar game I had on my Amiga back in the 80s. I don't expect that my Python is either standard or as elegant as it could … | |
How about doing some effort instead of immediately voicing your desperation to Daniweb for 1001st tictactoe problem? Here is some ideas for those young spirits (I did not say newbies ;) ) 1. What is this search box here over in right hand corner? 2. What a heck is this … | |
I'm new to python and I'm trying to write a selection sort code starting with the last digit and eventually working its way to the first but I'm getting an error that the index is out of range... anyone know what's wrong with my code? inputfilename = raw_input("What is the … | |
I hate to complain, but I'm not terribly impressed at the documentation for utilizing binding, it covers quite a bit but not common stuff, or maybe I'm just missing it. I was wondering how I could make the <RETURN> key equivalent to a <BUTTON1> click when a button is highlighted … | |
[B]What I want on the first run thru[/B] is to ask for input, print input, ask for 2nd input, print 2nd input. End the first run, saving inputs to text file. My results are: input 1 input 1 again. input 2 input 2 again. On the 2nd time thru, it … | |
I want to create a function or a class method that will create a dictionary named by a variable that is passed in. By way of example, I'm creating a class method to read data from a table (in this case it's an ArcGIS table, but that's not critical) and … | |
Some system info before proceeding further: Platform: Mac OS X 10.7.1 Python Version: ActiveState Python 2.7.1 wxPython Version: [url=http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.2.1-cocoa-py2.7.dmg]wxPython2.9-osx-cocoa-py2.7[/url] I want the button label to be changed while performing a task So, here is what I did/want: [code]self.run_button=wx.Button(self.panel,ID_RUN_BUTTON,label='Install') self.Bind(wx.EVT_BUTTON, self.OnRun,id=ID_RUN_BUTTON) def OnRun(self,evt): self.run_button.SetLabel('Installing..') #call a function that does the installation … | |
Hello, here is a thing, i'm beginner at wxPython ant Pyhton too. I have written small program here is a example: [CODE]import wx import urllib2 import re class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, size=(600,400)) self.panel=wx.Panel(self) self.areaa = wx.TextCtrl(self.panel, pos=(0,10), size=(400, 20)) self.area = wx.TextCtrl(self.panel, style = … | |
I was just wondering if anybody has any ideas on how I could allow a users input to be disguised on the screen when they're entering their passwords (such as the case about everywhere on the internet) i.e. gmail's black dots in place of the actual text of a password. … | |
Hey guys! I started learning Python 3 four days ago and I wrote a little command line RSS Reader (~120 lines) using the [URL="http://feedparser.org/"]feedparser module[/URL]. The rss reader currently has a menu, and also receives command line arguments (run the script with "-h" or "--help" for more info). It has … | |
i am new to python and am working on a simple code for a project. I am to end up with and output that says: "Please enter your name: Bubba" I am to use [CODE]name = input("Please enter your name:")[/CODE] However, when I input the name "Bubba" the project says … | |
Hello there, i'm writing a program (pharmacy gestion), for my dad's pharmacy and i want to set a password when loging in to the program and have the ability to change it any time ... [B]BUT THE PROBLEM IS[/B] ... i thinkd to store the password in a text file … | |
My code is suppose to take the digits i type in my raw_input and sum up the number example: if i type 123456789 then i will get 1+2+3+4+5+6+7+8+9 = 45 as an answer but it will not stop there it will continue adding until the sum reaches a single digit … | |
Hello friends i am new on DaniWeb and new in Python... I have a few problems so i need help... I have a text document with a code from some web page, how can i extract some string between a two different strings in line and then that stings write … | |
I'm trying to figure out how to deal with multiple matches in my address book, say the user has two people by the name of Bob; one is Bob Lastname and the other is Bob Namelast, how would you approach dealing with telling them to specify, and then allowing them … | |
Hello, I'm learning Python. It is my first interpreted language. I have some experience with C and C++. I must admit that it's very hard for me to accept a concept of interpreted language. For example I write code in C++, compile it, link it and I have .exe file … | |
I got my code to check for how many digits that i type in my raw input [CODE]num = int(raw_input("Enter, ")) import math digits = int(math.log10(num))+1 print digits [/CODE] example 1587898 then it prints 7 digits I need my code to calculate the digits i type in my raw input … | |
I scripting chating program in python... And i'm on chating program scripting auth with mysql. But no know how to script authentication on python-mysql. How to script chat auth program for chat with python-mysql. -- Sorry with English language. | |
Very trivial program which could be thought as conclusion from the Quiz posts (thanks Gribouillis for inspiration for format) | |
Hello, I am trying to do a simple word count of a text file and output it to a text file. For eg my array looks like this: word_freq = [('test', 1), ('of', 1), ('function', 1), ('first', 1), ('the', 2)] I was able to output to a text file in … | |
I am trying to count the number of hits a value in one file(column) falls between an interval from another file (two columns). I am completely stuck on how to map it. I tried something like this: for line in file1: if line[0]=line2[0] and line2[1]<line[1]<line2[2]: print line I'm not sure … | |
I am trying to work on some code for updating google docs using the python gdata api's. The code works perfectly fine when i try to run the code in a cafe internet or home network without my proxy. When i have to deploy the code in my workplace - … | |
There was question about encryption in Delphi/Pascal forum and a guy was suggested reversing the bits as additional step (I do not know if he in reality meant XOR 255, that is making 0's 1's and vice versa). As it keeps still same distribution of letters I suggested as better … | |
hello i am a beginner python developer and i am search about python projects for beginners for i learn and know how can i make program in python and thanks | |
I'm trying to using Try, Except to check an input() to make sure it's not blank. I'm using it at a different part of my program to check a float(input()) and it catches it if someone leaves it blank or enters a string, but I assume that's because it's checking … | |
I need to run several commands more than 400 times for a mass number of files. Therefore, I'm trying to incorporate the commands in to a python script to automate the processes. Even though the commands run successfully in the the windows command prompt (I have manually tested the commands), … | |
Dig up this for discussion thread request and some Googling. By little experiment found the different forms for sending message commands. Could no send in Python3 the code of program itself so only simple test "Hello". Sorry that subject is left incorrectly refering program name. |
The End.