15,190 Topics
![]() | |
Hello, I am new to Python, and have a specific task that I was curious to see if it could be implemented in Python. I have access to a server that will accept requests to query a database utilizing HTTP URLs, and it responds to the request with the results … | |
Hey all, Trying to execute a command line from python. Here's some code: [code] class EncodeJob: def __init__(self,asset,recipe): self.asset = asset self.recipe = recipe self.original = self.asset.fullPath self.stdout = None self.stderr = None self.flv = os.path.normpath(self.recipe.configs['Flv Path'] + '/' + self.asset.filename.split('.')[0] + '.flv') self.thumb = os.path.normpath(self.recipe.configs['Thumb Path'] + '/' + … | |
My question is : x = "you love me" Inside 1234.txt file: i love you you love me we love you If i wan IF x == "you love me" from 1234.txt, THEN x is true. how to do it? any one can help? | |
Hello everyone, My file had 12 columns, I want those lines in my file where numbers in columns 9 and 10 includes digit "101". For example : i am giving 3 lines of my file: ( columns to focus are colored green). NM013123 14-74726235 100.00 18 0 0 11 28 … | |
Hi, I have a script that pulls data off the web based on data in a text file. The text file and script are in the same directory. The values from the script are read into a list. The list is then used in some conditional statements. The text file … | |
OVERVIEW: I am running a script on one machine that connects to a MySQL database on another machine that is outside of our university's domain. According to the administrator, network policies do not allow the compute nodes to access machines outside of our university's domain. COMPUTERS: A = compute node … | |
I've written a socket server in Matlab and also a client program in Python.Both can be run properly respectively.The purpose is to send signals from Matlab to Python.But the problem is that they can never be connected to each other even though I use the same the host and port … | |
I'm trying to write my first validator for wxPython. I want to check the TextCtrl value and change its background color based on whether or not it's numeric. It kind of works, except the event triggers before the current character is actually put in, so the validation is always one … | |
Hi everybody! I don't know if this is possible to do, but here goes: Hi have a program where I have several lists. Let's call them l1, l2, l3, l4. Often in the code, I need to delete a certain item from 2 of the lists I have. I thought … | |
I'm in the process of writing my first python program with a GUI just as practice. I have two listboxes that are packed in the same frame so they are side by side. I have one scroll bar and would like that one scrollbar to move both listboxes simultaneously since … | |
i currently have this nested list [[u'Alice Mee', 3], [u'Alice Mee', 4], [u'adam plowman', 1], [u'james pirret', 2]] I need to remove the last number from each list so i have something like [[u'Alice Mee'], [u'Alice Mee'], [u'adam plowman'], [u'james pirret']] the list is populated dynamically and will always change … | |
Hi all, I have been trying to create a Python program to connect to a serial port and read data from it. There will be a circuit sending the data through the port to PC and the Python program suppose to read and process the data. The data is continuous. … | |
I am attempting to encode using a module called Beautiful Soup. All I need some direction on solving the problem. The encoding maps to <undefined>, so the unicode is not defined within the charmap. The error I get is: UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-34: character maps … | |
I'm making a simple wxPython app on win32 that does a number of calls to external binaries. Everything works fine, except the GUI doesn't update well while the external process is running. This makes for an ugly window and non-updated status StaticTexts, so I'd like to fix it. Window . … | |
Hello everybody. I have got a problem installing (or using) clonedigger. 1- I installed setuptools without any problem : Because i am using Python 2.6, I downloaded "setuptools-0.6c9.tar.gz" and "setuptools-0.6c9-py2.6.egg" and I ran "python ez_setup.py setuptools-0.6c9-py2.6.egg". Everything went ok. 2- But when I run "easy_install -U clonedigger", here is what … | |
Hi guys, I have been working with python for some time now and starting to feel quite comfortable with it after a few small projects. Now, I want to make something on the lines of a packet sniffer. It might be able to analyze network activity. My problem is that … | |
I'm taking a stab at multiprocessing and I need one process to tell the other to run a given function. On the receiving end, I'm trying to figure out how to interpret the message it gets. I could set up a big nest of if/elif to test for every possible … | |
Hey guys, I want to write a program which scans the first line in a data file and sees whether it is delimited by "\t", "," or " ". If it is any of these, I want to keep the line, else, I want to raise some sort of error … | |
I am making a script which manipulates ID3 tags. I want a certain function to be used on every file in a directory recursively. I have written the script but it is not behaving like I would expect in some cases. If I give it exec perms and put it … | |
I can't get MiniFrames to work and I really have no idea how to. I'm a complete noob when it comes to wxPython as I just started learning today. Heres the code for my GUI so far and I want to add a mini frame as a vertical toolbar along … | |
Hi, I am trying to schedule a python compiled file to run using windows scheduler. But it does'nt run successfully The script writes to a SQL server database installed on the same machine as python and the script resides on the same machine. The script imports the urllib, sys, threading, … | |
Hi, I'm having a bit of a problem outputting to a file. I am trying to output each element of a list into a document on a new line and I can only get it to work when all the items in the list are on the same line. The … | |
Hello guys, I am new around here. Anyways, I am having a problem with reading some information from a text file. Sample text file: density = -1.0 number = 2004 Ok so what do I use in order to get the number -1.0 from the text file? Also, what if … | |
Hey guys, I'm making a platform game similar to Super Mario in Pygame and I want to add platforms i.e. I have a background picture that has platforms drawn on it. I then want to make it so he can only go down as far as the platform, and as … | |
Hello everyone, My file has lines like: >9|102396631|genome..... CCACTTTCTCTCCGCGCTGGGTTGAACATGGTACATCAGACTCCCTGAATCTGTCAGATC TCTTGGTTGCTGTTGACAACTAAGACTTCGGAGCCTGGAG_GATTTGTTGAGGGGGAGCA GTTCTGGGTGTCCTCTGCTGTGACTGGGCTCCCGGCCTCTTGATAATGCGCAACAGCTGC GGTAGAACATCTCATTCCCAG >9|102362951|ENSRNOS.... I want to delete blank lines from this file please help me... Thanks | |
How do I import a variable from another function in the same class [code=Python] class W(object): #my class def variable(self): #one of my functions f = 5 def printf(self): #what do i put here to import f from the function variable... #I'm currently working with python 3.1. #I know its … | |
Hello, I have an application written in python and Tk. My application is to be scriptable with python, i.e., the user gives a small piece of code written in python, and that is to be executed by my application in a different interpreter, with different set of local variables. I … | |
Hi All, I am using the below code to write into a text file [CODE] # Write into log file inp=file(Doc\Log.txt, 'w') inp.write('Log file start') inp.close()[/CODE] The text file 'Log.txt' is present in 'Doc' folder inside the application folder. Now I want to create a text file with a time … | |
If I wanted to save the binary information of an executable as a string object in a .py file what would be the easiest way to go about that without receiving null byte and EOF errors.. I've messed around with converting each char to its ordinal and then separating them … | |
this script give me a memory error in parse()...what is a memory error and how can i fix it? [code] import cgi class COM: def __init__(self): f=open('C:/site/commentlog.txt', 'r') self.lines=f.readlines() f.close() def writecom(self, post): f=open('C:/site/commentlog.txt', 'a') f.write(post) f.close() def getcom(self): try: form=cgi.FieldStorage() q=form.getvalue("posts") if q: writecom(q) return q except: return 0 … |
The End.