3,386 Posted Topics
Re: shouldn't it be [CODE] response = urllib2.urlopen(self.areaa.GetValue()) [/CODE] urlopen does not know anything about wx.TextCtrl widgets. Check your naming of things and using of empty lines. You should also let wx handle the suitable size of widgets and not use absolute positioning and sizing ([URL="http://www.daniweb.com/software-development/python/threads/128350/623598#post623598"]sizers[/URL]). | |
Re: Is input shown [B]in the assignment[/B] red? i think you have other problem, but as you do not post your complete code, we can not know what. | |
Re: Use module [url]http://pypi.python.org/pypi/keyring[/url] | |
Re: You must put two nested loops not two separate ones. | |
Re: I have posted code for just a case as it is quite typical case: [URL="http://www.daniweb.com/software-development/python/code/289548"]Picking piece of string between separators[/URL] Also it is simple to get these pieces by regular expression using the re module. You then must take care that greedy matching does not take the first beginning separator … | |
Re: As I know you use Python 3.2.2, it is good to use ttk themed widgets, documentation is here: [url]http://docs.python.org/py3k/library/tkinter.ttk.html?highlight=ttk#tkinter.ttk[/url] | |
Re: use [iCODE]number, digit= divmod(number, 10)[/iCODE]. Continuation condition should be [iCODE]while sum(digits) > 9:[/iCODE] [CODE]>>> number = 123456 >>> while number: number, digit = divmod(number, 10) print digit 6 5 4 3 2 1 [/CODE] | |
Today advertisement is overflowing the first message, like earlier version of Nokia browser, where quoted message is overflowing the new message. | |
I get old search result when clicking the menu bar on bottom of the window. I would also much appreciate one word text or iconic menu for mobile phone browsers once the bug is fixed. To reproduce (Platform WindowsXP, browser Firefox 4.0.1) I click New Posts after clicking Python Forum, … | |
Very trivial program which could be thought as conclusion from the Quiz posts (thanks Gribouillis for inspiration for format) | |
Re: Sure, when you show your code and tell about your problems. Do not forget to push the CODE before pasting your code. Happy coding! | |
Re: Looks like you are putting data to bins: [url]http://www.daniweb.com/software-development/python/code/373120[/url], just integer data and self-defined bins. Numpy should handle it with ease. | |
Looks like every single thread gets double tweeted immediately by one guy (in software development), see attached sample. | |
Re: You could combine reading in and comparison so you save replacement instead of the searched one to memory record during the read. Then you do not need to move string arrays in memory, only allocate space for the array and write it out after scan and replace. | |
There was question about encryption in Delphi/Pascal forum and a guy was suggested reversing the bits as additional step (I do not know if he in reality meant XOR 255, that is making 0's 1's and vice versa). As it keeps still same distribution of letters I suggested as better … | |
Re: You came to right place, this forum have loads of 'sticky thread' which are shown in beginning of threads organised our dear moderator and mentor vegaseat, starting with [url]http://www.daniweb.com/software-development/python/threads/20774[/url]. Of course for information to solve these, you should use good tutorial like one in python.org and maybe also book like … | |
Re: Use Python commands, like os.listdir(os.curdir), not system commands. Better you make code in Python for whole thing which is goal of your commands. Also you should use subprocess if you do need to run a command: [url]http://jimmyg.org/blog/2009/working-with-python-subprocess.html[/url] | |
Dig up this for discussion thread request and some Googling. By little experiment found the different forms for sending message commands. Could no send in Python3 the code of program itself so only simple test "Hello". Sorry that subject is left incorrectly refering program name. | |
Re: r'C:\*.*' not inside the quotes. See [url]http://www.tutorialspoint.com/python/python_strings.htm[/url] for all about strings. | |
Re: Have you by the way seen [url]http://www.daniweb.com/software-development/python/threads/128350/1545337#post1545337?[/url] | |
Re: Unfortunately your encruyption is very weak, as it uses sequence of three operations to map single letters to single letters keeping the letter frequencies of the original message. These could be replaced by doing a single lookup table for each non-ascii letter value 0..255 and for each possible shift for … | |
Re: Maybe you would need to switch over to pySide (aka pyQT) or wx toolkits. They have more complicated formatting available. Here is example of superscript used for printing polynomials in main text box using FancyText of wx: [url]http://www.daniweb.com/software-development/python/code/322922[/url] | |
Re: I can not speak of everybody, but for me impression of your design looks overcomplicating simple things by bad design joices. I do not see why you need threads, how long running the processes are. Examples you have shown look simple input forms, but maybe you have long running database … | |
Re: I recommend good tutorial on Python or book. This looks good for me (even as programmer, I learned from tutorial [url]http://docs.python.org/tutorial/index.html[/url]) [url]http://diveintopython.org/[/url] | |
Re: And of course that other guy should have rights to read your memory block and access to the system in first place. | |
Re: You can post code in zipped file, once you push th [B]Go Advanced[/B] or reply by [B]Use Advanced Editor[/B], attached to your post, email communication is not according to rules, as it excludes others from discussion. | |
Here is example how data can be summed to dictionary or you can use numpy.histogram to sum the data as weights of the categorized data. | |
| |
Re: I got this way also right mouse event visible, but mouse wheel still not and middle event came from 'chord middle' ie both left and right down simultanously: [CODE]from visual import * myscene = display(title="test",width=500,height=320) myscene.userspin = myscene.userzoom = False status = label(text="test",color=(1,0,0)) while True: rate(100) for count in range(myscene.mouse.events): … | |
Re: [QUOTE=pyguy62;1639890]preferred method: [CODE] dcheck() [/CODE][/QUOTE] Thanks for your helping spirit, but now you are giving terrible example, and as this is present in most of your code I think you need some beating to learn the do of Python. So I will analyse this piece of code (changing it better), … | |
Re: [url]http://docs.python.org/library/email-examples.html[/url] | |
Re: Do [URL="http://wiki.python.org/moin/Generators"]generator [/URL]for paragraphs and do re.search in each of those separately. | |
Re: Something like this: [CODE]from itertools import product a = [5,3,1] b = [6,5,2] c = [2,0,-2] def valid(*args): """ define the requirement here""" print('Checking: ', args) return args[0] == min(args) print(next(comb for comb in sorted(product(a, b, c), key=sum, reverse=True) if valid(*comb))) [/CODE] | |
Re: Small typo I think: if lines.strip().startswith("**HM", "**HW"): should be [CODE] if lines.strip().startswith(("**HM", "**HW")):[/CODE] And same way you can use: [CODE]elif not under and line_strip.endswith(("S1", "S2", "S3", "S4", "S5", "S6")):[/CODE] and the not under you can eliminate if you move the branch one down after [CODE]elif under:[/CODE] | |
I finally modernized this code. It is very primitive, but it is nice to have basic version, even it does a lot of mistakes. You could add features, like repetition elimination, or you can check the compete chatbot: [url]http://www.jezuk.co.uk/cgi-bin/view/software/whereskal[/url]. | |
Re: Are you sure extension is same, you could for example have html registered for firefox and htm for ie? | |
| |
Re: I would not first of all use dict as variable as it hides built in type dict. | |
Re: You mean infinite recursion from line 42 until deck become empty in line 58? Do loop in main program, do not put looping inside the class. Would be easier to advice if I would know which rules you are trying to apply. | |
Re: Before re experts start to give they advices I give the standard answer for HTML: Don't, use for example BeautifulSoup module instead. | |
Re: From [url]http://www.techterms.com/definition/iteration[/url] [QUOTE]Iteration is the repetition of a function or process in a computer program. Iterations of functions are common in computer programming, since they allow multiple blocks of data to be processed in sequence. This is typically done using a "while loop" or "for loop" (see the examples below). … | |
Re: Writer of the code should know what he is planning to do. | |
Re: You are not setting variables from command output but return value of system call function, which should be set from commands error code. I would not use system codes but check for example existence of mount point sda18 directory in /media directory in my Ubuntu distributions case. | |
Re: Works here in Python 2.6.6. Output: [CODE]work - Use a work breakdown structure for a large project. [/CODE] Of course you do not need re if you do not want to, for example for simple searches of given exact word: [CODE]# finding a search word fname = "SearchFile.txt" word = … | |
I was not happy of solution [url]http://chaos.weblogs.us/archives/331[/url] for one line Ceasar cipher, so I wrote my own version without import by using raw_input (change to input for Python3). Chance to play little with memoryview object also. Crypt: give displacement amount for shift Decrypt: give -displacement amount shift | |
Re: You are telling to round to 3 decimals in second. | |
Re: Check it out, what is ab? It is one global instance of Addressbook? Which class searchfor belongs, isn't it Adressbook class? Shouldn't you refer the class instance as self (again), not ab? | |
Re: Do you mean the command window which comes when you run files ending with .py and which do not show when you change extension to .pyw or run it with pythonw.exe otherwise? | |
Re: Do you mean searching for first letter of word: [CODE]re.findall('\s\w', r"For example how would I find \s\w within a string and then change that character?")[/CODE] | |
Re: I do not know if you use Python2 or 3, but reacent verions can use print function like this [CODE]from __future__ import print_function with open("formatted_numbers.txt", 'w') as outfile: print('%.3g, %2.3f' % (123.4, 123.4), file=outfile) [/code] |
The End.