15,181 Topics

Member Avatar for
Member Avatar for MBPFAN

I'm using python IDLE v. 2.7.2 and I get the same error report with my program. [CODE]>>> def menu(list, question): for entry in list: print 1 + list.index(entry), print ") " + entry return input(question) - 1 [B]items[/B] = ["Cup","Vase","Table","Lamp","Bowl","Door"] keylocation = 3 keyfound = 0 loop = 1 print …

Member Avatar for MBPFAN
0
1K
Member Avatar for ron126

Hi, please help me. Say I have 2 lines of code below. I want to "print ranking" and have result of "1" (force string to use global variable) instead of the letter "a". What are the methods available? a=1 ranking = "a" Can you please help me out? I'm noob …

Member Avatar for ron126
0
237
Member Avatar for manisha

hi guys, I have been using python since last 1yr. For my work I have to use large data that are at least of size 3000 to 30000 or even more quite a time. Since many months I have been using matrices. But when the size of the Matrix is …

Member Avatar for manisha
0
232
Member Avatar for floatingshed

My first gui application is working fine. Fine, that is until the user forgets to select the output directory. I have set up an error message that, when clicked, directs the script to the open directory dialog. This works but I would prefer the user selected the open directory option …

Member Avatar for Gribouillis
0
270
Member Avatar for hamidvosugh

In this string "13 12", I like to find if there is an occurrence of '3', but I am not interested in char '3' which is part of "13". In other word I am looking for number 3 not 13. By using the following code in python I always get …

Member Avatar for Gribouillis
0
158
Member Avatar for Thisisnotanid

I need advice. I'm writing a calculator; I've got the basic functionality of it down, and have finally moved to having it process functions. In this regard, I find the standard library of mathematical functions provided by Python unsatisfactory. While the more commonly used functions are defined, some of the …

Member Avatar for Thisisnotanid
0
381
Member Avatar for floatingshed

Hello, newbie here to both this forum and Python, so expect silliness! My first project has been to build a GUI front end for some command line utilities I use regularly. One of them is the utility: eac3to which joins mp3 files together. It's command line is: "eac3to.exe infile1+infile2+infile3 outfile" …

Member Avatar for NewbieXcellence
0
2K
Member Avatar for spyhawk

i have a given picture and have to create a picture that is twice as wide as the given picture. For each pixel (x, y) in the original picture, the pixels (2 * x, y) and (2 * x + 1, y) in the new picture should be set to …

Member Avatar for NewbieXcellence
0
313
Member Avatar for Vkitor

Hi, I'm trying to put sleep action on my program, but I would like program to sleep after I (as user)click and when he changes the picture on the button. and I don't know where to put it. please help this is example of code :) [CODE]import tkinter as tk …

Member Avatar for TrustyTony
0
168
Member Avatar for NewbieXcellence

I'm working on a GUI app with tkinter (which I am fairly new to). It's for comparing the clocks on two computers across a network. It uses callbacks (scheduled using the "after" method of the root window) to update text and canvas widgets in a GUI. The canvas widgets are …

0
80
Member Avatar for Stefano Mtangoo

Hello all, I need some help to get all wxpython methods that associate widgates. I mean ALL methods for wx.Button, wx.Frame etc. I will appreciate if I will get something like pdf version but anything or Idea is welcomed Thanks and regards Steve

Member Avatar for joryrferrell
0
121
Member Avatar for arson09

Can anyone help me get a more clear understanding for what it is exactly that the assignment is asking me to do?? For example, what exactly is supposed to be in the first function, am i doing the testing in the first function or the generator? It's not clear to …

Member Avatar for woooee
0
234
Member Avatar for joryrferrell

It starts off fine, after starting the countdown function and pressing the Action button, it causes the program to freeze. [CODE] import wx import time class LeftPanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id, style=wx.BORDER_SUNKEN) self.text = parent.GetParent().rightPanel.text self.text_2 = parent.GetParent().rightPanel.text_2 button1 = wx.Button(self, -1, 'Count', (10, 10)) button2 = …

Member Avatar for joryrferrell
0
158
Member Avatar for subhra1234

hello,everyone,i am a beginner in python django framework,so is there any editor for django,like microsoft visual studio,where i get the facility like drag and drop buttons,labels,or table structure ..plz help

0
63
Member Avatar for bkribbs

I've looked, but I'm sure I am missing this. But I have two files. I have a python one, and a bash command? (I think thats right? Its a file that I can execute and makes changes but isn't a script?) But I want to launch it from the python …

Member Avatar for ihatehippies
0
136
Member Avatar for jackbauer24
Member Avatar for mr_noname

Hey. I'm pretty new in Python. I'm trying to read from my file all the content and put it in a string. My file looks: 1 string1 2 string2 10 string 3 and I want to obtain: ["1", "string1", "2", "string 2", "10", "string3"] using this: [CODE] def read(self): file …

Member Avatar for snippsat
0
265
Member Avatar for DanWebb3148

I know how to create a window of a given size. How do I control the placement of items like labels and text boxes in that window?

Member Avatar for DanWebb3148
0
20K
Member Avatar for TF401

Hi, I want to know if is possible to make those events/automation with a Python code( without any program like Pywinauto ), so I could compile the python code: 1. [B]sending keys to an active window;[/B] 2. [B]sending mouse clicks to specific coordinates in a window;[/B] 3. [B]set the window …

Member Avatar for ihatehippies
0
353
Member Avatar for vitorlobo

Hi Guys! I'm new to the forum and I have a doubt. Who can help me, I thank you. This is a simple GUI .. formed by a simple table. How do I connect to a database file. Db so that is shown in table QtGui? I'm using SQLite in …

0
48
Member Avatar for Lucaci Andrew

[CODE]def prel(x, i, j): if (i < j - 1): k1 = (j - i + 1) / 3 k2 = 2 * k1 prel(x, i, i + k1) prel(x, i + k1 + 1, i + k2) prel(x, i + k2 + 1, j) for k in range(i, j): …

Member Avatar for Lucaci Andrew
0
226
Member Avatar for Gribouillis

I discovered and installed a firefox addon called Remote Control. This addon starts a telnet server which lets you send javascript commands to the firefox web browser. Combined with python telnetlib module, it becomes very easy to reload or change the content of a tab in a running firefox from …

Member Avatar for Gribouillis
0
924
Member Avatar for kungfubambi

Hi, I'm pretty new to Python. Working in 2.4 due to company restraints. I'm trying to use os.path.walk to work through a tree directory, and perform different actions on the files based on the name of the file. I thought if I used "startwith" it would indicate that files only …

Member Avatar for kungfubambi
0
242
Member Avatar for Daniel200911
Member Avatar for pwolf

Stuck again, this time my problem is getting the dictionary to be sorted in ascending order. Please Advise! the following is what the task says: """ A sparse vector is a vector whose entries are almost all zero, like [1, 0, 0, 0, 0, 0, 0, 2, 0]. Storing all …

Member Avatar for pwolf
0
2K
Member Avatar for FALL3N

I want to run a multiline AppleScript command from a Python script. For a singleline command I can do: [CODE]def stupidtrick(): os.system(cmd) cmd = """osascript -e 'tell app "Finder" to sleep'""" stupidtrick(); [/CODE] however I want to run multiline commands, (such as with multiple 'tell' statements, as in [ICODE]tell application …

0
167
Member Avatar for usdblades

I just started learning python and decided to try and put what I have learned to use in a program and I am having issues with the math I believe. Any suggestions? [CODE] print ("Lets get some utlities information") rent=input("What is your monthly rent: $") pge=input("Estimated PG&E Bill: $") water=input("Estimated …

Member Avatar for usdblades
0
161
Member Avatar for Saqib_J

hi, i'm very new to python. i downloaded pyserial on win7 64bit. using Dell N5010 (it doesn't really have serial port) i tried to open port with ser = serial.Serial(0) but it gave error that [COLOR="red"][Error 2] The system cannot find the file specified.[/COLOR] but with ser = serial.Serial(3) and …

Member Avatar for Saqib_J
0
186
Member Avatar for theweirdone

Hi, I'm trying to extract certain things from a web page. The website is TVRage.com, and the example I'm using at the moment is [URL="http://www.tvrage.com/Warehouse_13/episode_list"]the Warehouse 13 episode list[/URL]. So far I've managed to get the title of the show using this code: [CODE]#!/usr/bin/env python import urllib def save_page(site="http://www.tvrage.com/Warehouse_13/episode_list"): mypath …

Member Avatar for Aung Myat
0
672
Member Avatar for pwolf

Stuck again, still, im learning from my large list of mistakes, haha so this time im trying to convert a decimal to hexadecimal, i tried using hex(number) but its not suitable for the situation as this returns a string. and i dont know how or if i can convert a …

Member Avatar for pwolf
0
2K

The End.