15,181 Topics

Member Avatar for
Member Avatar for ngurjar

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 …

Member Avatar for sneekula
0
142
Member Avatar for R.S.Chourasia

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 …

Member Avatar for TrustyTony
0
6K
Member Avatar for crazy99

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 …

Member Avatar for crazy99
0
364
Member Avatar for MegaMan15

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 …

Member Avatar for TrustyTony
0
219
Member Avatar for zaatlob

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 …

Member Avatar for vegaseat
0
249
Member Avatar for ozzyx123

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 …

Member Avatar for TrustyTony
0
872
Member Avatar for Vkitor

Hi! I'm working on program with a lot of buttons and I would like to use For loop to make all of them instead of writing every each one of them. so, can anybody help me? here is example of code [CODE] import tkinter as tk def klik_1(): button1.config(image=s1) def …

Member Avatar for Gribouillis
0
23K
Member Avatar for hondros

Okay, so I am creating a battleship game, I posted a thread here earlier to figure out how to place the ships, but know I'm back, because I am curious as to how I should program the AI for it. Here's my base code now, and I'll explain how the …

Member Avatar for woooee
0
2K
Member Avatar for layneb131

[CODE] startup = 0 r = rock p = paper s = scissors if startup == 0: weapon = str(input("Please enter your weapon: Rock, Paper, or Scicors") while weapon =! r: print("Incorrect choice, please choose again")[/CODE] Im running python 3.2.2. Im trying to make rock paper scissors. I am trying …

Member Avatar for layneb131
0
195
Member Avatar for moroccanplaya

i got a working highlight code example that works in python 2.7.2 [CODE] import Tkinter """ Edit a file and save the text. """ textFont1 = ("Courier New", 16, "normal") class ScrollbarX(Tkinter.Scrollbar): def set(self, low, high): if float(low) <= 0.0 and float(high) >= 1.0: self.grid_remove() else: self.grid() Tkinter.Scrollbar.set(self, low, high) …

Member Avatar for moroccanplaya
0
159
Member Avatar for straylight

Title says it all. I am looking for a way to find the values of a column within a row. I am unsuccessful at being about to create a for loop that searches each value in the row and inputs a value if it is x. For example: [CODE] there …

Member Avatar for woooee
0
167
Member Avatar for jone kim

Here is the problem: a function that takes two strings and removes from the first string any character that appears in the second string. eg. if the first string is “[B]IamLearningPython[/B]” and the second string is “[B]aeiou[/B]” the result is “[B]mLrnngPythn[/B]”. I've written the code for this, but I can …

Member Avatar for TrustyTony
0
200
Member Avatar for arindam31

Hi, I have the a situation here . My motive : Hiding one panel and showing another. Whats Working :Layout wise , my app is behaving like i want it to . The Problem : After the I hide one panel and show another , the button in this panel …

Member Avatar for arindam31
0
191
Member Avatar for KatseasSAvvas

Hi, I'm trying to find a way to solve this equation with two unknowns using Python: [QUOTE](a * b) = (x * c) + (y * d) + e [/QUOTE] Where a, b, c, d and e are all floating numbers provided by the user and x and y are …

Member Avatar for TrustyTony
0
280
Member Avatar for woodenduck

Hey all I need some help with Jython. In Python I'm given the easy option to read a file with [CODE]file = open('/dev/input/js0')[/CODE] Then I can put it into a non blocking mode with something similar to [CODE] import os, fcntl file = os.open('/dev/input/js0', os.O_NONBLOCK) [/CODE] But in Jython I'm …

0
218
Member Avatar for minimee120

Okay, so for some practice problems from a friend, he asked me to take some previous code, and define a function called parseName? I'm not familiar at all with what it is/does. The objective he gave me was to use this parseName function and to return the firstname, middlename, and …

Member Avatar for minimee120
0
163
Member Avatar for apeiron27

apparently my data is too big to be split at every newline.. any idea how to split every 4th newlien?

Member Avatar for woooee
0
96
Member Avatar for bebedjou

Hello, I need your help to get my Python program running please. Thank you so much. This is the assignment: Highway Robbery! Use skills learned in Units 1 - 4 and include: • input functions, calculation functions and output functions • passing variables between functions • elif statement (if/else for …

Member Avatar for woooee
0
2K
Member Avatar for paul.hahn

Hi, I have several tkinter entries created within a loop, where users input numbers. I wish to create a reset button to set all entries to zero. On the following code the reset button will just reset the last entry. How is possible to call each of the entry and …

Member Avatar for paul.hahn
0
10K
Member Avatar for ihatehippies

I'm doing some research to determine the most efficient way to copy files. I've got 3 candidate functions: #1 [CODE=python] # uses generator to load segments to memory def copy(src, dst, iteration=1000): for x in xrange(iteration): def _write(filesrc, filedst): filegen = iter(lambda: filesrc.read(16384),"") try: while True: filedst.write(filegen.next()) except StopIteration: pass …

Member Avatar for ihatehippies
0
6K
Member Avatar for KatseasSAvvas

I'd like to ask the user if he/she wants to rerun a script. I've thought of doing that with a while. My problem is that both [CODE] import sys rerun = "y" while rerun == "n": sys.exit() else: print("do some stuff") rerun = str(input("Would you like to start again? [y/n]: …

Member Avatar for KatseasSAvvas
0
2K
Member Avatar for unigrad101

Write a function named walkingMan() that simulates a person walking a specified distance, taking steps of varying length. The length of the steps varies at random within a specified range. (Use the function in the Python random module, random.randint(a, b), which returns a random integer N such that a <= …

Member Avatar for slate
0
127
Member Avatar for xopenex

Hi guys, converting .ui to .py to .exe using Qt Designer (PyQt4), Python 2.7, and py2exe Ive been able to do this with Tkinter gui's but having problems with gui's from Qt Designer? First error was due to missing msvcp90.dll which ive downloaded and copied into the python dll directory, …

Member Avatar for xopenex
0
1K
Member Avatar for xopenex

Hello Everyone! So ive done some searching and havent been able to find what i need. Partly because i'm not sure exactly what words i should be googling! I am wanting to download gmail emails, and then display them in a spreadsheet like format. I know that emails have unique …

Member Avatar for xopenex
0
206
Member Avatar for HoneyBadger

Guys I installed mySQLdb in Ubuntu with: [CODE]mydeskt@mydeskt-desktop:~$ sudo apt-get install python-mysqldb[/CODE] but when I go to the python interpreter and type: [CODE]>>> import mySQLdb [/CODE]I get: [CODE] Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named mySQLdb [/CODE]It is installed though, because when …

Member Avatar for HoneyBadger
0
180
Member Avatar for roe1and

I'm just going to put this out there. I was asked to create a spreadsheet with data extracted from MARC records. I have looked at pymarc and cannot get this to work. To be honest I'd rather do this myself and lean something in the process. I have another similar …

Member Avatar for woooee
0
299
Member Avatar for Bungie

For My basic programming are using python. I want to create a game called rocket race where two rockets are racing side by side dodging meteroids. I just need some help knowing where to start. I made the rockets and the meteroids in paint already. So could you give me …

Member Avatar for slate
0
165
Member Avatar for 4evrmrepylrning

I have been asked to look into getting a web framework up and running here at work. I come from a PHP background and have developed a few tools various people use around the office. I have recently become part of a small team of developers who only use Python, …

0
112
Member Avatar for Matjame

Hi team. I am battling to convert a string to date. I currently manually pass a string date to my program(cobdate = string.replace(sys.argv[1], '-', '')) which will be used by a lot of things. The date will be in this format. "2012-02-02". I need to convert this to a proper …

Member Avatar for Matjame
0
709
Member Avatar for ohblahitsme

Hey everyone, I'm trying work on a text based game and I'm a little stuck with navigating the rooms. So let's say I'm in a room with another room to the north, east, south, and west. I wanted to create a "navigation" function which takes four parameters, which are the …

Member Avatar for woooee
0
166

The End.