3,386 Posted Topics
Re: Quess it is not common usage scenario, but actually you can have many edits of messages on same page of thread... sorry article.... open simultanously. But how about kind of your advert fade out style dimming of other parts of window when editing is in process? | |
Re: See [url]http://diveintopython3.org/porting-code-to-python-3-with-2to3.html#apply[/url] how you must recode apply. The first function working both in Python 3 and Python 2 (with expanded text to see scrollbar in action): [CODE]try: from Tkinter import * except ImportError: ## Python 3 from tkinter import * root = Tk() class App: def __init__(self,master): scrollbar = Scrollbar(master, … | |
Re: Are you not in possession of the original fortran code to regenerate the code with current version? | |
Re: > What's the core of professional software development? Answer: documentation. That is surely important, but for me the thinking organized way and ability to analyze logically things goes first. | |
Re: > for line in files: It does not make sense to call filename line. Your indention is incorrect. | |
Re: Probable result should be that everything else is left as is but python3 shortcut will point to newly installed Python3.2 not Python3.1 | |
Re: By 2to3 to remove the apply, fixing the inconsistent space/tabs and Changing the main to create CustomListBox: [CODE]try: from tkinter import * except ImportError: from Tkinter import * class CustomListbox(Frame): def __init__(self, master, lists): Frame.__init__(self, master) self.lists = [] for l,w in lists: frame = Frame(self); frame.pack(side=LEFT, expand=YES, fill=BOTH) Button(frame, … | |
Re: Easier would be just find out what the Perl code is trying to do. I have suspicion that it is overly complicated way to do something easy to do in Python. One suspicious thing is that you use in in Python when I see eq in Perl. | |
Re: You have numerous problems, including that you do not reset col and row to zero in your while versions and you are not entering the while because you allow only negative row and col values. You are not also closing the file for input. | |
Re: Besides the joke above, the rules of this forum require to give evidence of trying to solve the problem yourself. So go ahead and post your code and errors you are encountering. | |
Re: Better, but the video on Python3 vs Python2 talked on using eval to imitate dangerous input function of Python2 and has videos absolutely not even remotely connected to OP's request. | |
Re: Looks correct, provided unsigned int is 32 bits (of course it could be 16 bits or 64 bits also). I would at least use unsigned long, which is at least 32 bits, and check sizeof (unsigned long), the swap operation is length dependent. | |
Re: Why don't you code the long division like you would do on paper? You must consider handling of remainder also. Usually you should stick to using self as instance referencing parameter. You could use magic methods __add__ etc to extend normal operations to polynomial class. | |
Sometimes we want to tackle some problem specifying properties of sequence of numbers consisting the integer. Then it is usefull to have function to join many integers to make a long integer. Most efficient way for tight loops is to stay in integers domain and not go through the string … | |
Re: Why not then (voltage - 3000) / 12.0 | |
Finding efficiently primes, whose begining numbers are also primes. See the thread http://www.daniweb.com/software-development/cpp/threads/425821/prime-number-c in C++ forum for discussion on topic. | |
Re: > 10000-50000 Start with n number primes and extend them each to n+1 number primes by prime*10+k, where k is odd. Your number will be sequence of only 1, 3, 7 and 9, naturally, except first number is 2,3,5 or 7 (1 is not prime). Even 5 and 7 are … | |
| |
Re: You are not saving the books file which you read as one string at line 3 anywhere. Why are you splitting then input from user for title from '/'? Your example seems not allow '/' in title as it separates author from title. | |
Re: Did you check my code snippet http://www.daniweb.com/software-development/python/code/360113/tkinter-for-console-getkey-pauserestartquit ? | |
Re: No need for re, just use split, rsplit and strip methods of strings (or partition) | |
Re: How is Occupant similar to Room, I do not understand. | |
Re: I am a simple man so I prefer just simple multiplication: #include <iostream> using namespace std; int together(int a, int b) { int magnitude = 1; while(magnitude <= b) magnitude *= 10; return magnitude * a + b; } int main() { int a=99,b=10; cout << together(a,b) << endl; return … | |
Re: I do not, however, see how this parameter scheme is better than passing the array as whole by reference to the checker. | |
Re: Which numbers? I only see you taking three string input and then concatenating them, assuming you are using python3 as indicated by form of your print statements. No use to define a function for only one print call. | |
Re: You are plotting same string from the last line twice and also you had x2 spelled originally with capital X. Maybe you should also plot other lines data, and maybe as numbers instead of string? Then you basically should convert to int or float each number after split and append … | |
Re: Post your code for real numbers, and we will see if we can help to improve it. | |
Re: This piece from [vegaseat's sticky](http://www.daniweb.com/software-development/python/threads/191210/python-gui-programming/) should get you started: http://www.daniweb.com/software-development/python/threads/191210/python-gui-programming/4#post1055261 | |
Re: You mean `*self.files_and_dirs`? | |
Re: what is your problem? At least you are calling instance non-standard way, event, instead of self, and you should not have global variables but instance variables. | |
Re: The code looked like missing include <algorithm> I managed to get the code running in my Code::Blocks, but the example given in document: **multi(7, 9, 4, 6)** and given by running the code ( 564327584) has different result than my naive factorial based Python code gives (**12760912164000**). My Python code … | |
Re: Insert code in your post, do not give external unfunctioning links! | |
Re: Something like: # A word count programme # Author why jay def main(): word = line = letters = 0 f_name=raw_input("Enter file here : ") with open(f_name ,'r') as f: for line, why in enumerate(f, 1): word += len(why.split()) letters += len(why) print "Number of lines,words,letters is : " ,line,word,letters … | |
Re: I have not unfortunately experience in this topic of programming, but as I browsed your code, I got wondering if you can mmap file which you just dumped to stdout and which is at end of file after the read? But then I saw those lines are never entered because … | |
Re: I do not understand why you have global declaration even you have not any functions, and why are you starting progress bar after finishing transfer and closing the transfered file? | |
![]() | Re: No for the multiprocessing module there is the Queue, here looks like being one example, improvement in comments. http://jeetworks.org/node/81 Notice that multiprocessing code must be run directly, it does not run correctly from IDLE. ![]() |
Re: Are you sure that it has not Python allready, it would be very rare beast indeed to have Linux and not Python. Nothing happens when you try to execute python? Could you not just uncompress binary distribution for Linux to your user directionary. Often ~/bin is included in path so … | |
Re: Use string slicing for ends of data lines, split the numbers and convert to numeric form. | |
Re: >>> s='hi my name is bill' >>> print ''.join(c for c in s if c.isalpha()) himynameisbill >>> print [c for c in s if c.isalpha()] ['h', 'i', 'm', 'y', 'n', 'a', 'm', 'e', 'i', 's', 'b', 'i', 'l', 'l'] >>> | |
Re: Did you check our code snippets archive for examples (like my http://www.daniweb.com/software-development/python/code/396358/turtle-graphics-histogram) or do search by the search box at top of the page for 'turtle python' There is also demo of using the module with the module: http://www.daniweb.com/software-development/python/threads/420767/turtledemo.py/2#post1796264 | |
Re: How you find the directory names? You are issuing the command to highest level old directionary only not for individual files, don't you? fname1 is misleading name for path name. | |
Re: I do not see your code and also you did not explain your problem/errors. | |
Re: Give starting directionary as initialdir passed to the function as parameter, return current directory as value from function and save in caller, no globals. | |
Re: > u'\u010d' This seems not to be in latin1 set of characters but is in utf8 (as it is way to encode all unicode characters) >>> w = 'abc'+u'\u010d' >>> with open('t.txt', 'w') as out: out.write(w.encode('utf8')) out.write('\n') >>> print unicode(open('t.txt').read(), 'utf8') abcč | |
We can run Python2 script in most simple cases if we just use the 2to3.py script found in recent Python versions: F:\Python27\Tools\Scripts>copy \test\output_window_tk.py \test\output_window_tk2.py 1 tiedosto(a) on kopioitu. F:\Python27\Tools\Scripts>2to3.py -w \test\output_window_tk.py RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: … | |
Re: Here is one in Javascript: http://scripts.hashemian.com/js/countdown.js Similar should be possible with PHP also like here http://www.brighthub.com/internet/web-development/articles/9471.aspx | |
Re: Do you mean [variance explained](http://en.wikipedia.org/wiki/Explained_variation)? | |
Re: For record I also posted as one of my first code snippets http://www.daniweb.com/software-development/python/code/282009/watch-for-change-of-files-in-directories It is long time ago and surely not most efficient, but it does work. | |
Re: I do not know answer to your question but you are refering to undefined variable z at line 19. |
The End.