15,190 Topics
![]() | |
[CODE]'''Triangle generator''' totalRows = int(raw_input ("Please enter a number: ")) stars = totalRows for currentCol in range(1, currentRow+1): for currentRow in range(1, totalRows+1): print '*', print print for currentRow in range (1, totalRows+1): for currentCol in range(1, currentRow+1): print '* ' * stars stars -= 1[/CODE] Current output: [CODE] * … | |
Hello friends, I want to found some algorithms for text processing. I have a lots of entries in the database and now I want to split by category (news, history, sport, business etc...) but I don't know none algorithm(s) for text processing. So, my question is, what is the most … | |
I'm a noob, there got that outta the way. Wrote this to serve as a very basic inventory control for our store's iPad inventory. Lets junior employees count our inventory, and then appends the count in a text file. 99% there for what I want, but having trouble getting it … | |
Can any one help me solve this? I've been struggling for days trying to make a working .exe file from one of my python scripts... All of the problems have been with Tkinter. It works perfectly fine when I use it in my script, but when I use py2exe or … | |
Hi, I have a huge file (over 60 GB) which has lines in the following consistent format. "entry1";;"entry2";;"entry3";;"entry4";;"entry5";;"entry6";;"entry7";;"entry8";;"entry9";;"entry10";;"entry11" The problem is that a Few lines in this file have a line break precisely after the 3rd entry like this: "entry1";;"entry2";;"entry3\n ";;"entry4";;"entry5";;"entry6";;"entry7";;"entry8";;"entry9";;"entry10";;"entry11" I need to delete that extra newline and concatenate … | |
Hi there I have some problem in creating a code. I have two text files one of them is English to spanish.txt and the other is English to Italiani.txt. I have to create language translator to convert an English word to either an Italian word or a Spanish word. I've … | |
Hello! I would like to embed a terminal into a wxpython application where to print the outputs of the app (like Synaptic when installing Linux apps). I've been googling for a while but I found nothing. How can I do this with wxpython? Cheers! Dani | |
Hello! I am creating my first GUI with wxpython. It works right now, but I would like to tune it a little bit. My first issue is: how can I show the selected path/file beside browse button? I have uploaded the code, so you can figure out what I mean. … | |
[QUOTE]The actual file is as follows [/QUOTE] [CODE]>sp|P81928|140U_DROME 67 198 Tim17 8.9e-19 No_clan >sp|P20905|5HT1R_DROME 179 507 7tm_1 1.1e-97 CL0192 >sp|P28285|5HT2A_DROME 243 805 7tm_1 3.2e-73 CL0192 >sp|P28286|5HT2B_DROME 107 588 7tm_1 7.2e-82 CL0192 >sp|P13368|7LESS_DROME 439 520 fn3 1.4e-10 CL0159 1313 1380 fn3 3.4e-05 CL0159 1800 1890 fn3 3.6e-12 CL0159 2209 2481 Pkinase_Tyr … | |
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 … | |
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 - … | |
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 … | |
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 … | |
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 … | |
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 … | |
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]>>> … | |
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: … | |
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) … | |
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 … | |
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. | |
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 … | |
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']. … | |
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 | |
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 … | |
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 … | |
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', … | |
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 … | |
[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? | |
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] … | |
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 … |
The End.