15,181 Topics

Member Avatar for
Member Avatar for parijat24

hi, I am again involve in solving one trivial problem , that is I have a text file in which large number of entry are there like proteinid[COLOR="red"][/COLOR] sp|P13368|7LESS_DROME fn3 fn3 fn3 Pkinase_Tyr sp|P14599|A4_DROME A4_EXTRA APP_amyloid sp|P09478|ACH1_DROME Neur_chan_LBD Neur_chan_memb sp|P17644|ACH2_DROME Neur_chan_LBD Neur_chan_memb sp|P04755|ACH3_DROME Neur_chan_LBD Neur_chan_memb sp|P25162|ACH4_DROME Neur_chan_LBD Neur_chan_memb sp|P16395|ACM1_DROME 7tm_1 …

Member Avatar for parijat24
0
127
Member Avatar for danholding

hiya guys n girls, i am making a prgram where it sorts a list of files and pulls the 6 most recent files.. that is fine but i need it to pull 6 different dates ie... (this is what it does now test1 - 24/06/10 test2 - 24/06/10 test3 - …

Member Avatar for danholding
0
145
Member Avatar for pythonbegin

Dear all I have two text files. file1 with 42000 rows and 6 columns and file2 with 18 rows and 1 column. I want to match the entries in file2 with file1 either in column0 or in column 3. if the entry exist in any column. Write that line to …

Member Avatar for griswolf
0
135
Member Avatar for vegaseat

This code sample shows how to represent employee data as a list of dictionaries. This list can be sorted and grouped by dictionary keys. In this particular example, I demonstrate how to calculate each department's average age from the data after sorting and grouping. The code is heavily commented to …

Member Avatar for shahjapan
1
6K
Member Avatar for emchom

I have a question that i have to solve and that is to create a program that will calculate the surface are of somebodies body, then to calculate how much sunscreen they will need to cover their entire body using functions. This is what i have so far but i …

Member Avatar for Beat_Slayer
0
200
Member Avatar for emchom

I am needed to create a program that could be used by judges judging a diving competition, where there is 7 judges and the lowest and highest scores are removed and the average is then calculated. this is what i have so far however it does not work. Can anyone …

Member Avatar for Beat_Slayer
0
1K
Member Avatar for Joeflims

Hello. I am a n00b learning to code in Python. Right now, I am working on functions and parameters. To practice, I am making a simple Celsius-to-Farenheit converter. However,whenever I run the program it returns a NameError. I am confused in my n00bishness. Please reply. Here is my code: [CODE]>>> …

Member Avatar for Joeflims
0
128
Member Avatar for student_

here is the code: [code=python] def main(): totalBudget = 4000 printOptions() option = input("What would you like to do? ") while option != 5: if option == 1: newExpence = addExpence(totalBudget) totalBudget = totalBudget - newExpence printOptions() option = input("What would you like to do? ") elif option == 2: …

Member Avatar for student_
0
146
Member Avatar for ultimatebuster

I currently have the budget to buy an intermediate to advanced python. The books price has to be below $50 (Canada), if possible, unless it's a really good book. Preferably there should be GUI programming in the book (not TK or QT, GTK or other toolsets preferred). Network programming (Socket) …

Member Avatar for Beat_Slayer
0
163
Member Avatar for PythonNewbie2

I've been googling for almost two hours now trying to find a solution, but I haven't come across anything that works yet. I followed this guide EXACTLY: [code]http://bytes.com/topic/python/insights/580045-simple-guide-using-py2exe[/code] but no results. When I run my setup.bat, a window comes up and disappears quickly. No new directories are created but I …

Member Avatar for Beat_Slayer
0
139
Member Avatar for trakyng

Hello i want to know how to edit the console font, width and height. If there is any script, could you post it?. And thanks.

Member Avatar for trakyng
0
83
Member Avatar for cleve23

Hi all, I currently working on a python program with the use of wxpython to make out a gui application. However, i wish to compile my application to be like a standalone application where people can just get the .exe file and run it without installing python and wxpython. I …

Member Avatar for snippsat
0
112
Member Avatar for techie1991

I want to sort a list of dictionaries using the inbuilt sort() function for lists. The problem is I am not able to understand, how to give the function a key.. Example: [CODE] a={'name':1,'data':200} b={'name':2,'data':400} c=[a,b] [/CODE] Now, I want to sort the list c with the key being a['name']. …

Member Avatar for TrustyTony
0
227
Member Avatar for rehber344

hello every one for example ıf we say a=None if is it same thıng ? ===> if a orrrr if a is None and the reaction of the code is it same thansk ın advance

Member Avatar for redyugi
0
68
Member Avatar for danholding

hey guy n girls i hope one of you can help me with this. plan of action is to : create a python script to... sort a list of files from a directory into sorted list with most recent modified date at the top. then I want to get rid …

Member Avatar for danholding
0
202
Member Avatar for ak_barik

When runnning scapy from command prompr (windows XP), the output cannot be stored. When the following command is executed in command prompt: scapy >C:\dir.txt The following error shows up: C:\automation\atg\GeneralFiles?_AC\ScapyExe?>scapy >C:\dir.txt INFO: Can't import python gnuplot wrapper . Won't be able to plot. INFO: Can't import PyX. Won't be able …

Member Avatar for Beat_Slayer
0
446
Member Avatar for ak_barik

I am trying to convert a testtoexe.py (which imports scapy and paramiko) file to exe. I am running Python2.6 (in PythonWin?) on Windows XP. I am using pyinstaller1.4 I am able to convert the .py to .exe, but..... I get the following error when I run the exe: C:\automation\createexe\dist>testtoexe.exe ['C:/DOCUME~1/arinc/LOCALS~1/Temp/_MEI4842', …

0
75
Member Avatar for patkeraudren

In my projet, I can't find how to determine which image and pixel coordonate when I clicking image in 2 different ScrollArea. The result was showing in statusBar() area. (See screenshot) I put a code in txt file with 2 jpg use with it. Thanks in advance. [CODE] from PyQt4.QtCore …

0
95
Member Avatar for -ordi-

[CODE]print divmod(1024, 26) # 39[/CODE] [CODE]print chr(39 + ord('A') - 1) # g[/CODE] but: AA, AB etc, how to convert this to number?

Member Avatar for TrustyTony
0
125
Member Avatar for monstercameron

i had an idea to make my own file formats but... have nearly zero coding experience. the image is just text which a program would parse and receive relevant pixel data from it(like xml based stuff). i wrote up some plan for the file: [CODE] `meta data [(title)test image] [(date)1,1,2010] …

0
317
Member Avatar for acrocephalus

Hello! I have created a dialog to select a file with wxpython and FileBrowseButton with this code. [CODE]fbb = wxfbb.FileBrowseButton(panel,labelText="Select an image file:", fileMask=mask, fileMode=wx.OPEN, size=(800,30)) markFile = fbb.GetValue()[/CODE] I need to use the selected file for further actions. How can I do it? I have tried [CODE]return markFile[/CODE] but …

Member Avatar for acrocephalus
0
589
Member Avatar for flebber

I am looking at a project that will import and modify an XML file and then export it to a table. Currently a flat file table system should be fine. I want to export the modified data to the table and then perform a handful of maths(largely simple statistical functions) …

Member Avatar for Beat_Slayer
0
92
Member Avatar for Krstevski

Hello friends, I have a small problem, I don't know how to configure the server to run python scripts automatically every 1 hour. I use Ubuntu LTS OS, Apache2 server and now I want every 1 hour to run read_rss.py Python script automatically. Do it possible with apache (and if …

Member Avatar for ryan461
0
106
Member Avatar for Tommymac501

Pyscripter seems to be hard coded to use versions 2.3 to 2.6, and skips over 2.7, moving on to 3.0 and 3.1 - niether which seem to play nice with Unix data. Considering 2.7 is Python.org's current stable release, does anyone know how to get Pyscripter to use it? I've …

Member Avatar for pyscripter
0
413
Member Avatar for KirkK

In this scenario, I have two issues; 1) Why is selection 4 not taking me to exit the program variable? 2) Why is selection 2 telling me I went backward? Thank you in advance! #start and display menu def main(): #fuel fuelUsed = 0 fuel = int(200) feet = int(0) …

Member Avatar for TrustyTony
0
89
Member Avatar for JDuch

I would like to save the output of the python help() function to a file eg the output of >>> help("modules") [CODE] amongst others i used modfile = open("env:.P_ModList","w") mods = help("modules") print >>modfile , mods modfile.close() [/CODE] to no avail. Is there a solution?

Member Avatar for vegaseat
0
1K
Member Avatar for Beat_Slayer

Aproach to the implementation of K-Nearest Neighbor (KNN) using the Euclidean algorithm. Sample Usage: [CODE]mywork = Words_Works() lit = 'literature.txt' mywork.add_category(lit, 'Literature') # adding files as category comp = 'computers.txt' mywork.add_category(comp, 'Computers') phy = 'physics.txt' mywork.add_category(phy, 'Physics') # saving categories dictionary to file mywork.save_categories() # can be loaded calling load_categories() …

Member Avatar for Beat_Slayer
0
792
Member Avatar for plasticfood

[CODE]import wx class bucky(wx.Frame): def __init__(self,parent,id): wx.Frame.__init__(self,parent,id,'Frame aka window', size=(400,300)) panel=wx.Panel(self) status=self.CreateStatusBar() menubar=wx.MenuBar() first=wx.Menu() second=wx.Menu() first.Append(wx.NewId(),"new window") first.Append(wx.NewId(),"Open...") menubar.Append(first,"File") menubar.Append(second,"edit") self.SetMenuBar(menubar) if __name__=='__main__': app=wx.PySimpleApp() Frame=bucky(parent=None, id=-1) Frame.Show() app.MainLoop() [/CODE] when i run this program, i get a "self is not defined in status=self.CreateStatusBar()". so i erased that part, and it …

Member Avatar for plasticfood
0
151
Member Avatar for student_

I am trying to make a program which so i can put in orders and have shopping and handling calculated the problem is, each time i run the program there will be a different number of people placing an order, how would i set up a loop that on each …

Member Avatar for vegaseat
0
286
Member Avatar for JDuch

""" Hi i intended to list the built-in function using this function. It seems however to give me the results corresponding with a dictionary. Why is that ? """" [CODE] def showbuiltins(): """ saves the list of built in functions to a file you chose """ blist = dir(__builtins__) print …

Member Avatar for JDuch
0
186

The End.