15,175 Topics
| |
Hello , I am trying to implement this function: def getGuessedWord(theword, wordlist): for letter in theword: if letter in wordlist: print letter, else: print '_', For example: theword = 'hi' wordlist = ['e', 'i', 'o', 's'] must return : _i but it returns : _iNone I tried : for letter … | |
| In the parent directory O, I have a series of directories Aa, where a varies from 0-1. In each of these I have a series of directories Bb, where b varies from 0-1. In each of these there are the input/output files AaBbCc.dat and AaBbCc.out for some calculations [c also … |
I create reports by means of RML(XML) and parse to PDF (use pyjon.reports). In output pdf polish char not display my xml file <?xml version="1.0" encoding="utf-8" standalone="no" ?> <!DOCTYPE document SYSTEM "rml.dtd"> <document filename="encoding-test-utf8.pdf"> <template> <pageTemplate id="main"> <frame id="first" x1="72" y1="72" width="451" height="698"/> </pageTemplate> </template> <stylesheet> </stylesheet> <story> <title>Test of … | |
Hey guys, I need assistance with my program need to write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 100. The application should let the user specify how many random numbers the file will hold. … | |
I am trying to extract blogs related to economy using the RSS feeds in python. I have no idea how to get a specific number of blogs and how to get those blogs in a particular domain (like economy). My project requires analysing these blogs using NLP techniques, but I'm … | |
Hello to all! I've made this script the other day, and I need some input from you telling me how could I improve the code / style. There aren't problems with the code (it does the job) but I want it more organized and "simple" so that in 1 week … | |
I am writing a GUI flow using wxPython which has 4 pages (or more). They way I have approached is creating 4 (or more) classes with each class defining its own static (background) and dynamic images / content. In my application I would then programmatically create instances class required and … | |
Hey fellow programmers.Im a new python programmer.Only been learning for about 2 weeks.Below is a code I wrote this weekend.It is a simple text adventure.tell me what you think of it.Feel free to copy and paste it into python and run it yourselves.I'm open to suggestions. #Text adventure v 2.0 … | |
I have already made a post on how to open a JPG file but I now plan to use GIF image files. Can someone show me a sample code example on how to open GIF image files whenever you click buttons on TKinter GUI in Python? Thanks. | |
So I decided to learn Python as my first programming language... So far I kinda like Python(when i say so far, I mean just now i started it just now), I'm using www.codeacademy.com as a tutorial(more on studying the basics first) and so I'm just wondering will I be able … | |
I was wondering if somebody could explain this to me. I am trying to find numbers that are NOT divisible by other numbers. Originally i wrote: if i%3!==0 however it came up with an error and said it was invalid syntax Instead my code now reads if i%3!=0 This works … | |
So my code to test a prime number is as follows: PrimeTest(): test = input ( "What number would you like to test? " ) test = int(test) true = 0 divisor = 0 for divisor in range (2, 10): if ( (isinstance( test/divisor, int )== True) & (test/divisor == … | |
while(Truth): guesschar = input("Guess: ") if(guesschar == Word): break elif(len(guesschar) != 1): print("You can only guess one character at a time or the correct answer") else: Truth = False | |
Having trouble getting pyhon to repeat things for me. What I wanted to test was python's random.sample. So say I have a list myList = range(1, 15) I can for a single time do this import random >>> myList = range(1,15) >>> random.sample(myList, 3) [10, 6, 11] >>> I would … | |
Hi, I am new to writing code and am doing a programming assignment for a class that has to be separated into different functions. I figured most of it out, but can't seem to get the validation part to work at all. could someone with more experience than me please … | |
Hello everybody. I recently started a python temperature conversion program and seem to be stuck. Im fairly new so I tried several things such as a fuction to convert temperature and and if and else statement and both combined. My code lets me input a temperature but then doesn't convert … | |
Hello. I am trying to make a program that involves buttons from GUI and I need help on how to open a JPG image file from a button click. Can someone show me a sample code on what to do and a brief explanation on what to do? Thanks. | |
| I'm trying to make a program that scrambles the order of sentences. The program must take an input file and scramble it into an output file however, when the sentences are scrambled, they should be numbered according to their original order. For example, I love apples --------> 2. I love … |
I am working on INFORMIX 4GL programs. That programs produce output text files.This is an example of the output: Lot No|Purchaser name|Billing|Payment|Deposit|Balance| J1006|JAUHARI BIN HAMIDI|5285.05|4923.25|0.00|361.80| J1007|LEE, CHIA-JUI AKA LEE, ANDREW J. R.|5366.15|5313.70|0.00|52.45| J1008|NAZRIN ANEEZA BINTI NAZARUDDIN|5669.55|5365.30|0.00|304.25| J1009|YAZID LUTFI BIN AHMAD LUTFI|3180.05|3022.30|0.00|157.75| Hi all,now I'm already can convert text files to … | |
Hello , I have the following code: count = 0 phrase = "hello, world" for iteration in range(5): index = 0 while index < len(phrase): count += 1 index += 1 print "index: " +str(index) print "Iteration " + str(iteration) + "; count is: " + str(count) I can't understand … | |
I'm writing a program that is going to be used for encryption. It can only encrypt 64 letters at a time. How can I make a check for that using len()? | |
Is there any way to start an application with python and count how much time does it take to completely load, any idea if I can do it with os.syste, or subprocess.Popen ? | |
I really would like to write a Texting app for computers. Is there a way to do this in python? | |
Hello, everyone. I am taking a beginning python class and was wondering if anyone could help me out? We are writing a program that generates 100 random numbers (between 1 and 1000), and keeps a count of how many of those random numbers are even and how many are odd. … | |
Sorry, I posted this in software development not python. How do i make an auto-incrementing column? Heres my pseudocode/sql attempt c.execute('''CREATE TABLE <tableName> ( <columnName> <auto incrementing??!!>, <columnName2> text, <columnName3> text, <columnName4> text ) ''') | |
I have the following web crawler code and would like to add a limit as to the depth of the search but unsure how to implement this. import urllib2 def getAllNewLinksOnPage(page,prevLinks): response = urllib2.urlopen(page) html = response.read() links,pos,allFound=[],0,False while not allFound: aTag=html.find("<a href=",pos) if aTag>-1: href=html.find('"',aTag+1) endHref=html.find('"',href+1) url=html[href+1:endHref] if url[:7]=="http://": … | |
Why is this stacking ontop of each other, as far as the index should get each of them to next row. data1 = {'PHOTOSHOP': '6.5', 'NUKE': '7.0v9', 'MAYA': '2014', 'TESTING': '1.28', 'KATANA': '1.7', 'MARI': '4.0'} data2 = {'PHOTOSHOP': '10.5', 'NUKE': '6.3v6', 'MAYA': '2012', 'TESTING': '1.28', 'KATANA': '1.0', 'MARI': '1.0'} class … | |
Write an algorithm and draw a flowchart to print the square of all numbers from LOW to HIGH. Test with LOW=1 and HIGH=10. | |
How do i make an auto-incrementing column? Heres my pseudocode/sql attempt How do you make an auto-incrementing ID for a record c.execute('''CREATE TABLE <tableName> ( <columnName> <aut incrementing??!!>, <columnName2> text, <columnName3> text, <columnName4> text ) ''') | |
not working. I am using python 3.3.2. please and thank you. import urllib u = urllib.request('http://www.ctabustracker.com/bustime/map/getBusesForRoute.jsp?route=22') info = u.read() f = open('rt22.xml', 'wb') f.write(info) f.close() |
The End.