15,185 Topics
| |
[CODE]tomorse ={ 'A': '.-', 'a': '.-', 'B': '-...', 'b': '-...', 'C': '-.-.', 'c': '-.-.', 'D': '-..', 'd': '-..', 'E': '.', 'e': '.', 'F': '..-.', 'f': '..-.', 'G': '--.', 'g': '--.', 'H': '....', 'h': '....', 'I': '..', 'i': '..', 'J': '.---', 'j': '.---', 'K': '-.-', 'k': '-.-', 'L': '.-..', 'l': '.-..', … | |
Good day everyone, I need to print data using if-elif statement. I when I run this code like this, everything went well [CODE] if row['username'] == 'mutago': print " okay" sys.exit(0) else: print "wrong" [/CODE] OKAY now i want to include elseif statement to print another data but it returns … | |
Hey, So I am completely new to python, I was wondering if someone could assist me with this program I am trying to make, The idea is simple, a program that counts for the user. Asking the user to enter a starting number, ending number, and the amount to count … | |
Is their any way to make an exe from my python files other that py2exe as am getting some problem.And for the same is their any method for linux also. | |
hello everybody , good day , i just need to insert an image : "BosqueTK.jpg" in a speciale place in my window Tkinter using .place(x= , y= ) , for this i created a frame f2 placed like : [CODE]f2.place(x=130 , y=213) [/CODE] , and want to insert in it … | |
Hi Guys, I'm new to python - how to execute dos2unix from python - subprocess.popen with shell = False ? >>> cmd = subprocess.Popen(["dos2unix","./FEED1/bin/*"], stdout=subprocess.PIPE) dos2unix: converting file ./FEED1/bin/* to UNIX format ... >>> dos2unix: problems converting file ./FEED1/bin/* All help appreciated. | |
Hi, We are a team of 3 people. We have not worked on Python before.We want to learn python & also develop a small project or software using python,c,shell scripts in LINUX environment. Could someone help us or give information on websites of the projects that we can develop? | |
Im working on my final project for school where i have to uses arrays to store the first year of energy costs, the second array will store the second year after going green, and the third array will store the difference. I have pretty much all the code written out … | |
Hello, im currently taking a python programming class at my high school and we have an assignment to create a falling sand type game using pygame. im totally lost on how to start could someone please help me get started. if you dont know what the falling sand game is … | |
Hello, i'm new to this forum and to Python and i want to creat a function that counts the number of words on .txt file, but also that creats a dictionary with it, with the words has a key and the number of referencies to it has a value. Thanks … | |
Hi, I have a large file (11 GB), that I want to extract information from. I decided that the file was to big to work with, so I ended up with splitting it into 20 smaller files. Now I don't know what the smartest thing is to do with these … | |
This is python code and I am new to programming and I can't get just the first word of the sentence to capitalize. [CODE] def main(): input= 'the money is in the bag. however you dont want it.' words = input.split('.') capitalized_words = [] for word in words: word=word.strip() title_case_word … | |
Hey guys, Is it possible to change the color of characters in a list if they do/dont meet certain conditions? So here's my code: [CODE]def checkWord(real, guess, remReal, remGuess, wrongSpot): # Format the letters so user knows whats wrong/right fullWord= real # Create copy list of real word realWord= list(fullWord) … | |
I would like to know how to use [ICODE]system("pause")[/ICODE]from C++ in Python 2.7 to get similar effect. Could you help me? | |
[code] from urllib import urlretrieve import urllib2 import re import gzip urlretrieve('http://www.locationary.com/place/en/US/Virginia/Richmond-page28/?ACTION_TOKEN=NumericAction', 'myfile') page = gzip.open('myfile', 'rb').read() findLoc = re.compile('http://www\.locationary\.com/place/en/US/Virginia/Richmond/.{1,100}\.jsp') findLocL = re.findall(findLoc,page) listIterator = [] listIterator[:] = range (0,25) for i in listIterator: urlretrieve(i, 'myfile2') page2 = gzip.open('myfile2', 'rb').read() findYP = re.compile('http://www\.yellowpages\.com.{1,100}\d{1,100}') findYPL = re.findall(findYP,page2) listIterator2 = [] listIterator2[:] … | |
I am trying to use Beautiful Soup to scrape a website, Locationary.com, and get some information from it. I am a member and even when I'm logged in this doesn't work... OK. This first bit of code just returns the HTML of Locationary.com (the home page) in a "pretty" form. … | |
I'm currently working in another thread to find a better conversion method here's my script: [code] #!BPY """ Name: 'Brawl (.mdl0)...' Blender: 248 Group: 'Import' Tooltip: 'Import a Brawl model file (.mdl0)' """ __author__= ['Tcll'] __url__ = ("") __version__= '0.015' __bpydoc__= '''\ mdl0 Importer ''' # ***** BEGIN GPL LICENSE … | |
Good day everyone, i need to display image from the database but the code returns error page when i tried to print image from the database using [CODE] print fout [/CODE] below is the entire codes [CODE] #! /data/python import MySQLdb import sys print ("Content-type: image/jpeg"); print # End of … | |
Hi, Basically I want to put my responses for each of the outputs of my loop (answers yes or no to different contrast numbers) into an empty list ... so I would have a list for each contrast corresponding to how many yes or no's there were? [CODE]from observerClass import … | |
I need to write a recursive Python function that takes a numeric list as its argument, finds and returns the minimum of its elements. I am not allowed to use min() function of Python. I'll be very grateful if someone can help me. | |
Hello Having trouble reading in some 8-bit data (not text) from serial port using pyserial module. Am storing the data in a string buffer as it comes in, that's working fine. Problem is that I'm printing the buffer out to the terminal screen, after a wee bit of data (30~200 … | |
So, I have a two part question for you... I'm going to be writing several lines of code to a .txt file, but I won't know what each line is, or how many there will be. There could easily be hundreds of lines. I need to add a prefix to … | |
Hi Guys , this questioned has been asked before , but the answers haven helped me . I want to seperate lines when i am appending the text control. But "\n" is simply not working . I am using Python 2.7 , on Windows 7. Please help. I want to … | |
Python does not have a type like struct in C or record in Pascal, but it can be easily implemented with a class. This little code snippet shows you how to do it. | |
I have to create a simulation to repeatedly play the Monty Hall game. I've created a class. This is what I have so far. I have created the buttons, activated them, deactivated the stay and quit buttons. I have a button class that is used to activate and deactivate buttons … | |
I couldn't find a meaningful code sample for the wxPython slider (wx.Slider), so I concocted this one and added a few explanations. It explores two different sliders, one is horizontal, the other vertical. The slider events are then fed to a function that retrieves the position values and displays them … | |
I need to read a file that contains this: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 … | |
So after a lot of work I got functions to compare one word with another one. Now my problem is formatting the output. I have one function that locates letters int he wrong position, one that finds matching letters and one to compare the results in order to format the … | |
I am working on a program that uses a recursive function to print the digits of a number in English (i.e. 456 would display "Four Five Six".) Right now I am beyond confused and I don't have much code to show for the hour and a half of work I've … | |
Hi, I have created a checkbutton within a dialog box. But, I am not able to capture the value of the checkbutton. The value always seems to be 0 whether checked or not. [CODE] class MyDialog: def __init__(self,parent): self.Frame1= Tix.Frame(parent) self.Frame1.pack(side=Tix.LEFT, fill=Tix.BOTH) self.enabled = Tix.IntVar() self.checkbutton = Tix.Checkbutton(self.Frame1,text = "Enable … |
The End.