15,175 Topics
| |
I need to write a script that will check a file and find out what type of file it is. The files I am downloading none of them have extensions and some are binary others txt and html files. I only want to work with the binary files. If anyone … | |
Hey guys, I've looked over several Google results for basic explanations on [CODE]is / '=='[/CODE] However, I don't think I quite understand enough to know what is the ideal operator for this. [CODE]mylist=[1,2,3] if type(mylist) == list: print 'yes'[/CODE] or do I use [CODE] if type(mylise) is list: print 'yes'[/CODE] … | |
Hi guys, still Noob here, so i apologize for not using the correct terminology. I will be as detailed and accurate as possible! I've been using QT Designer, and been trying to figure out how to "combine" the GUI ive created with the python script I wrote before making a … | |
Hello, I'm new to python and have a requirement to decompress various NRV2B compressed files. I have the python functions for performing this decompression, however I am unsure how to get it working. I have tried making this a module, importing it and then feeding my compressed files as a … | |
Ok so me and my friend are doing a weekend challenge... Whoever makes the best game wins. Im trying to make a game like farmville but its called mineville and its just a little different. My problem is that theres this part in the code that keeps repeating, and i … | |
When I run my python scripts I generally run with the console open just to keep an eye on things. I have a script that calls 3 external command line apps one after the other. On one pc all output from these apps appears in the console window and is … | |
hi. i am trying to use two turtles in separate windows simultaneously in python but nothing found yet. i have tried multithreadding but still the same. can somebody help me please. thanks. | |
I have never taken a programing class before but my instuctor wants me to write a program in python i've been looking in the book and still don't even know where to start please any help would be great here's the program she wants You are helping your friend throw … | |
can anyone explain tkinter in object oriented style where you would have it in a class ? | |
how would you write this function in non oop [CODE] def highlight(self, seq): if "highlight" in self.textWidget.tag_names(): self.textWidget.tag_delete("highlight") i = len(seq) idx = "1.0" while True: idx = self.textWidget.search(seq, idx, nocase=1, stopindex='end') if idx: idx2 = self.textWidget.index("%s+%dc" % (idx, i)) self.textWidget.tag_add("highlight", idx, idx2) self.textWidget.tag_config("highlight", background="yellow") idx = idx2 else: return … | |
Hi , i have a dump file . i want to load it into a dictionary. i am using pickle load to load it as shown below: pkl_file = open( r'D:\work\dumpfile.dat', 'rb+') FinalTable = {} FinalTable = pickle.load(pkl_file) The problem is it is loading only one key and value from … | |
I'm am trying to make just a simple text-based adventure game, inspired greatly by Zork. Basically all it is is an IF statement for many possible input so the player isn't constrained to inputting their text in a certain format. Then each section is it's own module so when the … | |
So im stuck writing a function and was hoping someone would be nice enough to help. My objective is to look at a list of grades such as: [CODE][23 , 64 ,74 , 53 , 55[/CODE] And return a list with the number of grades in each percentage range I.E. … | |
Hey guys, In prepping for a job interview, I'm trying to eliminate some bad habits and this trivial problem has me realizing how hard that is :'(. The problem: Print a 12 x 12 multiplication table. This is easy.... [CODE]outstring='' for i in range(1,13): for j in range(1,13): outstring +='\t'+str(i*j) … | |
I have a list: [CODE][a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p][/CODE] I would like 4 lists: [CODE][a, e, i, m] [b, f, j, n] [c, g, k, o] [d, h, l, p][/CODE] How would I go about this? Thanks. | |
I've followed a tutorial where a Person class was used to illustrate the difference between class and instance variables. Something like: [CODE] class Person(object): population=0 def __init__(self, name): self.name=name Person.population += 1 print 'current population', Person.population Sally=Person('sally') Joe=Person('joe') [/CODE] This example really illustrated the difference between class and instance variables … | |
hi friends . i have a sqlite program. i need get stuff data from QLineEdit and add to model & tableView . but i dont know what should I do :( plz help me | |
Sometimes, before optimizing your code, you may end up to have very slow running code in list comprehension statement. Because you have not yet tested the code fully, it easy to loose patience and just interrupt the code. If you are making function, you can insert print statements for verification. … | |
The objective is to have the user guess the letters of a word which has to be the name of an object that can be seen. The user is presented with an array of 26 buttons corresponding to the 26 letters of the alphabet. Additionally the user is presented with … | |
Hi friends, I want create a image Button by hovering mouse event as a pushbutton,how i to do? | |
I am trying to make a python that can remove any occurences of any word in stopwords from the wordlist, but I don't know what is exactly wrong with this program. Any suggestions? [code]STOPWORDS = ['a','able','about','across','after','all','almost','also','am','among', 'an','and','any','are','as','at','be','because','been','but','by','can', 'cannot','could','dear','did','do','does','either','else','ever','every', 'for','from','get','got','had','has','have','he','her','hers','him','his', 'how','however','i','if','in','into','is','it','its','just','least','let', 'like','likely','may','me','might','most','must','my','neither','no','nor', 'not','of','off','often','on','only','or','other','our','own','rather','said', 'say','says','she','should','since','so','some','than','that','the','their', 'them','then','there','these','they','this','tis','to','too','twas','us', 'wants','was','we','were','what','when','where','which','while','who', 'whom','why','will','with','would','yet','you','your'] def remove_stop_words(wordlist, stopwords=STOPWORDS): wordlist … | |
Hello, I and doing a ball bounce project for Vpython and I am trying run the program I wrote. I keep getting an invalid syntax error, but I am unable to find any. Please help. [CODE]from visual import* wallA = box(pos=vector(0,6,0), size=vector(12.1,0.2,12.1), color=color.red) wallB = box(pos=vector(0,-6,0), size=vector(12.1,0.2,12.1), color=color.green) wallC = … | |
I have selected several files with the open multiple files dialog: [CODE][[u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\chord.jpg'], [u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\toad1.jpeg', u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\21369.jpg', u'C:\\Documents and Settings\\Administrator\\My Documents\\My Pictures\\g2.jpg']][/CODE] I want to display the selected files in a nice user-friendly way. Just the filenames, each on a separate … | |
hi everyone i am very new to programming and really need some advice. i am currently building a program and one of the things i need is to be able to count the number of pages in pdf files in a directory. i found a script online which is suppose … | |
Hi, I work for NGO. I am the only software developer here. I want to develop few simple softwares for them as charity work. 1. Devnagri Font Software -They have ANSI Devnagri fonts. I need to create one Font Engine for them, so that they can do feeding or editing … | |
Hi, I have two list of any datatype supported by python. I want to check whether the any of the element of first list is present in second list or not. Example: I have a = [4,5,6] b = [1,3,8,6,7,9] I want to check whether any element of a is … | |
Hello Sorry if this is confusing I'm really new to python and have been stuck trying to figure this out for hours now. I'm trying to write a function for a text based battlship game. I need the function to do this is_occupied: (int, int, int, int, list of list … | |
Make a program that reads some text and produces as output the distribution of words that start with dierent letters. I recently wrote a program that would count how many times a certain letter would show up, but I am not sure how to look to see at the first … | |
I want to loop through directory and process the files in them. I do this with the following code. for (root, subdirectories, files) in os.walk(dirDialoog.GetPath()): for file in files: My problem is that the files processed 2 times. I tried the next code, but in that way the files weren't … | |
I need a program which counts the pages of all the pdf files in a directory. i found this scrpit which is supposet to do exactly that, but when i try to run it it just doesnt work for me it outputs nothing. i dont really know what to change … |
The End.