15,181 Topics

Member Avatar for
Member Avatar for ppotter3

Hello! I am currently looking for some help or ideas in a specific area of Python programming. The project I am having problems with pertains to python print drivers, and printing in a Linux OS. I had originally wanted to find a way (if possible) to write a python print …

Member Avatar for ppotter3
0
335
Member Avatar for rslepoy

Hi, I'm using SAS regular expressions to read a large text file with numbers and characters, and may be up to 500 lines of text in the file. I would like to extract certain key words, specifically, weight quantaties and measures, i.e. kilos or lbs. Each line of text is …

Member Avatar for rslepoy
0
331
Member Avatar for the_azn_invasio

this is my code but i couldnt get phase 2 to print out can anyone help me please? thank you! [CODE] import sys import string NUM_ARGS = 3 GLOBALSTACK = [] TAG_STACK = [] # getFile() Gets a valid file name # Input: None # Output: fileName, the name of …

Member Avatar for woooee
0
289
Member Avatar for sneekula

I need a function that returns True or False if an integer n is a prime. Any 'high speed' thoughts?

Member Avatar for wallars
0
1K
Member Avatar for Gribouillis

This snippet defines a function walk() which generically performs a depth-first traversal of a tree, using preorder, inorder or postorder rules. Here, genericity means here that there are no hypotheses on what the tree nodes are or the implementation of the tree. Walk() only needs an arbitrary object used as …

Member Avatar for Gribouillis
2
1K
Member Avatar for AdampskiB

I'm attempting to create a number square when it's using a parameter. Whatever the user enters in the parameter it will display something like this (using 4 as an example): 4567 3456 2345 1234 I've come up this so far: [CODE]def numberedSquare(n): for a in range(n, 0, -1): print(a, end="\n") …

Member Avatar for techie1991
0
165
Member Avatar for Beary21

I'm trying to login to Valve's Steam website, but without any luck my 2 different scripts aren't working. Help please!? Any script I find on the web appears to be outdated. [CODE] import urllib, urllib2, cookielib, webbrowser data = urllib.urlencode({ 'action': 'doLogin', 'goto': '', 'steamAccountName': "****", 'steamPassword': "****", }) # …

0
200
Member Avatar for atwomey

Hello, I am new to Python with only a beginners class completed. I am trying to change code that I have already used to compare line segments. I now want to compare two different polyline shapefiles to eachother and export the intersections as a point shapefile. I'm having trouble understanding …

0
86
Member Avatar for daniel5126

Hello! I'm incredibly new to Python and I hope I'm not asking a dumb question. I also hope I can explain this clearly. 1. I have two lists that each give user activity in one column, and userID in the other. The two lists correspond to consecutive time periods of …

Member Avatar for TrustyTony
0
98
Member Avatar for next_tech

Hi Guys, I am making a board game, where there is a 3x3 grid and the user enters a row and column and it should put an x in that spot on the grid and ask for the user for another location, until they enter 0 to quit. Here is …

Member Avatar for woooee
0
110
Member Avatar for stefh

Hi everyone :) Title says it all... I'm trying to bind events to a wx.GenericDirCtrl. I've visited more than 20 web sites but i haven't found how to do it. I've tried different manners but it doesn't work as i expect it to. In some case my control is seen …

Member Avatar for stefh
0
622
Member Avatar for telmo96

Hey mates, it's me again. I'm trying to develop a small application, but I'm not sure how to put two icons in the same toolbar, probably theres another way of creating toolbars instead of "self.toolbar", I'm not sure. Check my code: [CODE]import sys from PyQt4 import QtGui class Routine(QtGui.QMainWindow): def …

0
89
Member Avatar for wkarl

i want to Display my QTableView insid QTextEdit ? can i do this thing ?? if i can how i can do it ?

0
86
Member Avatar for asong

Your task is to write a program that checks html files, (web pages) to determine whether the embedded XHTML tags are balanced. Balanced tags are necessary for the file to be a valid XHTML file as explained above. The first phase takes care of reading the file and finding all …

Member Avatar for asong
0
225
Member Avatar for mr.ch

basically here is a code, what the question asked to do is to create a graph in quickdraw using the data given to us. now the problem is when i run the program it gives me a few errors. i am new at this and any help would be appreciated. …

Member Avatar for mr.ch
0
105
Member Avatar for hovestar

I am a new programmer and I wanted to start by writing a Tic-tak-Toe program I have more to add but here it is so far. [CODE] import random board = """ 1 | 2 | 3 ---+---+--- 4 | 5 | 6 ---+---+--- 7 | 8 | 9 """; …

Member Avatar for TrustyTony
0
8K
Member Avatar for huntaz556

Hi everyone ! i havent posted in a while i guess i just took a break O.o But i am having a problem i designed a UI in qt designer and then did [CODE]pyuic4 -x backup.ui -o backup.py[/CODE] That worked perfectly i can execute it and i have a nice …

1
91
Member Avatar for AdampskiB

Hello again! I'm having trouble trying to double the value of my coordinates in my point. The object is to create a pair of eyes and their position is identified by clicking a point in the graphic window which would allocated the centre of the left eye, and the second …

Member Avatar for AdampskiB
0
236
Member Avatar for wkarl

hello everyone , i need to make a borders for my printing report and i need a function that move my logo into middle of my report at first line , how i can do these things in Qt4 ?? i write thia code using PyQt4 [CODE]QtCore.QObject.connect(self.pushButton_5,QtCore.SIGNAL(_fromUtf8("clicked()")),self.Delete) def Delete(self): self.printer …

Member Avatar for wkarl
0
192
Member Avatar for Number1000

Hi guys, thanks for any help offered. I am attempting to ask a user for a height and width value - which need to be integers between 5 and 10 for each (height and width) I also need the user to select 3 different colours, out of a predetermined list …

Member Avatar for WolfShield
0
140
Member Avatar for lawltman

So here's my code. What I want is for the player to move down, and while it's moving down, to cycle through images in the sequence (0, 1, 0, -1, 0...) but it doesn't do that. [CODE]import pygame, time pygame.init() Screen = pygame.display.set_mode((400, 400), 0, 32) pygame.display.set_caption('Walk around') GREEN = …

Member Avatar for DrakeMagi
0
242
Member Avatar for TrustyTony

I post here the code for histogram using the turtle graphics module, which I posted long time ago in discussion thread. For more special graphs there exist other fancier options, but this tkinter based routine can function in most standard installations of Python. Example data.txt, like mentioned in module docstring: …

0
2K
Member Avatar for vlady

Hello Guys! Can anybody help me with this code? So what I need? here is it: I want to fill out global variable "student_marks" with a grade for each student and keep it once is loaded. So it means without calling the function "def add_mark()" I will be able to …

Member Avatar for vlady
0
127
Member Avatar for lrh9

Hand evaluator for Texas Hold'em. If a "hand" has five or more cards, hand.rank will find the best five card hand the hand can form. Two hands can be compared using the comparison operators. The final hand can be gotten from the "hand" with hand.rank.hand. The value used for comparisons …

Member Avatar for lrh9
0
1K
Member Avatar for AdampskiB

Hello there, Currently doing some work for my coursework. I've noticed the "\n" is obviously the new line function or whatever you guys call it, but would you understand what I mean when I say it creates too much of a new line? For example, I want the newline to …

Member Avatar for AdampskiB
0
115
Member Avatar for s00pahFr0g

Hello everyone, I did have a look around with search option to see if I could get an answer their, but I couldn't quite find my issue(at least I don't think I did). This is for a final project for school where I have to create a class for a …

Member Avatar for TrustyTony
0
304
Member Avatar for Flames91

Hey all, I'm trying to write a Polynomial Class but I'm having some trouble. I'm having the coefficients and exponents stored in a dictionary, like so... [CODE] class Polynomial: def __init__(self, *termpairs): self.termdict = dict(termpairs) print (self.termdict) if __name__ == '__main__': d1 = Polynomial((2,3), (4,5), (8,9)) print (d1) [/CODE] This …

Member Avatar for TrustyTony
0
509
Member Avatar for arindam31

Hi Guys, I am trying to make a text box that will accept a password from user.The password should be masked while typing. [CODE]def MyFunc2(self,event): box2=wx.TextEntryDialog(None,"Enter Password","PASSWORD","Waiting",style=wx.TE_PASSWORD) if box2.ShowModal()==wx.ID_OK: global pwd1 pwd1=box2.GetValue()[/CODE] The code is a piece of a program . The above code when run , shows the text …

Member Avatar for arindam31
0
232
Member Avatar for obito

Hi I just started learning programming and tried some looping with file management. I am not sure how to join the string after looping can someone give me some pointers how can i go about doing it? Thanks! This is my code [CODE] import string testFile = open("test.txt", "r").readlines() for …

Member Avatar for TrustyTony
0
108
Member Avatar for petergeng

Im trying to call python functions from C code, and i followed a sample from here [URL="http://docs.python.org/release/2.3.2/ext/pure-embedding.html"]http://docs.python.org/release/2.3.2/ext/pure-embedding.html[/URL] I also have the correct include file directries, library directries, and linked the python32.lib (im using python 32) however the error was that python/C APIs such as PyString_FromString, PyInt_FromLong, PyInt_AsLong are undefined (error …

Member Avatar for Gribouillis
0
159

The End.