15,181 Topics

Member Avatar for
Member Avatar for CodingCabbage

I'm programming a UI mock-up and need to make the window of fixed size and position. The lines of code for setting the size are as follows : widthOfScreen = mainGUI.winfo_screenwidth() #Get the width of the screen heightOfScreen = mainGUI.winfo_screenheight() #Get the height of the screen mainGUI.geometry("%dx%d+0+0" % (widthOfScreen, heightOfScreen)) …

0
94
Member Avatar for glao

Hello, my code works fine when I don't have white spaces but I can't make it work when the string has. I am trying sth like: def lengthR(mystring): count=0 if mystring=='': return 0 while (mystring!='') and (' ' not in mystring): mystring=mystring[0:-1] lengthR(mystring) count+=1 return count but it returns 0 …

Member Avatar for glao
0
191
Member Avatar for Prithiv_1

I have an openstack setup with ceilometer (polslter and notifier) installed. I am getting the required metrics like Storaeg_objects_incoming_bytes, storage_objects_size of swift in the metering tab. how ceilometer is getting these metrics.. what are the underlying components of swift which ceilometer api is communicating.. i am writing a python code …

Member Avatar for atul_3
0
243
Member Avatar for theUserMan

# Heading Here # Trying to add a webcam fee to a panel inside of my wxpython GUI. I have buttons on the left currently, and a black panel on the right. I'm confused as to how to add a webcam feed to that panel? here is the code being …

Member Avatar for ZZucker
0
473
Member Avatar for krystosan

It seems like the slotDirChanged is getting executed twice, becuase everything seems to be working fine, import datetime from PyQt4 import QtGui,QtCore from PyQt4.QtCore import pyqtSlot import sys import os class WatchFilesBin(QtGui.QMainWindow): def __init__(self, lookinpath=None): super(WatchFilesBin, self).__init__() self._filesBinPath = lookinpath createFilesBin(self._filesBinPath) self.filesList = os.listdir(self._filesBinPath) print self.filesList self.fileSysWatcher = QtCore.QFileSystemWatcher() def …

Member Avatar for krystosan
0
1,000
Member Avatar for Josias_1

Hello everyone i have an issue with this problem, the problem is i need to reset the count after every line in the file, i put a comment so you can see where i want to reset the count. The program is suppose to cut each line after every specified …

Member Avatar for TrustyTony
0
332
Member Avatar for glao

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 …

Member Avatar for glao
0
146
Member Avatar for Rebecca_2

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 …

Member Avatar for woooee
0
389
Member Avatar for kur3k

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 …

Member Avatar for shadia.mohamed.9_1
0
831
Member Avatar for LucyLogic

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. …

Member Avatar for LucyLogic
0
10K
Member Avatar for Remy the cook

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 …

Member Avatar for Remy the cook
0
2K
Member Avatar for Con7e

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 …

Member Avatar for Con7e
0
273
Member Avatar for Satya Prakash_1

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 …

0
239
Member Avatar for pythonnewbie16

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 …

Member Avatar for snippsat
0
394
Member Avatar for stevewilliams02

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.

Member Avatar for stevewilliams02
0
1K
Member Avatar for dark_falzar

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 …

Member Avatar for ryantroop
0
327
Member Avatar for bryann

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 …

Member Avatar for Lardmeister
0
113
Member Avatar for bnn678

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 == …

Member Avatar for bnn678
0
372
Member Avatar for DoomCarnage

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

Member Avatar for slate
0
117
Member Avatar for flebber

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 …

Member Avatar for flebber
0
221
Member Avatar for 12344321

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 …

Member Avatar for 12344321
0
171
Member Avatar for pythonnewbie16

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 …

Member Avatar for HiHe
0
903
Member Avatar for stevewilliams02

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.

Member Avatar for HiHe
0
324
Member Avatar for talat.zaitoun

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 …

Member Avatar for TrustyTony
0
134
Member Avatar for rahim_1

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 …

Member Avatar for rahim_1
0
9K
Member Avatar for glao

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 …

Member Avatar for glao
0
266
Member Avatar for Jacklittle01

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()?

Member Avatar for vegaseat
0
171
Member Avatar for krystosan

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 ?

Member Avatar for germ
0
274
Member Avatar for Jacklittle01

I really would like to write a Texting app for computers. Is there a way to do this in python?

Member Avatar for HiHe
0
64
Member Avatar for LucyLogic

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. …

Member Avatar for vegaseat
0
497

The End.