Re: wierd threading behavior

2005-10-14 Thread Sam Pointon
thread is a low-level threading module, and start_new is deprecated. Aside from that, thread.start_new(test.()) is syntaxically wrong (a pair of brackets can't follow a dot). However, your example does work for me once I fix the syntax, and it prints hello but then hangs. I can't explain the other

Re: Calling an exe from Python?

2005-10-16 Thread Sam Pointon
from subprocess import Popen proc = Popen('my_programme.exe') Use proc.communicate(input) to send input to stdin, and get a tuple of (stdout, stderr) back. If you need the returncode, use proc.poll() or proc.wait(), depending on if you want it to block or not. -- http://mail.python.org/mailman/l

Re: High Order Messages in Python

2005-10-22 Thread Sam Pointon
This can be suitably applied to Python with the use of Higher Order Functions, though. It's not quite the Ruby version because Python allows you to use functions as first-class objects, complicating the All-You-Can-Do-Is-Pass-A-Message philosophy. This is my 5-minute implementation: class HigherO

Re: index and find

2005-10-22 Thread Sam Pointon
>>> s = 'foobar' >>> s.find('z') -1 >>> s.index('z') Traceback (most recent call last): File "", line 1, in -toplevel- s.index('z') ValueError: substring not found Pretty self explanatory. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I sort these?

2005-10-28 Thread Sam Pointon
> unzip doesn't seem to work for me... It's not a part of the standard Python distribution, but this is a naive implementation (it doesn't react well to the list's contents having different lengths). def unzip(seq): result = [[] for i in range(len(seq[0]))] for item in seq: for in

Re: SNMP

2005-10-29 Thread Sam Merca
py wrote: > >From what I have seen Python does not come with an snmp module built > in, can anyone suggest some other SNMP module (preferably one you have > used/experienced)..I have googled and seen yapsnmp and pysnmp (which > seem to be the two most active SNMP modules). > > Thanks I've used py

Re: Pickling and unpickling inherited attributes

2005-10-30 Thread Sam Pointon
The reason the state of obj.A and obj.B aren't preserved is because your __getstate__ and __setstate__ don't preserve them - they only save obj.C, and you don't make a call to the parent class's respective methods. Here's what I mean: >>> import pickle >>> class Child(Parent): __slots__=[

Re: Pickling and unpickling inherited attributes

2005-10-30 Thread Sam Pointon
Of course, in __setstate__, there should be a tup = list(tup) as well - sheer forgetfulness and a confusing name in one. -- http://mail.python.org/mailman/listinfo/python-list

Re: mixin helper class for unknown attribute access?

2005-10-31 Thread Sam Pointon
One alrady exists, __slots__. >>> class Foo(object): __slots__ = ['bar', 'baz', 'qig'] >>> f = Foo() >>> f.foo = 'bar' Traceback (most recent call last): File "", line 1, in -toplevel- f.foo = 'bar' AttributeError: 'Foo' object has no attribute 'foo' >>> f.bar = 'foo' However, __

Re: Importing Modules

2005-11-02 Thread Sam Pointon
On the second point, a combination of sys.path, os.listdir and __import__ should do what you're after, although sifting through the whole of sys.path and subfolders from Python, rather than the interpreter itself, could be slow. (And it'll be redundant as well - __import__ will have do the same th

cPAMIE/Python String and Date Comparisons

2005-11-07 Thread Sam R
Hi, I am new to Python, and PAMIE has been a very useful tool for my website functionality testing. I was wondering if anyone knows how to do the following testcases with either PAMIE or Python. 1. Load a page http://www.prophet.net/quotes/stocknews.jsp?symbol=MSFT Verify that the string 'News for

Re: Multikey Dict?

2005-11-12 Thread Sam Pointon
return self.by_name[value] The alternative is to use some sort of database for storing these values. It doesn't really matter which (hell, you could even reinvent a relational wheel pretty simply in Python), as any DB worth its salt will do exactly what you need. Hope tha

Re: Hot to split string literals that will across two or more lines ?

2005-11-17 Thread Sam Pointon
> print "a string which is very loo" \ > + "ong." Minor pedantry, but the plus sign is redundant. Python automatically concatenates string literals on the same logical line separated by only whitespace. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to do "new_variable = (variable) ? True : False; " (php) on python?

2005-11-18 Thread Sam Pointon
Daniel Crespo wrote: > Hello to all, > > How can I do > > new_variable = (variable) ? True : False; > > in Python in one line? > > I want to do something like this: > > dic = {'item1': (variable) ? True-part : False-part} > > Any suggestions? > > Daniel There's a trick using the short-circuiting b

Re: Checking length of each argument - seems like I'm fighting Python

2005-12-03 Thread Sam Pointon
It depends what you mean by 'scalar'. If you mean in the Perlish sense (ie, numbers, strings and references), then that's really the only way to do it in Python - there's no such thing as 'scalar context' or anything - a list is an object just as much as a number is. So, assuming you want a Things

Re: regexp non-greedy matching bug?

2005-12-03 Thread Sam Pointon
My understanding of .*? and its ilk is that they will match as little as is possible for the rest of the pattern to match, like .* will match as much as possible. In the first instance, the first (.*?) did not have to match anything, because all of the rest of the pattern can be matched 0 or more t

Re: problems binding a dictionary

2005-12-10 Thread Sam Pointon
You're not 'exploding' the dict to the param1='blah' etc form - you-re actually passing it in as a single dict object. To solve this, add a ** to the front of a dict you want to explode in a function, just as you'd add a * to explode a sequence. -- http://mail.python.org/mailman/listinfo/python-l

Re: Question about consistency in python language

2005-09-08 Thread Sam Pointon
update updates the dictionary in place - it actually returns None, not the updated dict. However, you can construct a dictionary from a list of (key, value) pairs using dict(list). Example: >>>l = [('foo', 'bar'), ('baz', 'qig')] >>>d = dict(l) >>>print d {'foo': 'bar', 'baz': 'qig'} -- http://m

Re: Redundant code in multiple methods

2005-09-09 Thread Sam Pointon
How about using a class, with __call__, as a wrapper instead of the function itself? class FunctionWrapper(object): def __init__(self, cls, function): self._function = function self._cls = cls def __call__(self, *args, **kwargs): REQUEST = self.REQUEST SE

I can do it in sed...

2005-03-16 Thread Kotlin Sam
I have spent so much time using sed and awk that I think that way. Now, when I have to do some Python things, I am having to break out of my sed-ness and awk-ness, and it is causing me problems. I'm trying. Honest! Here are the two things that I'm trying to do: In sed, I can print every line be

Re: I can do it in sed...

2005-03-17 Thread Kotlin Sam
me. Thanks again, Lance Kent Johnson wrote: Kotlin Sam wrote: Also, I frequently use something like s/^[A-Z]/~&/ to pre-pend a tilde or some other string to the beginning of the matched string. I know how to find the matched string, but I don't know how to change the beginning of it

Re: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven wh

2005-04-19 Thread Sam Yorty
The only people who "know" they are going to heaven, clearly aren't <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > The reason some people don't know for sure > if they are going to Heaven when they die > is because they just don't know. > > The good news is that you can know for

Re: python and matlab

2014-02-06 Thread Sam Adams
On Thursday, February 6, 2014 8:55:09 AM UTC-5, Sturla Molden wrote: > Sam wrote: > > > is it able to utilize functions written in Python in Matlab? > > > > Yes, if you embed the Python interpreter in a MEX-file. Thanks Sturla, could you please explain in more det

Re: Array of Functions

2014-11-14 Thread Sam Raker
I second the call for a more concrete implementation, but if you want the results of the functions in c3 to be responsive to the values of c1 and c2 (i.e., if you change r1c1, r1c3 returns a different value), it might be worth encapsulating the whole thing in an object and making the c3 function

module import questions and question about pytest and module imports

2014-12-07 Thread sam pendleton
garage/ |- __init__.py |- cars/ |- __init__.py |- hummer.py tests/ |- test_cars.py at the top of test_cars.py, there is this: from garage.cars import hummer pytest is on this import statement, so i guess it's incorrect. what should it be? if i open a python repl

Re: module import questions and question about pytest and module imports

2014-12-08 Thread sam pendleton
Thanks for getting back with me! On Sun, Dec 7, 2014 at 11:26 AM, Dave Angel wrote: > On 12/05/2014 11:50 PM, sam pendleton wrote: >> >> garage/ >> |- __init__.py >> |- cars/ >> |- __init__.py >> |- hummer.py >> tests

Re: Does Python 'enable' poke and hope programming?

2013-08-01 Thread Sam Whitehead
I find myself doing this a lot with libraries whose documentation encourages an understanding based on intuition, rather than one based on formal concepts. When doing more 'pure' stuff with mostly the standard library, not so much. Most imperative languages let their users get kind of loose wit

Re: Having troubles with list methods

2013-08-01 Thread Sam Whitehead
Your indentation is such that the first print statement is the only thing inside the while loop. -- http://mail.python.org/mailman/listinfo/python-list

Hostrange expansion

2013-09-27 Thread Sam Giraffe
Hi, I need some help in expanding a hostrange as in: h[1-100].domain.com should get expanded into a list containing h1.domain.com to h100.domain.com. Is there a library that can do this for me? I also need to valid the range before I expand it, i.e., h[1*100].domain.com should not be accept, or ot

Re for Apache log file format

2013-10-08 Thread Sam Giraffe
Hi, I am trying to split up the re pattern for Apache log file format and seem to be having some trouble in getting Python to understand multi-line pattern: #!/usr/bin/python import re #this is a single line string = '192.168.122.3 - - [29/Sep/2013:03:52:33 -0700] "GET / HTTP/1.0" 302 276 "-" "

Re: Newbie question about text encoding

2015-02-26 Thread Sam Raker
I'm 100% in favor of expanding Unicode until the sun goes dark. Doing so helps solve the problems affecting speakers of "underserved" languages--access and language preservation. Speakers of Mongolian, Cherokee, Georgian, etc. all deserve to be able to interact with technology in their native la

Online offline Python apps

2015-04-23 Thread Sam Raker
Have you tried a conditional/try-catch block in your __init__? Something like class MyDBConn(object): def __init__(self, **db_kwargs): try: db = some_db.connect(**db_kwargs) except some_db.ConnectionError: db = my_fake_db()

Multiple thread program problem

2015-06-04 Thread Sam Raker
proc(f) isn't a callable, it's whatever it returns. IIRC, you need to do something like 'start_new_thread(proc, (f,))' -- https://mail.python.org/mailman/listinfo/python-list

Re: python command not working

2015-08-14 Thread sam . heyman
On Wednesday, April 22, 2009 at 8:36:21 AM UTC+1, David Cournapeau wrote: > On Wed, Apr 22, 2009 at 4:20 PM, 83nini <83n...@gmail.com> wrote: > > Hi guys, > > > > I'm new to python, i downloaded version 2.5, opened windows (vista) > > command line and wrote "python", this should take me to the pyth

Connecting Terminal to Python 3.5

2015-08-28 Thread Sam Miller
to python 3.5 so I can run python v3.5 within terminal? Thanks, Sam -- https://mail.python.org/mailman/listinfo/python-list

Re: Storing instances using jsonpickle

2014-09-03 Thread Sam Raker
1) There are, if you want to mess around with them, ways to make pickle "smarter" about class stuff: https://docs.python.org/2/library/pickle.html#pickling-and-unpickling-normal-class-instances . I've never worked with any of this stuff (and people don't seem to like pickle all that much), and

Pex import problems

2014-10-21 Thread Sam Raker
Hi all, I'm trying to use Pex (http://pex.readthedocs.org/en/latest/index.html) to include requests in a little script to ping a server from a machine that doesn't come with pip (or much of anything, really) installed. I'm running into problems outputting a pex file that depends on a local scrip

Re: Pex import problems

2014-10-21 Thread Sam Raker
On Tuesday, October 21, 2014 12:05:00 PM UTC-4, Chris Angelico wrote: > On Wed, Oct 22, 2014 at 2:34 AM, Sam Raker wrote: > > > (Also: anyone who's planning on chewing me out about formatting: I TRIED > > posting by email to comp.lang.pyt...@googlegroups.com, but it woul

Pex import problems

2014-10-21 Thread Sam Raker
Hi all, I'm trying to use Pex (http://pex.readthedocs.org/en/latest/index.html) to include requests in a little script to ping a server from a machine that doesn't come with pip (or much of anything, really) installed. I'm running into problems outputting a pex file that depends on a local script.

Masking a dist package with a copy in my own package

2012-01-20 Thread Sam Simmons
Hey all, I'm using twisted in a project and have run into a class that's in version 11.1 but not 8.2 in OSX. I was thinking to get it working for mac users I could just extract the 11.1 twisted package and through it under my package. e.g. project/ __init__.py twisted/ __init__.py ...

Re: Masking a dist package with a copy in my own package

2012-01-21 Thread Sam Simmons
I just installed 2.7... should have done this a while ago. pip finally works! Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Recording live video stream from IP camera issue

2013-02-06 Thread Sam Berry
just flashes an image instead of a video file, even though the .avi file is around 20mb. Is there some extra lines of code i need to include or change? Perhaps a timing option instead of a file size? Any help or insight would be much appreciated!! Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Recording live video stream from IP camera issue

2013-02-06 Thread Sam Berry
20mb of a picture and then nothing. Could you give any insight into how to record an mjpeg stream? External libraries for me to consider etc? Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Recording live video stream from IP camera issue

2013-02-06 Thread Sam Berry
look into OpenCV, thanks for the help! Sam -- http://mail.python.org/mailman/listinfo/python-list

OpenCV and WIFI IP Camera Issue

2013-02-14 Thread Sam Berry
7: # exit on ESC break When run, python tries to open the window to display the camera feed then closes before displaying the feed. Anyone have any ideas why? I read somewhere that there is an issue with this been run on windows? Any insight would be appreciated! Im all goog

Re: Recording live video stream from IP camera issue

2013-02-17 Thread Sam Berry
IP address http://192.168.1.72:1025/videostream.cgi?user=&pwd=&resolution=8. Did you have this issue? Is there some lines of code i may need to add? Any help would be appreciated! Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Recording live video stream from IP camera issue

2013-02-18 Thread Sam Berry
Thanks for the advice! I looked into it, seems using windows was an issue, switched to ubuntu and it worked! Just wondering if you have used opencv for recording purposes? Or if you know of any python documentation for opencv2? Information is hard to come by! Thanks again, Sam -- http

Python class and variable issue(newby question!)

2013-03-29 Thread Sam Berry
code would be very helpful! Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Sam Berry
Thanks for the responses! My issue was sorted with Benjamins post, just printing s worked. Cheers for the info though Chris, if i have any further issues il post them with some working code. Sam -- http://mail.python.org/mailman/listinfo/python-list

Threading within a GUI and OpenCV

2013-04-03 Thread Sam Berry
would be the way to go, or if there are alternative routes? A snippet from my code can be seen at (http://pastebin.com/9uFRjkgV) with a failed attempt of using threading! Any help would be appreciated. Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Line replace

2006-01-01 Thread Sam Pointon
>Hello > > I need some help > > I have a text file which changes dynamically and has > 200-1800 lines. I need to replace a line , this line > can be located via a text marker like : > > somelines > # THIS IS MY MARKER > This is the line to be replaced > somemorelines > > My question is how

Re: loops breaks and returns

2006-01-01 Thread Sam Pointon
rbt wrote: > Is it more appropriate to do this: > > while 1: > if x: > return x > > Or this: > > while 1: > if x: > break > return x > > Or, does it matter? I would pick the first form if that's the only place where x would be returned from the function. However, if the

Re: Regex anomaly

2006-01-03 Thread Sam Pointon
Would this particular inconsistency be candidate for change in Py3k? Seems to me the pos and endpos arguments are redundant with slicing, and the re.match function would benefit from having the same arguments as pattern.match. Of course, this is a backwards-incompatible change; that's why I suggest

Re: Spelling mistakes!

2006-01-07 Thread Sam Pointon
[EMAIL PROTECTED] wrote: > >> In fact, googling for "referer" and "referrer" reports a similar > >> number of hits, unlike most misspellings. > > Terry> You know, I almost mentioned that myself. Drives me crazy. > > Me too. I'm one of those people who, for better or worse, is a good > spel

Nested Dictionary Sorting

2006-11-06 Thread Sam Loxton
7;, {'ops': '80'}), ('2329490', {'ops': '50'})] I hope to sort these first keys by the value of the 'ops' key from highest to lowest value to give the following result: [('2329492', {'ops': '80'}), ('2329490', {'ops': '50'}), ('2329513', {'ops': 20.0})] Thanks in advance for any help, Sam. -- http://mail.python.org/mailman/listinfo/python-list

Re: multi split function taking delimiter list

2006-11-14 Thread Sam Pointon
7;, '+', 'c'] > > whats the python way to achieve this, preferably without regexp? pyparsing <http://pyparsing.wikispaces.com/> is quite a cool package for doing this sort of thing. Using your example: #untested from pyparsing import * splitat = Or(":=", "+") lex

Re: Pros/Cons of Turbogears/Rails?

2006-08-28 Thread Sam Smoot
fuzzylollipop wrote: > uh, no, Python predates Ruby by a good bit > Rails might be "older" than Turbogears but it still JUST went 1.0 > officially. Wow that's a lot of FUD, especially since you're beating up on Rails for it's docs and maturity, when I doubt (but couldn't prove) turbogears comes cl

Re: Coding style and else statements

2006-08-28 Thread Sam Pointon
Bruno Desthuilliers wrote: > foo = lambda thing: thing and thing + 1 or -1 The and ... or trick is buggy (what if thing == -1?) and bad style. If you -do- want a conditional expression, 2.5 provides one: thing + 1 if thing else -1 No subtle logical bugs, and a good deal more obvious. On the top

Re: Pros/Cons of Turbogears/Rails?

2006-08-31 Thread Sam Smoot
fuzzylollipop wrote: > I got my facts straight, Ruby is not tested in production environments. That's odd... it's running bank websites, credit-card processing, high traffic sites like ODEO and Penny-Arcade. Seems pretty "production" to me. > And I am speaking from a BIG internet site scale. Ye

Re: Setting "value" of an int-derived class

2006-09-02 Thread Sam Pointon
objects seemingley semi-randomly changing state, and Python's garbage collection systems are fairly good at picking up unused objects. ;) --Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Specify string with uniform indentation ignored

2006-09-14 Thread Sam Pointon
the string end up actually being defined as: > > """ > function otherlang(){ > doit() > } > """ > > Is there a built in way to do this? I don't much > care for: > > string = "function otherlang(){" > strin

Re: getting started, .py file

2006-02-20 Thread Sam Pointon
python -i source_file.py will do what you want. -Sam -- http://mail.python.org/mailman/listinfo/python-list

Make 1million in 6 weeks or less

2007-02-12 Thread Sam Wortzberg
Legal Consultants http://legal-rx.blogspot.com/index.html will show you how to make 1 million in less than 6 weeks! -- http://mail.python.org/mailman/listinfo/python-list

Get()

2007-12-15 Thread Sam Garson
ack (most recent call last): File "C:\Python25\lib\lib-tk\Tkinter.py", line 1403, in __call__ return self.func(*args) File "C:\My Documents\My Python\Notes.py", line 6, in insert name = ent.get() AttributeError: 'NoneType' object has no attribute 'get&

Label Variables

2007-12-17 Thread Sam Garson
File "C:\My Documents\My Python\Notes.py", line 27, in v.set = (box.get(int(number[0]))) IndexError: tuple index out of range How can i get it to only take the variable when i have selected something, or any other solution! Thanks, Sam -- I intend to live forever - so far, so good

Text into a label

2007-12-18 Thread Sam Garson
File "C:\My Documents\My Python\Notes.py", line 27, in v.set = (box.get(int(number[0]))) IndexError: tuple index out of range How can i get it to only take the variable when i have selected something, or any other solution! Thanks, Sam -- I intend to live forever - so far, so good

Im back...

2008-01-03 Thread Sam Garson
2, sticky = W+E, padx = 3) box.bind("", DeleteCurrent) box.bind("", putLabel) v = StringVar() current = Label(root, textvariable = v) current.grid(row = 3, columnspan = 2, sticky = W+E, padx = 3) root.mainloop() [end python code] how do i make it so it puts it into the v

Taskbar/System Tray

2008-01-05 Thread Sam Garson
hello group, Using tkinter, is there any way to have the program not showing on the taskbar, and even better showin in the system tray? I realise tkinter does not have that much OS specific stuff but maybe there is a way? Thanks, Sam -- I intend to live forever - so far, so good. SaM

Newbie question: Classes

2008-01-08 Thread Sam Garson
t. Is this right? it seems like nothing is any easier (except having variables locally). Is this right? Should I be creating more classes for different things or what? I can upload the .py if you want. Thanks, Sam -- I intend to live forever - so far, so good. SaM -- http://mail.python.

Re: Newbie question: Classes

2008-01-09 Thread Sam Garson
OK i've kind of got that. The only thing left is calling the class. " class Remember: def __init__(self, master): self.ent = Entry(self, ... root = Tk() app = Remember(root) " I get the error "Remember instance has no attribute 'tk' "...???

Re: Tkinter Confusion

2008-02-17 Thread Sam Garson
ng and > provides utility commands such as "Close all those token windows I've > got lying all over". > > Much less complex than IDLE, but GvR and cohorts seem to understand > what's really going on. I don't. Help appreciated. > -- > http://mail.python.org/mailman/listinfo/python-list > -- I intend to live forever - so far, so good. SaM -- http://mail.python.org/mailman/listinfo/python-list

distutils and data files

2008-02-19 Thread Sam Peterson
d open my files once they've been moved? In other words, what should I do about changing the relative path names? I need something that could work from both the extracted source folder, AND when the program gets installed via the python setup.py install command. -- Sam Peterson skpeterson

Re: distutils and data files

2008-02-21 Thread Sam Peterson
Robert Bossy <[EMAIL PROTECTED]> on Wed, 20 Feb 2008 09:29:12 +0100 didst step forth and proclaim thus: > Sam Peterson wrote: >> I've been googling for a while now and cannot find a good way to deal >> with this. >> >> I have a slightly messy python program

Re: Why """, not '''?

2008-03-06 Thread Sam Garson
The """ is for the docstring - if you need the user to know what theyre doing with the program you can create documentation, and what you put in those quotes wwill come up in that (I think) On 3/6/08, Dotan Cohen <[EMAIL PROTECTED]> wrote: > > On 06/03/2008, Dan Bishop <[EMAIL PROTECTED]> wrote: >

Question about wx folder browser widget

2009-02-01 Thread Sam Price
reinvent the wheel. Thank you, Sam Price -- http://mail.python.org/mailman/listinfo/python-list

This application has failed to start because the application configuration is incorrect

2009-02-17 Thread Sam Clark
s great on the machine where Python 2.6 is loaded, but fails on machines where I copy the .exe to the machine. I'm a beginner at python programming. In fact this is my first packaged program. Any thoughts at a beginners level would be helpful. Thank you, Sam Clark s...@2000s

Revision Control

2009-02-18 Thread Sam Clark
ee open source stuff out there? Thank you, Sam Clark s...@2000soft.com -- http://mail.python.org/mailman/listinfo/python-list

unbiased benchmark

2009-03-12 Thread Sam Ettessoc
Dear sir, I would like to share a benchmark I did. The computer used was a 2160MHz Intel Core Duo w/ 2000MB of 667MHz DDR2 SDRAM running MAC OS 10.5.6 and a lots of software running (a typical developer workstation). Python benchmark: HAMBURGUESA:benchmark sam$ echo 1+1 > bench

Your Favorite Python Book

2009-05-11 Thread Sam Tregar
x27;s your favorite? Why? -sam -- http://mail.python.org/mailman/listinfo/python-list

Re: New to python, can i ask for a little help?

2009-05-12 Thread Sam Tregar
ion. > >>> print "hello world!" > SyntaxError: invalid syntax (, line 1) > >>> > > Can anyone tell me what is wrong? I didnt expect that error > Try: print("hello world!") I believe Python 3 requires parenthesis for print. Someone else can explain why perhaps. -sam -- http://mail.python.org/mailman/listinfo/python-list

Re: Your Favorite Python Book

2009-05-15 Thread Sam Tregar
Thanks for the suggestions everyone! I've got a copy of Core Python 2nd Edition on the way. -sam -- http://mail.python.org/mailman/listinfo/python-list

Difference between list() and [] with dictionaries

2009-05-15 Thread Sam Tregar
to be equivalent but clearly they're not! I'm using Python 2.6.1 if that helps. -sam -- http://mail.python.org/mailman/listinfo/python-list

Why is math.pi slightly wrong?

2008-05-22 Thread Dutton, Sam
else? How is math.pi calculated? I searched for this on the web and in this group and couldn't find anything -- but humble apologies if this has been asked before/elsewhere. Sam Dutton SAM DUTTON SENIOR SITE DEVELOPER 200 GRAY'S INN ROAD LONDON WC1X 8XZ UNITED KINGDOM T +44 (0

RE: Why is math.pi slightly wrong?

2008-05-23 Thread Dutton, Sam
Thanks for all the answers and comments. >math.pi is exactly equal to 884279719003555/281474976710656, which is the >closest C double to the actual value of pi So much for poor old 22/7... Sam SAM DUTTON SENIOR SITE DEVELOPER 200 GRAY'S INN ROAD LONDON WC1X 8XZ UNITED KINGD

RE: where do I begin with web programming in python?

2008-05-25 Thread Dutton, Sam
This doesn't really answer your question, but you might want to consider Google App Engine. http://code.google.com/appengine/ Sam Dutton SAM DUTTON SENIOR SITE DEVELOPER 200 GRAY'S INN ROAD LONDON WC1X 8XZ UNITED KINGDOM T +44 (0)20 7430 4496 F E [EMAIL PROTECTED] WWW.IT

Integrating a code generator into IDLE

2008-06-01 Thread Sam Denton
Code generators seem to be popular in Python. (http://www.google.com/search?q=python+code-generator) I have one that I'd like to integrate into IDLE. Ideally, I'd like to (1) have a new file type show up when I use the File/Open dialog, and (2) have a function key that lets me run my generato

Re: Python and Flaming Thunder

2008-06-07 Thread Sam Denton
John Salerno wrote: "Dave Parker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On May 20, 7:05 pm, Collin <[EMAIL PROTECTED]> wrote: --- For example, consider the two statements: x = 8 x = 10 The reaction from most math teachers (and kids) was "one of those is wrong b

Re: Need help porting Perl function

2008-06-07 Thread Sam Denton
kj wrote: Hi. I'd like to port a Perl function that does something I don't know how to do in Python. (In fact, it may even be something that is distinctly un-Pythonic!) The original Perl function takes a reference to an array, removes from this array all the elements that satisfy a particular

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Sam Denton
Sengly wrote: Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun: frank,

Timer

2010-03-17 Thread Sam Bull
the function is not being run by the timer. Any help on getting this working would be appreciated. Thanks, Sam Bull signature.asc Description: This is a digitally signed message part -- http://mail.python.org/mailman/listinfo/python-list

[ANN] onlinepayment v1.0.0 released

2010-03-21 Thread Sam Tregar
onlinepayment v1.0.0 - a generic Python API for making online payments This module provides an API wrapper around a variety of payment providers. Using this module you can write code that will work the same regardless of the payment provider in use. Examples:: from onlinepayment import Onlin

Online payment module

2009-08-03 Thread Sam Tregar
like this in Python? My searches so far haven't turned up anything. If I don't find one I'll probably build one, covering PayPal and Authorize.net to start. If anyone is interested in discussing the project and/or getting involved shoot me an email. Thanks, -sam -- http://mai

Re: Online payment module

2009-08-04 Thread Sam Tregar
emotely what I'm looking for! The first is an API for accessing PayPal, but not the one I'll be using - this one has only one release and hasn't been updated in over a year, looks basically useless. The other is a full-fledged e-commerce application, not a code library. -sam --

A million requests per second with Python

2017-06-27 Thread Sam Chats
https://medium.freecodecamp.com/million-requests-per-second-with-python-95c137af319 -- https://mail.python.org/mailman/listinfo/python-list

How to build a simple neural network in 9 lines of Python code

2017-06-27 Thread Sam Chats
https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 -- https://mail.python.org/mailman/listinfo/python-list

School Management System in Python

2017-07-05 Thread Sam Chats
this does a lot more than perhaps all of them, while having a command line REPL interface. One neat thing I wanted to mention is that this project has absolutely no third-party dependencies. https://github.com/schedutron/S-Koo-L Sam Chats -- https://mail.python.org/mailman/listinfo/python-list

Re: School Management System in Python

2017-07-05 Thread Sam Chats
Check message Sorry for this message. Sam -- https://mail.python.org/mailman/listinfo/python-list

Re: School Management System in Python

2017-07-05 Thread Sam Chats
Thanks for your suggestions. I would've not used pickle had I been aware about other tools while developing this. I was thinking about migrating to sqlite3. How about that? And yes, I need more comprehanesive documentation. Will work on that soon. Thanks, Sam Chats -- https://mail.pytho

Re: School Management System in Python

2017-07-05 Thread Sam Chats
On Wednesday, July 5, 2017 at 6:56:06 PM UTC+5:30, Thomas Nyberg wrote: > On 07/05/2017 03:18 PM, YOUR_NAME_HERE wrote: > > On Wed, 5 Jul 2017 13:02:36 + (UTC) YOUR_NAME_HERE wrote: > >> I can use either tsv or csv. Which one would be better? > > > > > > Some people complain that tsv has prob

How to write raw strings to Python

2017-07-05 Thread Sam Chats
I want to write, say, 'hello\tworld' as-is to a file, but doing f.write('hello\tworld') makes the file look like: hello world How can I fix this? Thanks in advance. Sam -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   >