3,386 Posted Topics

Member Avatar for Cupidvogel

Yes you need CherryPy/webPy stuff to use Python in files or you can do Python script outputting Html statements, but then you would end up reinventing the wheel. For shell scripting I think IPython is quite interesting: [url]http://ipython.org/ipython-doc/rel-0.11/whatsnew/version0.11.html[/url]

Member Avatar for Cupidvogel
0
213
Member Avatar for WASDted

Problem + Effort + DaniWeb = Learning For F1 click Daniweb -> Create new thread I was part of problem now solution -- Member of Month DaniWeb

Member Avatar for Netcode
0
989
Member Avatar for paraclete

Here is something to get you started: [CODE] # imports (None) # global data days_in_months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] days_before = dict((m, sum(days_in_months[:ind])) for ind, m in …

Member Avatar for paraclete
0
227
Member Avatar for pythonhelp11

You try to use comma instead of colon for string slice. Why you don't use for loop to iterate input list?

Member Avatar for woooee
0
427
Member Avatar for d3fined
Member Avatar for TrustyTony
0
182
Member Avatar for vegaseat

You producing random numbers inside tight loop. You should produce data ready in main code not to mix up timing.

Member Avatar for Skrell
1
4K
Member Avatar for Skrell

Luckyly you found DaniWeb and we have here our Dr. Gribouillis, who wrote us nice class to help us out: [url]http://www.daniweb.com/software-development/python/code/257449[/url] It uses subprocess.popen, the import is little hiding inside the class for encapsulation.

Member Avatar for Skrell
0
108
Member Avatar for computerchip

Clearly the lines 6 until 8 need work, debug this: [CODE]noCandidates = 3 names=[] for i in range(noCandidates): names.append(input("Candidate 1:", "Candidate 2:", "Candidate 3:")) print(i+1, names[-1]) # debug [/CODE] This does not even run first, as you get error: [CODE]>>> Traceback (most recent call last): File "I:\test\t_inp.py", line 4, in …

Member Avatar for TrustyTony
0
189
Member Avatar for lynn21

No, 10 squared is 100. And using E instead of in symbol is little confusing, 'in' whould be clearer. Check again.

Member Avatar for TrustyTony
0
240
Member Avatar for JoshuaBurleson

I do not know if this would be worth a try, it at least support newer 2.0 version also. This is a Google answer though, never used it. I do not know if it work for Python3. It has quite a few promising examples on the page, though. [url]https://github.com/ryanhorn/tyoiOAuth2[/url]

Member Avatar for TrustyTony
0
136
Member Avatar for computerchip

What is randomIndex =randrange(PeopleCount, VerbCount, AdverbCount, LocationCount, TimeCount) Supposed to mean does not make sense for me, and wouldn't it be easier to use random.choice from each list? Notice the (CODE) button on tool bar, next time push that beside pasting (I do not know how you got last ')' …

Member Avatar for computerchip
0
443
Member Avatar for ali13

I have not such old Python, but for me works normally in Windows: [CODE]# -*- coding: cp1252 -*- print(u"£") [/CODE] [CODE]Microsoft Windows XP [versio 5.1.2600] (C) Copyright 1985 - 2001 Microsoft Corp. I:\test>pound_sign_test.py £[/CODE]

Member Avatar for snippsat
0
470
Member Avatar for crazygamer49
Member Avatar for TrustyTony

The need for efficient storing of IP numbers came up in discussion thread. With help of this conversion to/from the 32 bit numbers that IP numbers (the old ones) represent I could push the time of finding unique IP numbers from 10 million random numbers down to under two minutes …

Member Avatar for mrkbbk
0
823
Member Avatar for The_Tiger
Member Avatar for Stefano Mtangoo
-1
61
Member Avatar for bdubb24

Welcome to post any Python related problems to Python forum, here you can discuss the RAPTOR stuff.

Member Avatar for fonzi
0
440
Member Avatar for Fireprufe15
Member Avatar for knightofsoshi

Here is a tutorial which looks about right, I am little rusty on this stuff myself. [url]http://www.learn-programming.za.net/programming_pascal_learn13.html[/url] Notice that in Pascal you can not do pointer arithmetic.

Member Avatar for AceStryker
0
247
Member Avatar for layr

I would just try to open any sure to be up url in try statement inside while True loop. In else statement of try I would put activity for internet open. Most likely a function call.

Member Avatar for TrustyTony
0
3K
Member Avatar for NewbieXcellence
Member Avatar for HaNcOoK

If you want to change the file you read the values, do changes in memory and save to file again. [CODE]import math class Grid(list): def __init__(self, cell_value=0, width = 10, height = 10): list.__init__(self, [[cell_value for _ in range(width)] for _ in range(height)]) self.cell_value = cell_value def save(self, fname): with …

Member Avatar for TrustyTony
0
152
Member Avatar for TrustyTony

I participated discussion about complex numbers and did some experiments in Python. I do not understand this behaviour (same behavious in 2.7.2 and 3.2.2): [CODE] >>> -(0+1j) (-0-1j) >>> -(0+1j)==-1j True >>> -(0+1j)+0 -1j >>> -(0+1j)-0 (-0-1j) >>>[/CODE] EDIT: Further investigation shows that there is -0.0 in Python, is this …

Member Avatar for Gribouillis
0
224
Member Avatar for jefroxnergal
Member Avatar for JoshuaBurleson

Are you sure you have monocrome bitmap, I thought it must be .xbm format. Did you try to put '@' in front of file name, some net places mention it. [url]http://epydoc.sourceforge.net/stdlib/Tkinter.Wm-class.html#wm_iconbitmap[/url] mention .ico only for default parameter for Windows.

Member Avatar for woooee
0
673
Member Avatar for Creatinas

Please do not handle HTML with regular expressions, use proper tools like Beautiful Soup [url]http://www.crummy.com/software/BeautifulSoup/[/url] Dictionary has only limit amount of memory, I think, here proof: [CODE]Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> big …

Member Avatar for Creatinas
0
244
Member Avatar for arindam31

The regex differs from globbing in that * and + modify previous symbol and any chatacter is . not ?. So p+ matches any number of p's at least one ie p, pp, ppp, .... Look for special symbols starting with \ to put suitable one between p and + …

Member Avatar for arindam31
0
244
Member Avatar for RoqueyB

You are using variable at line 5 and taking input at line 6, do you see anything wrong?

Member Avatar for RoqueyB
0
135
Member Avatar for Tyler212
Member Avatar for kuchi
Member Avatar for SpiritualMadMan

Many of us have done some experiments with pyQT4 and pySide. See vegaseat's GUI sticky thread.

Member Avatar for TrustyTony
0
104
Member Avatar for dnyansagar

You can use ordereddict if you want to remember the order of entry. Is your data in sorted like it looks? So you woild end up with ordereddict of dicts/ordereddicts/defaultdict(int) of counts of things.

Member Avatar for TrustyTony
0
401
Member Avatar for silvercats

Not book, but as you are using internet in order to participate this forum here is nowadays version in net: [url]http://computer.howstuffworks.com/[/url]

Member Avatar for silvercats
0
227
Member Avatar for MarcusMaximus

If you are running from Python2, you can do [iCODE]execfile[/iCODE] command from IDLE, but easier is just open the file and push F5 from IDLE. I am fond myself on conText text editor in Windows and invoking running script externally. IDLE sometimes disturbs function of programs, so at end it …

Member Avatar for TrustyTony
0
209
Member Avatar for JoshuaBurleson

You could store uncompressed bmp by the class that is in my mandelbrot snippet. There does indeed seem to be unofficial PIL existing for Python3: [url]http://stackoverflow.com/questions/3896286/image-library-for-python-3[/url] (as well as some alternatives)

Member Avatar for JoshuaBurleson
0
588
Member Avatar for Tyler212
Member Avatar for preet4fun

Short fix would be to return lambda, but that surely is not the cleanest way.

Member Avatar for TrustyTony
0
223
Member Avatar for paren8esis
Member Avatar for lynn21

[QUOTE=cwarn23;1653554]According to my extensive knowledge of math (below are the symbols at wikipedia) the two equations will yield two different results. The --> symbol is the same is the Assembly code "if xxxxxx then" where the xxxxxx is what is before the --> symbol. So by changing the if statement …

Member Avatar for lynn21
0
90
Member Avatar for ericoscarj
Member Avatar for Enalicho
0
111
Member Avatar for ande-s

CODE tags would help enormously to understand your code. Either select code first and click the button or (usually easier for me) click button and right after do paste. You might want to read this highly regarded blog about the module imaplib: http://www.doughellmann.com/PyMOTW/imaplib

Member Avatar for TrustyTony
0
266
Member Avatar for MooGeek

For me it would go long way just to daniweb to recognize mobile browser and leave out Forums, Threads words out of down menu, and maybe be able to move it up as touch screen control buttoms are down over the menu in Nokia E7 'Anna' update. Off course Home …

Member Avatar for Netcode
0
204
Member Avatar for huntin4hitters

You could also be looking prime factors instead of divisor. Prime factors of 12 are 2, 2 and 3, divisors are 1, 2, 4, 6 and 12. You must be clear what is the request.

Member Avatar for TrustyTony
0
120
Member Avatar for g_amanu
Member Avatar for TrustyTony
0
173
Member Avatar for TrustyTony

Learned about hook functions [URL="http://www.daniweb.com/software-development/python/threads/383164/1650339#post1650339"]for a thread[/URL] having problem with bad user input from the documentation. This is result which skips bad inputs.

Member Avatar for TrustyTony
0
950
Member Avatar for M09

You must program on your level raising it little by little. Can you give example of easy program you finished until working condition and hardest program you did until now? Have you not been able to finish any program? Have you done some programs suggested in sticky threads in begining …

Member Avatar for JoshuaBurleson
0
390
Member Avatar for pam1003
Member Avatar for TrustyTony
0
194
Member Avatar for Aprile79

I do not know how to estimate your effort, but here it goes: [CODE]diff = [(ind, s1, s2) for ind, (s1, s2) in enumerate(zip(seq1, seq2)) if s1 != s2] for info in diff: place = info[0] // 3 * 3 print('Difference at %3i triple starts from %3i: %r %r' % …

Member Avatar for TrustyTony
0
141
Member Avatar for Bosterk

I do not see problem running them by import from main script. This would not work if you need to run the modules multiple times. If that is case you must transfer the initializations to function which you can run as many times as you like. This with recervation that …

Member Avatar for Bosterk
0
514
Member Avatar for deepmala8

Maybe you would like to look this class simplifying the use of system command output: [url]http://www.daniweb.com/software-development/python/code/257449[/url] (Maybe you could benefit from reading my post linked in my signature)

Member Avatar for TrustyTony
0
148
Member Avatar for TrustyTony

Inspired by password entry discussions, I did this simple entry. You must of course find safe way to store the passwords, for example hashlib ([url]http://stackoverflow.com/questions/4820043/basics-of-python-encryption-w-hashlib-sha1[/url]) or [URL="https://www.dlitz.net/software/pycrypto/"]PyCrypto[/URL] and replace the simplistic example match for real life usage. The print at line 23 is just to check the attempts and to …

Member Avatar for Enalicho
0
10K

The End.