3,386 Posted Topics

Member Avatar for Ancient Dragon

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?

Member Avatar for TrustyTony
0
181
Member Avatar for G_S

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, …

Member Avatar for TrustyTony
0
3K
Member Avatar for rhowell

Are you not in possession of the original fortran code to regenerate the code with current version?

Member Avatar for rubberman
0
433
Member Avatar for jemz

> 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.

Member Avatar for Lucaci Andrew
0
319
Member Avatar for dwhite12
Member Avatar for Lucaci Andrew
0
249
Member Avatar for G_S

Probable result should be that everything else is left as is but python3 shortcut will point to newly installed Python3.2 not Python3.1

Member Avatar for G_S
0
180
Member Avatar for G_S

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, …

Member Avatar for G_S
0
287
Member Avatar for tunisia

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.

Member Avatar for TrustyTony
0
216
Member Avatar for poloblue

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.

Member Avatar for TrustyTony
0
213
Member Avatar for bufospro

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.

Member Avatar for TrustyTony
0
181
Member Avatar for auto_1

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.

Member Avatar for TrustyTony
0
223
Member Avatar for wschamps42

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.

Member Avatar for TrustyTony
0
132
Member Avatar for kace91

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.

Member Avatar for TrustyTony
0
2K
Member Avatar for TrustyTony

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 …

Member Avatar for TrustyTony
0
298
Member Avatar for carrot_123
Member Avatar for TrustyTony

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.

1
275
Member Avatar for LatSo

> 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 …

Member Avatar for LatSo
0
712
Member Avatar for floatingshed
Member Avatar for tony75

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.

Member Avatar for TrustyTony
0
240
Member Avatar for b.prog

Did you check my code snippet http://www.daniweb.com/software-development/python/code/360113/tkinter-for-console-getkey-pauserestartquit ?

Member Avatar for TrustyTony
0
125
Member Avatar for indiang

No need for re, just use split, rsplit and strip methods of strings (or partition)

Member Avatar for TrustyTony
0
243
Member Avatar for indiang
Member Avatar for new_developer

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 …

Member Avatar for TrustyTony
0
14K
Member Avatar for Albino

I do not, however, see how this parameter scheme is better than passing the array as whole by reference to the checker.

Member Avatar for Albino
0
366
Member Avatar for KY_Fan

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.

Member Avatar for sneekula
0
201
Member Avatar for ido098
Member Avatar for abhilam

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 …

Member Avatar for TrustyTony
0
183
Member Avatar for huynhminhsang
Member Avatar for TrustyTony
0
1K
Member Avatar for heinlein_

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

Member Avatar for vegaseat
0
251
Member Avatar for 4evrmrepylrning
Member Avatar for Alexispap

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.

Member Avatar for TrustyTony
0
1K
Member Avatar for Taniya19

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 …

Member Avatar for TrustyTony
0
168
Member Avatar for marcin19962
Member Avatar for marcin19962
0
399
Member Avatar for zaphoenix

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 …

Member Avatar for HiHe
0
154
Member Avatar for cyberbemon

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 …

Member Avatar for cyberbemon
0
1K
Member Avatar for satnav_8

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?

Member Avatar for TrustyTony
0
2K
Member Avatar for ericstern

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.

Member Avatar for ericstern
0
247
Member Avatar for fatalaccidents

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 …

Member Avatar for fatalaccidents
0
381
Member Avatar for abhilam

Use string slicing for ends of data lines, split the numbers and convert to numeric form.

Member Avatar for snippsat
0
732
Member Avatar for hughesadam_87

>>> 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'] >>>

Member Avatar for snippsat
0
188
Member Avatar for CoatsyJnr

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

Member Avatar for TrustyTony
0
58
Member Avatar for treyb

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.

Member Avatar for treyb
0
156
Member Avatar for zemzela
Member Avatar for Schol-R-LEA
0
282
Member Avatar for graydog8josh

Give starting directionary as initialdir passed to the function as parameter, return current directory as value from function and save in caller, no globals.

Member Avatar for graydog8josh
0
674
Member Avatar for giancan

> 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č

Member Avatar for giancan
0
1K
Member Avatar for TrustyTony

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: …

0
784
Member Avatar for daniel36

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

Member Avatar for TrustyTony
0
114
Member Avatar for Ouss

Do you mean [variance explained](http://en.wikipedia.org/wiki/Explained_variation)?

Member Avatar for TrustyTony
0
58
Member Avatar for crag0

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.

Member Avatar for TrustyTony
0
297
Member Avatar for memomk
Member Avatar for memomk
0
962

The End.