15,190 Topics

Member Avatar for
Member Avatar for OffbeatPatriot

At my lab the professor bought a camera that came with a c library to control it from a computer. Right now he wants me to create a gui in matlab to control it but I'm such a python zealot I'd rather do it in that, and then call it …

Member Avatar for OffbeatPatriot
0
255
Member Avatar for scru

Is there a way to add a directory to the locations that python look at when you call __import__ ? I need to import some scripts from a user folder at runtime, and since __import__ doesn't accept absolute file names, I'd like to try this. Copying the script to the …

Member Avatar for scru
0
138
Member Avatar for revenge2

Hey guys, well here are some more of my questions (sorry!! i know, im a pain..) Ive finished "most" of everything in this [URL="http://www.swaroopch.com/notes/Python_en:Table_of_Contents"]tutorial[/URL]. I missed some out because they were too much for me to understand at the time. will go back to them and come back with more …

Member Avatar for Ene Uran
0
123
Member Avatar for EAnder

I know the codes not the best well written but the only problem I'm having(besides the interpreting of the macro commands, the one here is just a base for me to work on) is how the UpdateLabels.start() method returns: [code]Traceback (most recent call last): File "C:\Users\Erik\Desktop\Stuff from last Night\MouseMacro.py", line …

Member Avatar for Ene Uran
0
115
Member Avatar for revenge2

hello again, Ive got the basics under my belt and ready to start making things happen:D. I want to experiment with different things so could you show me to some good tutorials on some of the following things. 1. sending and receive messages through the internet-what library/Mod should i use? …

Member Avatar for Ene Uran
0
103
Member Avatar for harrykokil

hello guys im stuck for quite a while with this problem and i badly need ur help. in fact i wanna make the red rectangle slow down when it comes close to the blue one. it would be nice if they both move at the same speed. ive tried several …

Member Avatar for harrykokil
0
75
Member Avatar for mrpoate

Hi, This is my first time on daniweb, so if I've posted in the wrong section or there's already a similarly-themed thread or I've done something wrong I apologise. Anyway, I'm hoping someone can prod me in the right direction with a problem I'm having right now. I'm currently working …

Member Avatar for mrpoate
0
2K
Member Avatar for jworld2

Okay, my first question is about wxpython's registerhotkey. As far as I can find, there are not letter key keycodes. This example relies on the win32con module: def regHotKey(self): """ This function registers the hotkey Alt+F1 with id=100 """ self.hotKeyId = 100 self.RegisterHotKey( self.hotKeyId, win32con.MOD_ALT, win32con.VK_F1) -- I want to …

Member Avatar for lllllIllIlllI
0
161
Member Avatar for adam291086

I am trying to write some simple information to a file and i am getting the error message "No such file or directory when i know full well it exists. If you take the url [url]http://www.adamplowman.com/uni_project/log.txt[/url] you get the file heres the code [CODE]#!/usr/bin/python print "Creating a text file with …

Member Avatar for Gribouillis
0
118
Member Avatar for juzzy

hi I wonder if anyone can help? I am trying to write a simple server_side message reciever so i can send messages from one machine to another, I want the program wrapped in a gui and i have been doing this using tkinter. However I have a problem, I can …

0
45
Member Avatar for adam291086

I am trying to construct a class and call upon some functions within that class, but nothing is returned, somehting should definitely be returned [CODE] #!/usr/bin/python import cElementTree as ET import urllib2 import MySQLdb print "Content-type: text/html\n" class xml: @staticmethod def find_text(element): if element.text: yield element for subelement in element: …

Member Avatar for adam291086
0
170
Member Avatar for Clipper34

Hey everyone, well i've been recently for the last day pondering on the idea of creating a web spider, but i just don't know where to start. What i think mainly the spider is built off of using the urllib, socket, and urllib2 modules to do the spiders bidding, i …

Member Avatar for woooee
0
128
Member Avatar for TheNational22

There is a thread in here somewhere that spoke of the issue but it did not describe a fix. I am running Vista home premium 64-bit SP1. When I open a wxPython window, it runs. As soon as my mouse enters the frame, a message comes up stating "python.exe has …

Member Avatar for TheNational22
0
93
Member Avatar for ruba_cti

Hi, I'm getting this error when reading from a csv file: "Runtime Error! line contains NULL byte". Any idea about the root cause of this error? If it helps, here's the part of my code where I'm reading the csv file. [QUOTE]def processFile(): global DATA # - Input file global …

Member Avatar for ruba_cti
0
2K
Member Avatar for harrykokil

can u plz debug it for me?? thanks [icode] import Tkinter as tk import time import sys import datetime as dt from Tkinter import * root=tk.Tk() root.title("Traffic Simulation") canvas = tk.Canvas(root, width=1000, height=400, bg="#FFFFFF") canvas.pack() for x in range (1,10): print 'orange'+x canvas.update() root.mainloop() [/icode]

Member Avatar for harrykokil
0
93
Member Avatar for Aue

make python program count the number of two words on a webpage (for instance, 'keep' and 'delete') and return it.

Member Avatar for leegeorg07
0
81
Member Avatar for bharatvamsi

hi, i'm novice user in python and i want to capture data at a specific port using python script.Please suggest me the approach. Same data i'm able to write into a file using linux command: tethereal -i any "port 9060" -w sam.txt I want to accomplish the above task using …

Member Avatar for lllllIllIlllI
0
56
Member Avatar for Stefano Mtangoo

I use bass.dll to play music files from [url]http://www.un4seen.com/[/url] I try to use function called BASS_ChannelSetPosition. I use ctypes to access the Library. Below is the part of documentation (comes with bass as help file) I need somebody to tell me whether the mode (BASS_POS_BYTE, BASS_MUSIC_POSRESET...etc) is a function or …

Member Avatar for Stefano Mtangoo
0
210
Member Avatar for lllllIllIlllI

Hi In one of my programs i use a wx.ToolBar, and this toolbar is meant to show a range of picutes that help the user with doing things quickly and easily. But the thing with mine is that i am using 64x64 images for the toolbar, yet when i set …

Member Avatar for lllllIllIlllI
0
91
Member Avatar for adam291086

I have this script and it was working a couple of weeks ago. Now when i run it nothing is printed out other than white space. WHY??? [CODE]#!/usr/bin/env python from xml.etree import ElementTree as ET import os import urllib def find_text(element): if element.text is None: for subelement in element: for …

Member Avatar for adam291086
0
103
Member Avatar for revenge2

hello there. I'm using notepad++ at the moment and i want to switch to something a little more 'better' suited to python. Ive already gone through the huge list of text editors on [URL="http://wiki.python.org/moin/PythonEditors"]wiki[/URL]. but yeah cant decide.... what would you recommend?

Member Avatar for Ene Uran
0
89
Member Avatar for tzushky

Hello , I have had a little surprise and maybe because I haven't read the manual well enough or can't understand all the underlying details. Imagine a small class and another file's main using an instance of that class. If I try to modify (not define !) an INEXISTANT attribute …

Member Avatar for Gribouillis
0
225
Member Avatar for SoulMazer

For reference, I am using Python 3.0. So, I have a small script I am working on trying to improve. I am now trying to create it with only dictionaries and loops. My problem is that I keep getting a Key Error at one of my lines. The line with …

Member Avatar for SoulMazer
0
160
Member Avatar for wheatontrue

Hello - my Python 2.5 IDLE used to start up, but now it won't. I tried looking at the preferences - those don't have any glaring mistakes. When I try to start it command line I get the following error: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. …

Member Avatar for wheatontrue
0
318
Member Avatar for Stefano Mtangoo

I have python 2.6 portable and would pop error when I import wx. After some search, I found The prementioned package missing in the XP system. I downloaded and Installed and went fine. My Question is : Is there any way to add vcredist_x86.exe's missing DLL direct to wxpython directory …

Member Avatar for Stefano Mtangoo
0
172
Member Avatar for codedhands

Hello.Please i have a problem with my code.I am trying to edit a file.The problem occurs when i use the seek function.for example,i have a file outlined like this: [CODE] myfile.txt <Name>Ben</Name> <Age>32</Age> <Sex>Male</Sex> <Country>Mars City</Country> [/CODE] Now,when i try to edit the Age,i use the code: [CODE=python] f=open('myfile.txt','a') f.seek(17,0) …

Member Avatar for lllllIllIlllI
0
97
Member Avatar for starzstar

Hi, I am new to Python and have a requirement to develop a simple requirement to design a login screen, and then a screen which will have two parts in it one will show local files and other files on server I am planning to use tkinter for this is …

Member Avatar for jlm699
0
113
Member Avatar for Stonehambey

Hi guys :) Did a bit of searching but couldn't find much on this, so I thought I'd ask here. I want a Tkinter Label to display a polynomial, so naturally I need to put some superscript formatting onto it. But I can't seem to work out how to. Any …

Member Avatar for Ene Uran
0
2K
Member Avatar for leegeorg07

hi again i have been looking at the bacon cipher and i have made this [ICODE]import re dictionaryofcodes = {'A': '11111', 'B': '11110', 'C': '11101', 'D': '11100', 'E': '110111', 'F': '11010', 'G': '11001', 'H': '11000', 'I': '10111', 'J': '10110', 'K': '10101', 'L': '10100', 'M': '10011', 'N': '10010', 'O': '10001', 'P': …

Member Avatar for leegeorg07
0
123
Member Avatar for Gribouillis

What do you think would be the best way to write this structure [code=python] if testA: actionA() if testB: actionB() if textC: actionC() else: actionDefault() else: actionDefault() else: actionDefault() [/code] if I want to write only one call to actionDefault() ?

Member Avatar for Gribouillis
0
136

The End.