15,185 Topics

Member Avatar for
Member Avatar for prashanth s j

Hi, I have got the following requirement: In a file that has many lines, i need to search for a particular line that has the word DTP. The line may be like this in the file: src 172.23.1.23 dst 192.14.2.34 DTP 0 - 65000 If the line with the word …

Member Avatar for jlm699
0
106
Member Avatar for lrh9

I know that certain functions will check the script's or module's current directory for the file if no path is specified. [code=PYTHON]open('test.txt')[/code] If that script is run and test.txt is in the same directory that will open the correct file. However, if I try to import that module it doesn't …

Member Avatar for lrh9
0
2K
Member Avatar for ryufire
Member Avatar for prashanth s j

Hi, I have got a utility "sock" which is C executable (under linux) on my machine. It acts like a server or client based on the arguments passed at the command line. I want to run it through a python script. I am using the subprocess call function to execute …

Member Avatar for prashanth s j
0
200
Member Avatar for sureronald

I wrote a python program that gets input from an input file. It works fine for small input files since after opening the file I did this to get the data [code=python] data=fPtr.readlines() [/code] Since readlines only takes the input data and packs it into a list, it is clear …

Member Avatar for mahesham
0
4K
Member Avatar for gangster88

I would like to be ablt to display 25 circles with alternating colours of red and white? But the code I produced does not work.. plz help. from graphics import * w = 300 h = 300 win = GraphWin("Red Circle", w, h) center = Point(150, 150) radius = 80 …

Member Avatar for Beat_Slayer
0
2K
Member Avatar for G_S

Hi, I've been working a lot with text widgets lately, and I have posted several questions here. Again, thanks for all your help. This time I'd like to post something I found out, so you can help me improve it. My program consists of two textboxes. The texts inserted in …

Member Avatar for G_S
0
137
Member Avatar for Pytho

Hi! I'm doing software that controls my computer with a wireless navigator that includes Windows CE. I'm doing this with Python. Okay, so lets begin. One of those control options is audio volume controlling. I have a code, that can change Windows XP WaveOut volume on a scale of 0-255. …

Member Avatar for vegaseat
0
960
Member Avatar for vegaseat

Write a Python program that creates upside down sentences, like [B] upside down --> umop apisdn [/B] The sentence above is flipped 180 degrees around the end. Some freedom allowed, like an 'a' upside down and reversed is the closest thing to an 'e'. Conversely a 'w' would be a …

Member Avatar for TrustyTony
0
1K
Member Avatar for zentropy

Does anybody know how to get data from the ethernet port? Is there a library for it? I don't really know how networking works Basically there is going to be a microcontroller sending data over ethernet, and I want to get the data it sends and write it to a …

Member Avatar for tzushky
0
333
Member Avatar for appunu

Hi guys... I wanted to import DB2 in Python 2.6 so i downloaded the pydb2 egg file for python 2.6. I used the easyintaller to install the package also it ran successfully. when using eclipse i tried to import DB2 its not showing the package.. plz help me figure out …

Member Avatar for SgtMe
0
54
Member Avatar for lewashby

I've been trying to find pygame that will work with python 3 on my Ubuntu machine far a while with no luck. I can find a version that will work with Ubuntu but now for python 3, or I can find one that will work with python 3 but not …

Member Avatar for Kruptein
0
124
Member Avatar for laithlaithlaith

hello guys, I want your help about my code. the problem is when I want to apply in my phone show me this message error. (NameError:name 'app_lock' is not defined). this is my code : [code]import socket, e32, appuifw def choose_service(services): names = [] channels = [] for name, channel …

Member Avatar for TrustyTony
0
648
Member Avatar for Kruptein

I'm looking for people to test a program, I've just finished the rewrite of a program and I need people to test for bugs etc... It's a program for developers written in python and wxpython-gui-toolkit It's made with the aim on linux, although windows-testers are welcome as well link: [url]http://launchpad.net/d-cm[/url] …

Member Avatar for Kruptein
0
89
Member Avatar for G_S

Hi everybody, I am experiencing a very weird situation here: I have a program that uses tkinter and python 3, but its search function isn't working under Windows. [CODE=python] from tkinter import * import tkinter.ttk def sort(): pass def find(): start = 1.0 while 1: find = text_to_be_found.get() pos = …

Member Avatar for G_S
0
217
Member Avatar for foco

I'm currently working on an application that involves reading pdf files into a variable and passing them to a server via http POST method. On Linux, everything is fine because I can use cat and popen: [CODE=python]pdf = os.popen('cat testpdf.pdf').read() #read pdf data in Linux[/CODE] However, in Windows, the DOS …

Member Avatar for jagan605
0
84
Member Avatar for Pinchanzee

I'm quite new to Python (and programming past pascal) so I'm looking for a relatively simple-to-understand way to do this. All help is much appreciated. I'm looking for the program to take a variable as if it were just normal code, I'll explain via example. I want the code to …

Member Avatar for Pinchanzee
0
157
Member Avatar for runit

I have a set of objects of questions and answers and I need to return all possible combinations of each question and answer in a set of dictionaries. I am new to Python and have done some Google-ing but I don't think I know enough to even know how to …

Member Avatar for ultimatebuster
0
257
Member Avatar for G_S

Hi, I have a Text widget and a button that is supposed to sort the Text's contents alphabetically. This time I won't ask you how to do it, I'll rather ask you to correct me. This is how I solved the problem: [code]unsortedT = text1.get(1.0, END).replace("\n", "\n*").split("*") sortedT = sorted(unsortedT) …

Member Avatar for TrustyTony
0
131
Member Avatar for happymadman

I have put some xml data in a file the python code below and have been trying to figure out how to get the data from the file add another "person" and then save to the same file again. [code=python] from lxml import etree from lxml.builder import ElementMaker E = …

Member Avatar for happymadman
0
222
Member Avatar for jcao219

Interesting right? If you read [URL="http://www.daniweb.com/forums/post1252636.html"]this[/URL] amazing tutorial by lionaneesh, you will understand why I posted this brain-boggling code.

Member Avatar for jcao219
0
157
Member Avatar for G_S

Hi, I have a different question today: how do I call the python interpreter AND tell it to open a python program from inside another program UNDER WINDOWS? My program is running fine, and it even has a text mode without any graphical interface. Under Linux, you click on the …

Member Avatar for G_S
0
373
Member Avatar for Priyesh_17

Hi, I am trying to write a python test script which will start a Server and Client locally and then transfer their STDOUT to two files. This I need to do from the same test script and the asserts should be the next step. When I am doing the same, …

Member Avatar for woooee
0
155
Member Avatar for J-M DESMETTRE

Hi folks, I've got a little problem with my queries in sqlite3. I need to select 'brands' (a, b, c, ...) for a 'date' YYYY-MM-DD from my table. As you can see in my script, I'm able to build a query by passing 'selectedDate' or 'selection', but not both values. …

Member Avatar for woooee
0
140
Member Avatar for WildBamaBoy

Does anyone here know how to use the UnRAR2 module? [URL="http://code.google.com/p/py-unrar2/downloads/list"]http://code.google.com/p/py-unrar2/downloads/list[/URL] I can't for the life of me I can't figure out how get it to do the same thing that zipfile does in a project I am working on. I want it to look for all files of a …

Member Avatar for Beat_Slayer
0
260
Member Avatar for Tech B

I've always loved games and decided to pick up dev as a new hobby. I'm aiming to do something like Johnny Lee and track head position for a VR display. I've heard it called frustum correction or the "portal effect". [URL="http://www.youtube.com/watch?v=Jd3-eiid-Uw"]Here is a link to see what I'm talking about.[/URL] …

Member Avatar for Tech B
0
168
Member Avatar for shavais

I was looking for a StringBuilder type of thing to use in Python (I've been working in PHP, at work, recently, and cStringIO had momentarily slipped my mind), and found StringIO and cStringIO, but in doing so, I found a post that claimed that they both performed very poorly in …

Member Avatar for snippsat
0
117
Member Avatar for Tahir007

Hi, I develop dynamic in-line assembler for python. Its very easy to use it from python and know you can optimize some routine in assembly language and use it directly from python. Its support both windows and Linux. If you are interest you can take look on web-page, [url]http://www.tahir007.com[/url] If …

Member Avatar for Beat_Slayer
1
139
Member Avatar for cc11rocks

like for a regular menu it would be: [CODE]def menu(list, question): for entry in list: print 1 + list.index(entry), print ") " + entry return input(question) - 1 items = ["bookcase", "sleeping dog", "couch", "closet", "rug", "door"][/CODE] [COLOR="Red"]How to create a menu to where when you entered 1 for bookcase …

Member Avatar for vegaseat
0
2K
Member Avatar for masterofpuppets
Member Avatar for TrustyTony
0
797

The End.