15,185 Topics
| |
I have a text file that I need to modify. It contains about 100 or so lines formated as follows: [CODE]123456789*DOE JOHN A *PY*SUPER HERO *179250*026450*000000*68*026450* *000000* *000000* *000000* *000000[/CODE] What I need to do is insert decimal points at specific places so it looks like this: [CODE]123456789*DOE JOHN A … | |
I've just taken a beginners project from Vegaseat and modified it to fit with a Tkinter tutorial. I'm just trying to get a Tk window that has a "Go!" button and by pressing it prints the sentence. I'm having lots of trouble. I've gained a lot from this though, so … | |
Hi! I have a file with data that looks like that: 123 34 0.45 232 54 0.01 And so on (the file contains more than 1300 lines). I am trying to make dictionary from the data (like this: dict={0.45:'123_34',0.01:'232_54',...}). The problem is that I didn't get more than 1300 elements … | |
I'm trying to write a phonebook application using Tkinter. It's not very advanced, and it's mentioned in this tutorial: [url]http://openbookproject.net//py4fun/gui/tkPhone.html[/url] The full source of the tutorial's version being here: [url]http://openbookproject.net//py4fun/gui/tkPhone.py[/url] However, I'm trying to write a version myself, yet I keep getting the following error: [QUOTE] File "phonebook_test.py", line 96, … | |
Hey all! I'm new to programming so please be patient if my question is obvious or listed somewhere else (I've looked!) I want to be able to enter a sentence, split the sentence into septate words and then take the first letter of each word to create a new string. … | |
So I'm writing a small Blackjack game and divided a class up into 2 to keep everything tidy but keep getting this little error: [i]global name 'handle_input' is not defined[/i] The code: The class being called... [ICODE] #File: handle_input.py class handle_input: ...[/ICODE] The file defining the class... [ICODE] #File: control.py … | |
Hello everybody, I've a somewhat odd issue displaying a .png image onto a Tkinter canvas. The image is surrounded by a grey frame. Here below an excerpt of the relevant code and by the way I'm running under windows xp. The same thing happens with the menu of the gui, … | |
How do I read something from DOS? For example, doing a command in DOS, like 'dir'/etc. and writing the output to a variable in python? I know about the listdir() function, 'dir' in DOS is just an example. | |
I'm using the following tutorial to learn Python: [url=http://openbookproject.net/thinkCSpy/index.xhtml]How to think like a computer scientist[/url] I'm running the following code and I get an error: [CODE]from gasp import * begin_graphics(800, 600, title="Catch", background=color.yellow) set_speed(120) ball_x = 10 ball_y = 300 ball = Circle((ball_x, ball_y), 10, filled=True) dx = 4 dy … | |
Hi everyone, I'm new to wxpython, so I apologize in advance if this has a simple solution. The GUI I'm working on has the following basic structure: [I]def function(time) -> initialized from frame and generates data needed in panel class panel -> displays data and images generated in function class … | |
Hello, I am using the RE, Regular Expression Module. The operation I need to perform is a search; The syntax for which goes like this re.search(pattern, string, flags) #flags being optional where 'pattern' is the string I am looking for in 'string'. My problem is I want to look for … | |
I'm working on making a server control panel in python (like cpanel, plesk, etc) and wanted to know if any one knew of some tutorials on using bash and python together for creating users and stuff on a *nix system. Also if any one knows of a tutorial on using … | |
Hi daniweb users My name is luc. I'm from Germany. Before I have started with Python I used PHP. There you have the funktion [B]urldecode[/B] to decode a url string or [B]urlencode[/B] to encode a url string. I don't really know I a function like that in python. can you … | |
Hi , Kindly assist me with resolving this defect from the testers team. am new to python. the defect is as follows: "A small code change must be added to checkif the password that has been received from the API call compares to "clear|......". If this is the case then … | |
i want to create a file exactly like pickled file using C program in Qt without using python. this file will be read by python (unpickled ) to initialize some properties. Or Is there any way one can know the exact syntax of pickled file n then write it using … | |
hi guys im new to this forum so im not sure how it works :S. im currently using the Khepera robot and am trying to make it follow the wall. i know how to read the sensors but i i dont know how to make it follow the wall if … | |
Dear Group, I am getting some questions on doing Web Pages in Python. I have some interactive codes in python for which I like to make web pages. I am trying to use kid. Kid I learnt, and is easy, too. My questions are: i) Am I going correct? ii) … | |
Hi, I'm writing a simple echo/chat GUI server using wxPython. I made a separate thread for the server. The only problem I have is that when I try to close the server it hangs in socket.recv() thus hanging the whole thread. How can stop the socket from receiving from the … | |
I know, this is a stupid question, but is it possible for a class to have two variables, one of which has a value, and the other of which will [i]always[/i] hold the same value, unless the user changes it? In essence, making the second variable a duplicate of the … | |
How do I test a byte string in Python? I want to manually convert (no libraries or functions) a UTF-8 string into UTF-16. My basic solution is to reading from the stream some number of UTF-8 bytes, convert them into codepoints, then convert those codepoints into UTF-16 bytes. I want … | |
I have a script with a wx.Python GUI that monitors game files for changes and then makes a .tar.gz backup of each turn. If I run the test script (.py extension) the program works well and I can play the game without noticing the python script running in the background. … | |
I keep hearing that Python is about as slow as Java. Does anybody have experience with speeding things up? | |
Hello, long time no see... I've been getting along fine with Python lately and I just need to ask you a question: Is it possible to just write to, NOT OVER , an Excel file, in a certain area, using a certain python module?. This way results from an application … | |
Hello again, I have the following situation: I have a script which allows the commands of several instruments. for some of them, their configuration is easy and simply launching the application with [B]os.system()[/B] or through [B]telnetlib [/B]allows me to do what I need. But I have stumbled across something which … | |
Hi all, I'm wondering if it is possible to convert an object reference to a string and vica versa? Thanks | |
Hi, I am using the following code to send mail from a open window in maya application. This gives me following error. I think it says that A2 is not created. What is a possible way to have this code send a mail. BRgds, kNish # Error: name 'A2' is … | |
Hello All. I am quite new to programming, I have a question in regards to creating a script that reads data from a file and then prints how many time each value ( number in my case occurs). I was wondering if you could help me write a similar script, … | |
I am getting an attribute error...Group not found on cookie = m.group(1) Can any one fix my code here? [CODE]#!usr/bin/python import re import urllib import urllib2 def MassVote(first_number, last_number, email1, email3, password, community_id, join = False, unjoin = False): def curl(url, cookie = None, get_header = False, fields = None): … | |
I found a way to open the source code on python command line, but my question is once it's in the command line what can i do with it? Anything? Or is it just another way to view the source code? | |
I'm trying to find the moving average of 20 numbers at a time, being read from a list. This moving average then needs to be inserted into the list. Here is my code: [code]inplis = file(r'table.csv','r').readlines() outp = file(r'avg_volume.csv','w') import math emptyList = [] totalVolume = 0 counter = 0 … |
The End.