14,945 Topics

Member Avatar for
Member Avatar for Ravi_exact

Friends, I'm completely new to python, i have question with setting width of PySide.QtGui.QDockWidget in python. I have MainWindow class in python which inherits QtGui.QMainWindow ( PySide ) and have added one left dock widget with simple plot and one right dock widget with simple plot and embedded simple plot …

Member Avatar for britanicus
0
589
Member Avatar for keegansch

Hello! So, I'm taking some classes and learning how to write sample programs in Python, and I've stalled out pretty hard on one of the sample programs. The current exercise wants me to do the following: 1. Create an empty list home_prices 2. While loop asks for a home price …

Member Avatar for David W
0
356
Member Avatar for keegansch

Hello, all! My name's Keegan, and I'm a college student finishing up my B.S. in Journalism, and learning Python is one of the final steps toward earning my degree. I hope to use what I learn about Python and apply it to digital journalism in the form of app development, …

Member Avatar for JorgeM
0
157
Member Avatar for tubs1

Hi All, Im new to Python and doing a few basic exercises around modules and calling same. Can someone explain what par is in relation to this example? -------------- # Defining a module called support.py def print_func( par ): print "Hello : ", par return -------------- # Importing support.py module …

Member Avatar for Gribouillis
0
539
Member Avatar for frankie198

I am new here and it's my first post, so I'm sorry if this is in the wrong place or is formatted wrong. I made my first Python code, which is extremely simple, but I have a few questions I need clarified: This program asks the user to enter 3 …

Member Avatar for David W
0
444
Member Avatar for Ravi_exact

Hi, I would like to add some descriptions to functions on top of every function ex : [Name = 'Test menu', Default=True, etc..] def test(): pass My actual scenario is , I create Menus dynamically by reading all methods from a module at run time. So i don't want to …

Member Avatar for slate
0
471
Member Avatar for abaddon2031

I have a block of code that i am wanting to turn into a function and i am very ocnfused on how to do it properly. If anyone could give me a lead on how to do this it would be a great help. The for statement is where i …

Member Avatar for abaddon2031
0
222
Member Avatar for Tcll

so I have this example, which I've slightly modded to get the simplicities out of the way: from PyQt4 import QtGui, QtCore HORIZONTAL_HEADERS = ("Surname", "Given Name") class person_class(object): ''' a trivial custom data object ''' def __init__(self, sname, fname, isMale): self.sname = sname self.fname = fname self.isMale = isMale …

Member Avatar for Tcll
0
3K
Member Avatar for Will_5

**I genuinely hope this is the right place to post this question.** Anyways, I play video games alot and I really like them (I know playing video games won't help me make them ) But as I play them I keep on getting the urge to create my own video …

Member Avatar for jwenting
0
527
Member Avatar for ddanbe

This is my first try with turtle graphics in Python. It is in fact a sort of "translation" from some old LOGO code. When you run it, this should be the result: ![dbf0a4f76975c5cc4dee5df30139f144](/attachments/small/1/dbf0a4f76975c5cc4dee5df30139f144.png "align-left") Insiders can perhaps play the "Dark side of the moon" record by Pink Floyd :) Any …

Member Avatar for ddanbe
3
2K
Member Avatar for Vishwadeep1

Hello. I am working in QGIS software in which backend python programming is used. I want to interesect a polygon with different lines passing through it, and find the width of that polygon in QGIS 1.8. The polygon is a shapefile ie .shp file. So please help me to complete …

0
119
Member Avatar for TrustyTony

Here some old fashioned line input routine, better idea nowadays would be to use GUI input box with real editing. Anyway, it is quite simple with Python to do this basic routine for terminal based program.

Member Avatar for fonzali
4
510
Member Avatar for lewashby

Why am I getting the above error message when I run this program? I'm running this program with an mp3 file as an argument, the mp3 file is in the same directory as the python program. There are 30 space reserved for the Title at positoin 125 from the end …

Member Avatar for lewashby
0
4K
Member Avatar for abaddon2031

Im working on a small block of code that compares a argumented value to a file seached value. Every time i run the code it and give it the argumented value either lower or higher than i know the searched value is it gives me the opisite answer of what …

Member Avatar for abaddon2031
0
284
Member Avatar for dany12

Based on this ideea **You just wrote a loop allowing the input of 20 names into a list. Alas, you made an error as you entered name number 17. Redesign your input loop, so you can correct the error easily without having to retype the previous 16 names.** I wrote …

Member Avatar for TrustyTony
0
319
Member Avatar for Tcll

I'm working on an IDE for a program I'm building, and just found out I need to use ast. I can't seem to find any decent examples to get me started on google... can someone help me out. :) thanks

Member Avatar for Tcll
0
599
Member Avatar for Benjamin_11

So I have been working with a csv export for a few days now and I have the data almost in the form I need it in. I need some advice on how best to proceed to get to the soltuion I need. Here is the problem: My csv export …

Member Avatar for hericles
0
174
Member Avatar for dany12

I searched daniweb for related questions and google but i canot seem to find my problem in my code When I try to search for a word that exists in my list it returns false This is my code def main(): #the word that I am looking for word = …

Member Avatar for dany12
0
260
Member Avatar for stormynem

Hi, I am very new to python and tried putting this code together in order to get an interface the size of the screenb but a canvas only half as tall: OFWidth=OedipusFrame.winfo_screenwidth() OFHeight=OedipusFrame.winfo_screenheight() OedipusFrame.geometry(("%dx%d")%(OFWidth,OFHeight)) OFSHeight = "%d/2" % OFHeight OTStart=Tkinter.Canvas(OedipusFrame, bg="blue", height="%d"%OFSHeight, width="%d"%OFWidth) All equations register correctly, but the frame …

Member Avatar for Gribouillis
0
238
Member Avatar for lewashby

I'm trying to write a program to get the artist and album from mp3 files. A simple test run on the Alice in Chanins song Rooster yielded this result -> `b'Rooster\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'` I set read to read(20) and if you count Rooster plus all the \x00s you'll see that it 20, …

Member Avatar for lewashby
0
331
Member Avatar for pramitkumarpal

a=[] f=0 print("BINARY SEARCH") print("ENTER NUMBERS IN ASCENDING ORDER") for i in range(0,9): k=int(input("ENTER THE ELEMENT AT ["+ str(i+1) +"]: ")) a.append(k) s=int(input("ENTER A NUMBER TO BE SEARCHED: ")) #print(a[1]) #exit() l=0 u=9 while[ l <= u ]: m=int( (l + u) / 2) if s==a[m]: f=1 break elif s>a[m]: …

Member Avatar for TrustyTony
0
293
Member Avatar for lewashby

I'm going to try and extract the artist and album from the meta data of an mp3 file with python but I need a little help. This is what I get on the tag line when I open an mp3 file in vim: ----> `ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTAGRooster^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@Alice In Chains^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@DIRT^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@1992` This is what …

Member Avatar for JasonHippy
0
241
Member Avatar for nouth

First am I missing any other notable ones? I only want to know about crossplatform standalone source-based modules, so no Gui IDEs. Tkinter Pyjamas wxPython PyGObject (Gtk's successor) Qt I already know that `Tkinter` is the default so it is the obvious choice for crossplatform because of its licensing and …

Member Avatar for ZZucker
0
357
Member Avatar for ChadSauce
Member Avatar for ZZucker
0
279
Member Avatar for silverdust

I have tried a written a code like so re.findall(r'[A-Z]{3}[a-z][A-Z]{3}',string) to find the solution for this python challenge http://www.pythonchallenge.com/pc/def/equality.html it seems so hard to figure out. I'm getting 527 matches and none takes me to the next level. Help or close hints will be appreciated

Member Avatar for silverdust
0
436
Member Avatar for nouth

path = './file.txt' os.remove(path) import os `os.remove(path)` is equal to `os.unlink(path)`, so how can I delete the file if it just becomes unlinked? Also I haven't tried to yet, but does `'./file.txt'` work as is or do I must provide the full path? Or do I just need to use …

Member Avatar for Gribouillis
0
256
Member Avatar for silverdust

I have been stuck on this python challenge http://www.pythonchallenge.com/pc/def/ocr.html . I am familiar with python re module and regex but I don't seem to get what the challenge wants me to do. If there's anyone else that has been there, I'll need some help

Member Avatar for silverdust
0
376
Member Avatar for massivefermion

Hi I just installed SciPy stack on Ubuntu 14.04. Then I installed python-pyglet. For testing it, I tried the following in python 2.7.6 interactive mode: from sympy import symbols,Plot,sin x=symbols('x') Plot(5*sin(x**3)+x**2) But the only result is « [0] : x ** 2 + 5 * sin(x ** 3), 'mode=cartesian' » …

Member Avatar for Gribouillis
0
126
Member Avatar for Rohit_14

client side code import socket import sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("localhost",9999)) path=raw_input("Please enter the complete PATH of your file : ") f=open (path, "rb") l = f.read(2048) while (l): s.sendall(l) l = f.read(2048) s.close() server side code import socket import sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("localhost",9999)) s.listen(10) while True: …

Member Avatar for Rohit_14
0
236
Member Avatar for Tcll

I'm trying to build an interactive IDE... the IDE has a file testing interface which displays a tree of the called functions in relation to the data in the file being tested. what I want to do is when you select a function referenced in the tree, it'll highlight that …

Member Avatar for Tcll
0
546

The End.